Commit 77c2251e authored by garciay's avatar garciay
Browse files

Add support of disk/memory cache for certificates/private keys

parent 5eebede3
Loading
Loading
Loading
Loading
+17 −10
Original line number Original line Diff line number Diff line
@@ -24,9 +24,7 @@ module LibItsGeoNetworking_Functions {
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_Functions all;
    import from LibItsSecurity_Functions all;
    import from LibItsSecurity_Pixits {
    import from LibItsSecurity_Pixits all;
        modulepar PX_CERTIFICATE_CONFIG_IDX, PX_TA_CONFIGS
    };
    
    
    // LibItsGeoNetworking
    // LibItsGeoNetworking
    import from LibItsGeoNetworking_TestSystem all;
    import from LibItsGeoNetworking_TestSystem all;
@@ -723,6 +721,11 @@ module LibItsGeoNetworking_Functions {
            vc_areaTable := p_areaTable;
            vc_areaTable := p_areaTable;
            vc_componentName := p_componentName;
            vc_componentName := p_componentName;
            
            
            f_setGenerationLocation( // TODO To be checked
                f_getTsLatitude(),
                f_getTsLongitude()
            );
            
        } // end f_initialiseComponent
        } // end f_initialiseComponent
        
        
        /**
        /**
@@ -1730,14 +1733,16 @@ module LibItsGeoNetworking_Functions {
            v_toBeSignedSecuredMessageDigest := f_buildSecuredMessagePayloadToBeSigned();
            v_toBeSignedSecuredMessageDigest := f_buildSecuredMessagePayloadToBeSigned();
            v_toBeSignedSecuredMessageCertificate := f_buildSecuredMessagePayloadToBeSigned(true);
            v_toBeSignedSecuredMessageCertificate := f_buildSecuredMessagePayloadToBeSigned(true);
            
            
            f_loadCertificates("cfg01");
            
            return f_acTriggerEvent(
            return f_acTriggerEvent(
                AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
                AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].signingPrivateKey,
                    vc_signingPrivateKey,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.x,
                    vc_atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.x,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.y.y,
                    vc_atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.y.y,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].encryptPrivateKey,
                    vc_encryptPrivateKey,
                    PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.x,
                    vc_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,
                    vc_atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.y.y,
                    bit2oct(encvalue(v_toBeSignedSecuredMessageDigest)),
                    bit2oct(encvalue(v_toBeSignedSecuredMessageDigest)),
                    bit2oct(encvalue(v_toBeSignedSecuredMessageCertificate))
                    bit2oct(encvalue(v_toBeSignedSecuredMessageCertificate))
                ) } 
                ) } 
@@ -1750,6 +1755,8 @@ module LibItsGeoNetworking_Functions {
         */
         */
        function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
        function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
            
            
            f_unloadCertificates();
            
            return f_acTriggerEvent(AcGnPrimitive:{ acDisableSecurity := m_disableSecurity } );
            return f_acTriggerEvent(AcGnPrimitive:{ acDisableSecurity := m_disableSecurity } );
            
            
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -185,7 +185,7 @@ module LibItsGeoNetworking_Pics {


        /**
        /**
         * @desc Is the IUT support secured mode?
         * @desc Is the IUT support secured mode?
         * @see  TODO
         * @see  Draft ETSI TS 103 097
         */
         */
        modulepar boolean PICS_SECURED_MODE := false;
        modulepar boolean PICS_SECURED_MODE := false;
        
        
+11 −5
Original line number Original line Diff line number Diff line
@@ -15,14 +15,20 @@ module LibItsGeoNetworking_TestSystem {
        const c_uInt16Max
        const c_uInt16Max
    };
    };
    
    
    // LibIts
    // LibItsCommon
    import from LibItsCommon_TestSystem all;
    import from LibItsCommon_TestSystem all;
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_TypesAndValues all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
    import from LibItsExternal_TypesAndValues all;
    import from LibItsExternal_TypesAndValues all;
    
    // LibItsGeoNetworking
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsGeoNetworking_Functions all;
    import from LibItsGeoNetworking_Functions all;
    
    
    // LibItsSecurity
    import from LibItsSecurity_TestSystem all;
    
    import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
    
    group portDefinitions {
    group portDefinitions {
        
        
        /**
        /**
@@ -72,7 +78,7 @@ module LibItsGeoNetworking_TestSystem {
        /**
        /**
         * @desc ITS Main Test Component
         * @desc ITS Main Test Component
         */
         */
        type component ItsMtc extends ItsBaseMtc, ServerSyncComp {
        type component ItsMtc extends ItsBaseMtc, ServerSyncComp, ItsSecurityBaseComponent { // TODO Extend ItsBaseMtc with ItsSecurityBaseComponent? {
            
            
            port UpperTesterPort utPort;
            port UpperTesterPort utPort;
            port AdapterControlPort acPort;
            port AdapterControlPort acPort;
@@ -96,7 +102,7 @@ module LibItsGeoNetworking_TestSystem {
        
        
    } // End of group componentDefinitions
    } // End of group componentDefinitions
    
    
    type component ItsBaseGeoNetworking extends ItsBaseComponent {
    type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { // TODO Extend ItsBaseComponent with ItsSecurityBaseComponent?
        
        
        port UpperTesterPort utPort;
        port UpperTesterPort utPort;
        port AdapterControlPort acPort;
        port AdapterControlPort acPort;
+2 −2

File changed.

Contains only whitespace changes.