Commit 46020922 authored by tepelmann's avatar tepelmann
Browse files

Merged with latest output of STF484.

parent 035c900a
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -722,11 +722,6 @@ module LibItsGeoNetworking_Functions {
            vc_localSeqNumber := f_getInitialSequenceNumber();
            vc_multipleMessagesCount := f_getMessageCount();
            
            f_setGenerationLocation(
                f_getTsLatitude(),
                f_getTsLongitude()
            );
            
        } // end f_initialiseComponent
        
        /**
@@ -1741,25 +1736,18 @@ module LibItsGeoNetworking_Functions {
        function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
            
            // Local variables
            var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessageDigest;
            var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessageCertificate;
            
            // Load certificates
            if( not f_loadCertificates(PX_CONFIG_DIRECTORY_FOR_SECURITY) ) {
                return e_error;
            }
            

            // Initialize vc_location
            f_setGenerationLocation(
                f_getTsLatitude(),
                f_getTsLongitude()
            );
            
            // Build the beacon template
            v_toBeSignedSecuredMessageDigest := f_buildSecuredMessagePayloadToBeSigned();
            v_toBeSignedSecuredMessageCertificate := f_buildSecuredMessagePayloadToBeSigned(true);
            
            return f_acTriggerEvent(
                AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
                    cc_taCert_A
+6 −58
Original line number Diff line number Diff line
@@ -144,58 +144,6 @@ module LibItsSecurity_Functions {
                return true;
            } // End of function f_prepareCertificates
            
            /**
            * @desc Build a template of a secured beacon to be used for the Test Adapter secured beaconing processing
            */
            function f_buildSecuredMessagePayloadToBeSigned(
                                                            in boolean p_includeCertificate := false
            ) runs on ItsSecurityBaseComponent return ToBeSignedSecuredMessage {
                
                // Local variables
                var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage;
                
                // Build the beacon template
                if (p_includeCertificate == true) {
                    v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage(
                        { // Field HeaderFields
                            m_header_field_signer_info(
                                m_signerInfo_certificate(
                                    vc_atCertificate
                                ) // End of template m_signerInfo_certificate
                            ), // End of template m_header_field_signer_info
                            m_header_field_generation_time(oct2int('BBBBBBBB'O)),   // To be replaced by TA with generation time
                            m_header_field_generation_location(
                                vc_location
                            )
                        }, // End of field HeaderFields
                        m_payload_signed(
                            'AAAAAAAAAA'O                                           // To be replaced by TA with real payload
                        ),
                        e_signature
                    );
                } else {
                    v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage(
                        { // Field HeaderFields
                            m_header_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                                ) // End of template m_signerInfo_certificate
                            ), // End of template m_header_field_signer_info
                            m_header_field_generation_time(oct2int('BBBBBBBB'O)),   // To be replaced by TA with generation time
                            m_header_field_generation_location(
                                vc_location
                            )
                        }, // End of field HeaderFields
                        m_payload_signed(
                            'AAAAAAAAAA'O                                           // To be replaced by TA with real payload
                        ),
                        e_signature
                    );
                }
                
                return valueof(v_toBeSignedSecuredMessage);
            }
            
            /**
             * @desc  This function build and sign the SecureMessage part covered by the signature process
             * @param p_securedMessage      The signed  SecureMessage part