Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
a8efb6a6
Commit
a8efb6a6
authored
Jan 26, 2018
by
garciay
Browse files
ATS security review
parent
652c7f0e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
ttcn/AtsSecurity/ItsSecurity_Functions.ttcn
View file @
a8efb6a6
...
...
@@ -55,20 +55,20 @@ module ItsSecurity_Functions {
* @desc Prepare a secured CAM
* @param p_configId The configuration identifier to be used
* @param p_headerFields HeaderInfo to be inserted in the message
* @param p_
issu
erIdentifier Add digest or AT certificate or certificate chain
* @param p_
sign
erIdentifier Add digest or AT certificate or certificate chain
* @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields
* @return Secured GeoNetworking packet containing a CAM
*/
function
f_prepareSecuredCam
(
in
charstring
p_configId
,
in
template
(
omit
)
HeaderInfo
p_header
Fields
:=
omit
,
in
SignerIdentifier
p_
issu
erIdentifier
,
// := e_certificate_digest_with_sha256
,
in
boolean
p_addMissingHeaders
:=
true
in
HeaderInfo
p_header
Info
,
in
SignerIdentifier
p_
sign
erIdentifier
/*
,
in boolean p_addMissingHeaders := true
*/
)
runs
on
ItsGeoNetworking
return
GeoNetworkingPdu
{
// Local variables
var
GnNonSecuredPacket
v_gnNonSecuredPacket
;
var
octetstring
v_gnPayload
;
var
template
(
value
)
Ieee1609Dot2
Data
v_securedMessage
:=
{}
;
var
template
(
value
)
EtsiTs103097
Data
v_securedMessage
;
// Build signed Ieee1609Dot2Data
v_gnNonSecuredPacket
:=
valueof
(
m_geoNwShbPacket
(
...
...
@@ -93,14 +93,19 @@ module ItsSecurity_Functions {
v_gnNonSecuredPacket
)
);
/*
f_buildGnSecuredCam(
f_buildGnSecuredCam
(
v_securedMessage
,
m_payload_signed(v_gnPayload),
p_issuerIdentifier,
p_headerFields,
p_configId,
p_addMissingHeaders
);*/
valueof
(
m_toBeSignedData
(
m_signedDataPayload
(
m_etsiTs103097Data_unsecured
(
v_gnPayload
)),
p_headerInfo
)),
p_signerIdentifier
,
p_configId
/*,
p_addMissingHeaders*/
);
// Return secured Gn packet
return
valueof
(
m_geoNwSecPdu
(
v_gnNonSecuredPacket
,
v_securedMessage
));
...
...
@@ -186,12 +191,12 @@ module ItsSecurity_Functions {
*/
function
f_sendSecuredCam
(
in
charstring
p_configId
,
in
template
(
omit
)
HeaderInfo
p_header
Fields
:=
omit
,
in
SignerIdentifier
p_issuerIdentifier
// := e_certificate_digest_with_sha256
in
HeaderInfo
p_header
Info
,
in
SignerIdentifier
p_issuerIdentifier
)
runs
on
ItsGeoNetworking
return
GeoNetworkingPdu
{
// Local variables
var
GeoNetworkingPdu
v_securedGnPdu
:=
{};
//
f_prepareSecuredCam(p_configId, p_header
Fields
, p_issuerIdentifier);
var
GeoNetworkingPdu
v_securedGnPdu
:=
f_prepareSecuredCam
(
p_configId
,
p_header
Info
,
p_issuerIdentifier
);
f_sendGeoNetMessage
(
valueof
(
m_geoNwReq_linkLayerBroadcast
(
v_securedGnPdu
)));
...
...
ttcn/AtsSecurity/ItsSecurity_TestCases.ttcn
View file @
a8efb6a6
This diff is collapsed.
Click to expand it.
ttcn/AtsSecurity/ItsSecurity_TestControl.ttcn
View file @
a8efb6a6
This diff is collapsed.
Click to expand it.
ttcn/TestCodec/TestCodec_SecuredMessages.ttcn
View file @
a8efb6a6
...
...
@@ -188,20 +188,29 @@ module TestCodec_SecuredMessages {
}
)
);
v_raw_payload_to_be_signed
:=
bit2oct
(
encvalue
(
v_gnPacket
));
v_raw_payload_to_be_signed
:=
bit2oct
(
encvalue
(
m_toBeSignedData
(
m_signedDataPayload
(
m_etsiTs103097Data_unsecured
(
v_raw_payload_to_be_signed
)
),
m_headerInfo_gn
(
-
,
12345
,
123456
)
)));
v_secured_data
:=
m_etsiTs103097Data_signed
(
m_signedData
(
sha256
,
m_toBeSignedData
(
m_signedDataPayload
(
m_etsiTs103097Data_unsecured
(
v_raw_payload_to_be_signed
)
),
m_headerInfo_gn
(
-
,
12345
,
123456
)
),
m_signedDataPayload
(
m_etsiTs103097Data_unsecured
(
v_raw_payload_to_be_signed
)
),
m_headerInfo_gn
(
-
,
12345
,
123456
)
),
{
digest
:=
v_digest
},
m_signature_ecdsaNistP256
(
m_ecdsaP256Signature
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment