Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TTCN-3 Libraries
LibIts
Commits
9d2bfee0
Commit
9d2bfee0
authored
Jun 01, 2021
by
YannGarcia
Browse files
STF594: Finalyse new CAM & DENM tests
parent
ee4cd931
Changes
1
Hide whitespace changes
Inline
Side-by-side
ttcn/Security/LibItsSecurity_Functions.ttcn
View file @
9d2bfee0
/**
* @
a
uthor ETSI / STF481 / STF507 / STF517 / STF538 / STF545
* @
A
uthor ETSI / STF481 / STF507 / STF517 / STF538 / STF545
* @version $Url$
* $Id$
* @desc Module containing functions for Security Protocol
...
...
@@ -1179,9 +1179,7 @@ module LibItsSecurity_Functions {
in
boolean
p_add_encryption_key
,
in
boolean
p_alter_signature_algorithm
,
in
boolean
p_alter_signer_identifier
,
in
boolean
p_alterIssuerIdentifier
,
in
boolean
p_alterATCertificateSignature
,
in
boolean
p_alterAACertificateSignature
in
boolean
p_alter_signature
)
runs
on
ItsSecurityBaseComponent
return
boolean
{
// Local variables
...
...
@@ -1308,6 +1306,15 @@ module LibItsSecurity_Functions {
if
(
p_alter_signer_identifier
==
true
)
{
p_securedMessage
.
content
.
signedData
.
signer
:=
valueof
(
m_signerIdentifier_self
);
}
if
(
p_alter_signature
==
true
)
{
if
(
ischosen
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
))
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
.
sSig
));
}
else
if
(
ischosen
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
))
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
.
sSig
));
}
else
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP384r1Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP384r1Signature
.
sSig
));
}
}
return
f_buildGnSecuredMessage
(
p_securedMessage
,
p_certificateName
,
p_payloadField
);
/*if (p_alterATCertificateSignature == true) {
...
...
@@ -1462,9 +1469,7 @@ module LibItsSecurity_Functions {
in
boolean
p_add_encryption_key
,
in
boolean
p_alter_signature_algorithm
,
in
boolean
p_alter_signer_identifier
,
in
boolean
p_alterIssuerIdentifier
,
in
boolean
p_alterATCertificateSignature
,
in
boolean
p_alterAACertificateSignature
in
boolean
p_alter_signature
)
runs
on
ItsSecurityBaseComponent
return
boolean
{
// Local variables
var
EtsiTs103097Certificate
v_aaCertificate
,
v_atCertificate
;
...
...
@@ -1579,7 +1584,7 @@ module LibItsSecurity_Functions {
r_sig
:=
valueof
(
m_eccP256CurvePoint_x_only
(
str2oct
(
substr
(
oct2str
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP384r1Signature
.
rSig
.
x_only
),
0
,
32
*
2
))));
}
else
{
// TODO
log
(
"f_buildGnSecured
Ca
m_Bo: Unsupported signature variant"
);
log
(
"f_buildGnSecured
Den
m_Bo: Unsupported signature variant"
);
}
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
:=
valueof
(
m_ecdsaSignature
(
r_sig
,
...
...
@@ -1590,7 +1595,15 @@ module LibItsSecurity_Functions {
if
(
p_alter_signer_identifier
==
true
)
{
p_securedMessage
.
content
.
signedData
.
signer
:=
valueof
(
m_signerIdentifier_self
);
}
if
(
p_alter_signature
==
true
)
{
if
(
ischosen
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
))
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaNistP256Signature
.
sSig
));
}
else
if
(
ischosen
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
))
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP256r1Signature
.
sSig
));
}
else
{
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP384r1Signature
.
sSig
:=
not4b
(
valueof
(
p_securedMessage
.
content
.
signedData
.
signature_
.
ecdsaBrainpoolP384r1Signature
.
sSig
));
}
}
return
f_buildGnSecuredMessage
(
p_securedMessage
,
p_certificateName
,
p_payloadField
);
}
// End of function f_buildGnSecuredDenm_Bo
...
...
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