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

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

parent 5eebede3
......@@ -24,9 +24,7 @@ module LibItsGeoNetworking_Functions {
import from LibItsSecurity_TypesAndValues all;
import from LibItsSecurity_Templates all;
import from LibItsSecurity_Functions all;
import from LibItsSecurity_Pixits {
modulepar PX_CERTIFICATE_CONFIG_IDX, PX_TA_CONFIGS
};
import from LibItsSecurity_Pixits all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
......@@ -723,6 +721,11 @@ module LibItsGeoNetworking_Functions {
vc_areaTable := p_areaTable;
vc_componentName := p_componentName;
f_setGenerationLocation( // TODO To be checked
f_getTsLatitude(),
f_getTsLongitude()
);
} // end f_initialiseComponent
/**
......@@ -1730,14 +1733,16 @@ module LibItsGeoNetworking_Functions {
v_toBeSignedSecuredMessageDigest := f_buildSecuredMessagePayloadToBeSigned();
v_toBeSignedSecuredMessageCertificate := f_buildSecuredMessagePayloadToBeSigned(true);
f_loadCertificates("cfg01");
return f_acTriggerEvent(
AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(
PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].signingPrivateKey,
PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].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,
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.y.y,
vc_signingPrivateKey,
vc_atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.x,
vc_atCertificate.subject_attributes[0].attribute.key.public_key.eccPoint.y.y,
vc_encryptPrivateKey,
vc_atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.x,
vc_atCertificate.subject_attributes[1].attribute.key.public_key.aesCcm.eccPoint.y.y,
bit2oct(encvalue(v_toBeSignedSecuredMessageDigest)),
bit2oct(encvalue(v_toBeSignedSecuredMessageCertificate))
) }
......@@ -1750,6 +1755,8 @@ module LibItsGeoNetworking_Functions {
*/
function f_acDisableSecurity() runs on ItsBaseGeoNetworking return FncRetCode {
f_unloadCertificates();
return f_acTriggerEvent(AcGnPrimitive:{ acDisableSecurity := m_disableSecurity } );
}
......@@ -2559,7 +2566,7 @@ module LibItsGeoNetworking_Functions {
);
// Add CAM payload
v_gnNonSecuredPacket.payload := f_adaptPayload_m(p_payload);
f_buildGnSecuredCam(
v_securedMessage,
bit2oct(encvalue(v_gnNonSecuredPacket)),
......
......@@ -185,7 +185,7 @@ module LibItsGeoNetworking_Pics {
/**
* @desc Is the IUT support secured mode?
* @see TODO
* @see Draft ETSI TS 103 097
*/
modulepar boolean PICS_SECURED_MODE := false;
......
......@@ -15,14 +15,20 @@ module LibItsGeoNetworking_TestSystem {
const c_uInt16Max
};
// LibIts
// LibItsCommon
import from LibItsCommon_TestSystem all;
import from LibItsCommon_TypesAndValues all;
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
import from LibItsExternal_TypesAndValues all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Functions all;
// LibItsSecurity
import from LibItsSecurity_TestSystem all;
import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
group portDefinitions {
/**
......@@ -72,7 +78,7 @@ module LibItsGeoNetworking_TestSystem {
/**
* @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 AdapterControlPort acPort;
......@@ -96,7 +102,7 @@ module LibItsGeoNetworking_TestSystem {
} // End of group componentDefinitions
type component ItsBaseGeoNetworking extends ItsBaseComponent {
type component ItsBaseGeoNetworking extends ItsBaseComponent, ItsSecurityBaseComponent { // TODO Extend ItsBaseComponent with ItsSecurityBaseComponent?
port UpperTesterPort utPort;
port AdapterControlPort acPort;
......
......@@ -7,11 +7,11 @@
*/
module LibItsGeoNetworking_TypesAndValues {
//LibCommon
// LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIts
// LibIts
import from LibItsCommon_TypesAndValues all;
import from LibItsBtp_TypesAndValues {type BtpPacket;}
import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment