Commit 6fcc4da3 authored by Bostjan Pintar's avatar Bostjan Pintar
Browse files

Merge branch 'TTF0002' of https://forge.etsi.org/gitlab/LIBS/LibIts into TTF0002

parents dc79687e 2edfaf56
......@@ -28,8 +28,8 @@ module LibItsRtcmem_TypesAndValues {
* @desc Upper Tester results message of the Rtcmem/Ssem IUT
* @member utRtcmemInitialize -
* @member utRtcmemTriggerResult -
* @member utAutoInteropTriggerResult -
* @member utRtcmemChangePositionResult -
* @member utRtcmemUpdateResult -
* @member utRtcmemTerminationResult -
*/
type union UtRtcmemResults {
boolean utRtcmemInitializeResult,
......@@ -81,7 +81,7 @@ module LibItsRtcmem_TypesAndValues {
type record UtRtcmemEventInd {
RTCMEM rtcmemMsg
} with {
encode (rtcmemMsg) "LibItsRtcmem_asn1"
encode (rtcmemMsg) "PER"
}
/**
......
......@@ -2331,6 +2331,28 @@ module LibItsSecurity_Functions {
return true;
} // End of function f_getCertificateFromHashedId3
function f_getCertificateIssuer(
in IssuerIdentifier p_issuer
) return HashedId8 {
if (ischosen(p_issuer.sha256AndDigest)) {
return p_issuer.sha256AndDigest;
} else if (ischosen(p_issuer.sha256AndDigest)) {
return p_issuer.sha256AndDigest;
}
return int2oct(0, 8);
}
function f_getHashAlgorithm(
in IssuerIdentifier p_issuer
) return HashAlgorithm {
if (ischosen(p_issuer.sha256AndDigest)) {
return sha256;
} else if (ischosen(p_issuer.sha256AndDigest)) {
return sha384;
}
return p_issuer.self_;
}
/**
* @desc Read the signing private key for the specified certificate
* @param p_keysId the keys identifier
......
......@@ -42,9 +42,9 @@ module LibItsSecurity_Pixits {
modulepar Psid PX_OTHER_ITS_AID := 141; // Assign to GN-MGMT, Other than CA, DEN, MAP, SPAT, IVI, SRE, SSE & GN-MGMT: 38
/**
* @desc Invalid protocol version. Default: 2
* @desc Invalid protocol version. Default: 3
*/
modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 2;
modulepar UInt8 PX_WRONG_PROTOCOL_VERSION := 3;
/**
* @desc Invalid WGS longitude
......@@ -56,22 +56,4 @@ module LibItsSecurity_Pixits {
*/
modulepar SecLatitude PX_WGSLATITUDE := 0;
/**
* @desc Invalid digest. Default: 1
*/
modulepar HashedId8 PX_OTHER_CERT_DIGEST := '0000000000000000'O;
/**
* @desc AES-128-CCM nonce public key
*/
modulepar Oct12 PX_ENCRYPTIONPARAMETERS_AES_128_CCM_NONCE := 'C0FFEEDECAC0FFEEDECA0000'O;
modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_1 := 250;
modulepar CountryOnly PX_GENERATED_CERTIFICATE_REGION_COUNTRY_2 := 380;
modulepar Int16 PX_GENERATED_CERTIFICATE_DURATION := 120;
modulepar SubjectAssurance PX_GENERATED_CERTIFICATE_SUBJECT_ASSURENCE_LEVEL := '00'O;
} // End of module LibItsSecurity_Pixits
......@@ -55,5 +55,5 @@ module LibItsSremSsem_EncdecDeclarations {
with {extension "prototype(convert) encode(PER)"}
external function fx_dec_SSM (inout bitstring b, out SignalStatusMessage p) return integer
with {extension "prototype(sliding) decode(PER)"}*/
with {extension "prototype(sliding) decode(PER)"}*/
}
......@@ -293,7 +293,8 @@ module LibItsSremSsem_Functions {
* @param p_certificateId The certificate identifier the TA shall use in case of secured IUT
*/
function f_cfUp(
in charstring p_certificateId := PX_CERT_FOR_TS
in charstring p_certificateId := PX_CERT_FOR_TS,
in charstring p_iutCertificateId := ""
) runs on ItsSremSsem system ItsSremSsemSystem {
map(self:acPort, system:acPort);
......@@ -308,7 +309,7 @@ module LibItsSremSsem_Functions {
f_initialiseSecuredMode(p_certificateId);
//Initialze the IUT
f_prInitialState();
f_prInitialState(p_iutCertificateId);
} // End of f_cfUp
......@@ -381,6 +382,45 @@ module LibItsSremSsem_Functions {
group sendFunctions {
/**
* @desc Sends a SREM message for cancellation
*/
function f_sendSreMessageForCancellation() runs on ItsSremSsem {
// Send SREM cancellation
sremSsemPort.send(
m_sremReq(
m_sremPdu(
m_srem(
m_requestorDescription(
m_vehicleID(
f_getIutStationId()
),
m_requestorType(
basicVehicle
)
),
{
m_signalRequestPackage(
m_signalRequest(
m_intersectionReferenceID,
17,
priorityCancellation,
{ lane := 2 }
)
)
}))));
tc_noac.start;
alt {
[] sremSsemPort.receive(mw_ssemInd) {
tc_noac.stop;
log("*** " & testcasename() & ": INCONC: Received SSEM PDU after cancellation. ***");
}
[] tc_noac.timeout {
log("*** " & testcasename() & ": PASS: No more SSEM PDU received after cancellation. ***");
}
}
}
/**
* @desc Sends a SSEM message
* @param p_sendMsg The IVI message to send.
......@@ -423,6 +463,39 @@ module LibItsSremSsem_Functions {
}
}
/**
* @desc Awaits a SREM and returns it
* @param p_rcvMsg The expected message to be received.
*/
function f_awaitSreMessageCancellation(
template (present) RequestID p_requestID := ?
) runs on ItsSremSsem {
tc_ac.start;
alt {
[] sremSsemPort.receive(
mw_sremInd(
mw_sremPdu(
mw_sremWellFormatted(
mw_requestorDescription,
{
mw_signalRequestPackage(
mw_signalRequest(
?,
p_requestID,
priorityCancellation
))
},
?
)))) {
tc_ac.stop;
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INFO: Timeout while awaiting the reception of a message ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
}
}
} // End of group receiveFunctions
group miscellaneousFunctions {
......
......@@ -53,6 +53,7 @@ module LibItsSremSsem_Templates {
template (present) SREM p_sremMsg
) := {
msgIn := p_sremMsg,
recvTime := ?,
gnNextHeader := *,
gnHeaderType := *,
gnHeaderSubtype := *,
......@@ -136,6 +137,7 @@ module LibItsSremSsem_Templates {
template (present) SSEM p_ssemMsg := ?
) := {
msgIn := p_ssemMsg,
recvTime := ?,
gnNextHeader := *,
gnHeaderType := *,
gnHeaderSubtype := *,
......@@ -483,6 +485,24 @@ module LibItsSremSsem_Templates {
regional := omit
}
template (value) RequestorPositionVector m_requestor_position(
in template (value) Position3D p_position
) := {
position := p_position,
heading := omit,
speed := omit
} // End of template m_requestor_position
template (value) Position3D m_position3D(
in template (value) Latitude p_latitude,
in template (value) Longitude p_longitude
) := {
lat := p_latitude, // in 1/10th micro degrees
long := p_longitude, // in 1/10th micro degrees
elevation := omit, // in 10 cm units
regional := omit
}
} // End of group sremTemplatesSend
group sremTemplatesRecv {
......@@ -506,8 +526,8 @@ module LibItsSremSsem_Templates {
template (present) RequestorDescription p_requestor := ?,
template (present) SignalRequestList p_requests := ?,
template (present) MsgCount p_sequenceNumber := ?,
template MinuteOfTheYear p_timeStamp := *,
template DSecond p_second := *
template (present) DSecond p_second := ?,
template MinuteOfTheYear p_timeStamp := *
) modifies mw_defaultSrem := {
timeStamp := p_timeStamp,
second := p_second,
......
......@@ -104,6 +104,7 @@ module LibItsSremSsem_TestSystem {
type record SremInd {
SREM msgIn,
UInt64 recvTime,
UInt8 gnNextHeader optional,
UInt8 gnHeaderType optional,
UInt8 gnHeaderSubtype optional,
......@@ -115,13 +116,14 @@ module LibItsSremSsem_TestSystem {
UInt32 its_aid optional
}
with {
encode (msgIn) "PER"
encode (msgIn) "LibItsSremSsem_asn1"
}
type record of SremInd SremInds;
type record SsemInd {
SSEM msgIn,
UInt64 recvTime,
UInt8 gnNextHeader optional,
UInt8 gnHeaderType optional,
UInt8 gnHeaderSubtype optional,
......
......@@ -92,7 +92,7 @@ module LibItsSremSsem_TypesAndValues {
type record UtSremEventInd {
SREM sreMsg
} with {
encode (sreMsg) "LibItsSremSsem_asn1"
encode (sreMsg) "PER"
}
/**
......@@ -101,7 +101,7 @@ module LibItsSremSsem_TypesAndValues {
type record UtSsemEventInd {
SSEM sseMsg
} with {
encode (sseMsg) "LibItsSremSsem_asn1"
encode (sseMsg) "PER"
}
/**
......
Markdown is supported
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