Loading ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +83 −8 Original line number Original line Diff line number Diff line Loading @@ -2553,8 +2553,9 @@ module LibItsGeoNetworking_Functions { * @desc Wait for GN message with security containing digest as a signer info * @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 * @return the digest of the certificate been used to sign received message */ */ function f_waitForDigest(out HashedId8 p_digest) function f_waitForDigest( runs on ItsGeoNetworking return boolean { out HashedId8 p_digest ) runs on ItsGeoNetworking return boolean { // Local variables // Local variables var SecuredMessage v_recv; var SecuredMessage v_recv; var boolean v_ret := false; var boolean v_ret := false; Loading @@ -2572,6 +2573,37 @@ module LibItsGeoNetworking_Functions { return v_ret; return v_ret; } // End of function f_waitForDigest } // 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 } // End of group waitingHelpers group CertRequests{ group CertRequests{ Loading @@ -2579,9 +2611,7 @@ module LibItsGeoNetworking_Functions { function f_sendCertificateRequest( function f_sendCertificateRequest( in template (value) HashedId8 p_digest, in template (value) HashedId8 p_digest, in template (value) octetstring p_payload in template (value) octetstring p_payload ) ) runs on ItsGeoNetworking { runs on ItsGeoNetworking { var GeoNetworkingReq v_gnReq; var GeoNetworkingReq v_gnReq; var GnNonSecuredPacket v_gnNonSecuredPacket; var GnNonSecuredPacket v_gnNonSecuredPacket; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; Loading Loading @@ -2619,6 +2649,51 @@ module LibItsGeoNetworking_Functions { } // End of function f_sendCertificateRequest } // 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(f_adaptPayload_m(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 } // End of group CertRequests group messageGetters { group messageGetters { Loading Loading
ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +83 −8 Original line number Original line Diff line number Diff line Loading @@ -2553,8 +2553,9 @@ module LibItsGeoNetworking_Functions { * @desc Wait for GN message with security containing digest as a signer info * @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 * @return the digest of the certificate been used to sign received message */ */ function f_waitForDigest(out HashedId8 p_digest) function f_waitForDigest( runs on ItsGeoNetworking return boolean { out HashedId8 p_digest ) runs on ItsGeoNetworking return boolean { // Local variables // Local variables var SecuredMessage v_recv; var SecuredMessage v_recv; var boolean v_ret := false; var boolean v_ret := false; Loading @@ -2572,6 +2573,37 @@ module LibItsGeoNetworking_Functions { return v_ret; return v_ret; } // End of function f_waitForDigest } // 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 } // End of group waitingHelpers group CertRequests{ group CertRequests{ Loading @@ -2579,9 +2611,7 @@ module LibItsGeoNetworking_Functions { function f_sendCertificateRequest( function f_sendCertificateRequest( in template (value) HashedId8 p_digest, in template (value) HashedId8 p_digest, in template (value) octetstring p_payload in template (value) octetstring p_payload ) ) runs on ItsGeoNetworking { runs on ItsGeoNetworking { var GeoNetworkingReq v_gnReq; var GeoNetworkingReq v_gnReq; var GnNonSecuredPacket v_gnNonSecuredPacket; var GnNonSecuredPacket v_gnNonSecuredPacket; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage; Loading Loading @@ -2619,6 +2649,51 @@ module LibItsGeoNetworking_Functions { } // End of function f_sendCertificateRequest } // 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(f_adaptPayload_m(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 } // End of group CertRequests group messageGetters { group messageGetters { Loading