Commit 9d2bfee0 authored by YannGarcia's avatar YannGarcia
Browse files

STF594: Finalyse new CAM & DENM tests

parent ee4cd931
/**
* @author ETSI / STF481 / STF507 / STF517 / STF538 / STF545
* @Author 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_buildGnSecuredCam_Bo: Unsupported signature variant");
log("f_buildGnSecuredDenm_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
......
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