Loading ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +65 −60 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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( Loading @@ -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 )), Loading @@ -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 )), Loading @@ -2604,7 +2609,7 @@ module LibItsGeoNetworking_Functions { ) { // Nothing to do } } // End of altstep a_securedMessageWithDigest }*/ // End of altstep a_securedMessageWithDigest } // End of group altSteps Loading @@ -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)) { Loading @@ -2631,7 +2636,7 @@ module LibItsGeoNetworking_Functions { } } } } // End of 'alt' statement }*/ // End of 'alt' statement return v_ret; } // End of function f_waitForCertificate Loading @@ -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; } Loading @@ -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)) { Loading @@ -2682,7 +2687,7 @@ module LibItsGeoNetworking_Functions { } } } } }*/ return v_ret; } /** Loading @@ -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)) { Loading @@ -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 Loading @@ -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 Loading @@ -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 )), Loading @@ -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 Loading @@ -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, Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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; } Loading ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(), Loading @@ -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 := { Loading ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +2 −7 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -190,7 +185,7 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoNetworkingPacket { GnNonSecuredPacket packet, SecuredMessage securedMsg optional EtsiTs103097Data securedMsg optional } with { encode (securedMsg) "LibItsSecurity" } Loading ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +12 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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)"} Loading @@ -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 Loading @@ -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 Loading
ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +65 −60 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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( Loading @@ -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 )), Loading @@ -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 )), Loading @@ -2604,7 +2609,7 @@ module LibItsGeoNetworking_Functions { ) { // Nothing to do } } // End of altstep a_securedMessageWithDigest }*/ // End of altstep a_securedMessageWithDigest } // End of group altSteps Loading @@ -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)) { Loading @@ -2631,7 +2636,7 @@ module LibItsGeoNetworking_Functions { } } } } // End of 'alt' statement }*/ // End of 'alt' statement return v_ret; } // End of function f_waitForCertificate Loading @@ -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; } Loading @@ -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)) { Loading @@ -2682,7 +2687,7 @@ module LibItsGeoNetworking_Functions { } } } } }*/ return v_ret; } /** Loading @@ -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)) { Loading @@ -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 Loading @@ -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 Loading @@ -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 )), Loading @@ -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 Loading @@ -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, Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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; } Loading
ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(), Loading @@ -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 := { Loading
ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +2 −7 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -190,7 +185,7 @@ module LibItsGeoNetworking_TypesAndValues { type record GeoNetworkingPacket { GnNonSecuredPacket packet, SecuredMessage securedMsg optional EtsiTs103097Data securedMsg optional } with { encode (securedMsg) "LibItsSecurity" } Loading
ttcn/Security/LibItsSecurity_EncdecDeclarations.ttcn +12 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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)"} Loading @@ -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 Loading @@ -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