Commit e506ce4d authored by garciay's avatar garciay
Browse files

Add support of secured beacon with certificate in TA

parent 3322fc51
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -1714,10 +1714,12 @@ module LibItsGeoNetworking_Functions {
        function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
        function f_acEnableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
            
            
            // Local variables
            // Local variables
            var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage;
            var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessageDigest;
            var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessageCertificate;
            
            
            // Build the beacon template
            // Build the beacon template
            v_toBeSignedSecuredMessage := f_buildSecuredMessagePayloadToBeSigned();
            v_toBeSignedSecuredMessageDigest := f_buildSecuredMessagePayloadToBeSigned();
            v_toBeSignedSecuredMessageCertificate := f_buildSecuredMessagePayloadToBeSigned(true);
            
            
            return f_acTriggerEvent(
            return f_acTriggerEvent(
                AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
                AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
@@ -1727,8 +1729,9 @@ module LibItsGeoNetworking_Functions {
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].encryptPrivateKey,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].encryptPrivateKey,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.x,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.x,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.y.y,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.y.y,
                    bit2oct(encvalue(v_toBeSignedSecuredMessage
                    bit2oct(encvalue(v_toBeSignedSecuredMessageDigest)),
                ))) } 
                    bit2oct(encvalue(v_toBeSignedSecuredMessageCertificate))
                ) } 
            );
            );
        }
        }