Commit 34a8250f authored by garciay's avatar garciay
Browse files

Add certificates for a second configuration (unknown ITS)

parent a05902d5
......@@ -190,7 +190,8 @@ module LibItsSecurity_Functions {
out template (value) SecuredMessage p_securedMessage,
in octetstring p_unsecuredPayload,
in template (omit) boolean p_addCertificate := false,
in template (omit) HeaderFields p_headerFields := omit
in template (omit) HeaderFields p_headerFields := omit,
in UInt p_configId := PX_CERTIFICATE_CONFIG_IDX
) return boolean {
// Local variables
......@@ -198,6 +199,11 @@ module LibItsSecurity_Functions {
var Oct32 v_hash;
var template (value) ToBeSignedSecuredMessage v_toBeSignedSecuredMessage;
// Sanity check
if (not(p_configId < lengthof(PX_TA_CONFIGS)) ) {
return false;
}
// Create SecuredMessage payload to be signed
if (valueof(p_addCertificate) == true) { // Add the AT certificate
v_toBeSignedSecuredMessage := m_toBeSignedSecuredMessage(
......@@ -205,7 +211,7 @@ module LibItsSecurity_Functions {
{ // Field HeaderFields
m_header_field_signer_info(
m_signerInfo_certificate(
PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate
PX_TA_CONFIGS[p_configId].atCertificate
) // End of template m_signerInfo_certificate
), // End of template m_header_field_signer_info
m_header_field_generation_time(f_getCurrentTime()),
......@@ -224,7 +230,7 @@ module LibItsSecurity_Functions {
{ // Field HeaderFields
m_header_field_signer_info(
m_signerInfo_digest(
PX_TA_CONFIGS[PX_CERTIFICATE_CONFIG_IDX].atCertificate.signer_infos[0].signerInfo.digest
PX_TA_CONFIGS[p_configId].atCertificate.signer_infos[0].signerInfo.digest
) // End of template m_signerInfo_digest
), // End of template m_header_field_digest
m_header_field_generation_time(f_getCurrentTime()),
......
......@@ -8,6 +8,7 @@
module LibItsSecurity_Pixits {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibItsSecurity
......@@ -17,7 +18,7 @@ module LibItsSecurity_Pixits {
/**
* @desc Index on the certificate to be used. Default: configuration #0
*/
modulepar integer PX_CERTIFICATE_CONFIG_IDX := 0;
modulepar UInt PX_CERTIFICATE_CONFIG_IDX := 0;
/**
* @desc CA certificates to be used by the Test Adapter
......@@ -98,7 +99,83 @@ module LibItsSecurity_Pixits {
'23c3a850cd15835927cb2da694e9d00a865fe80771d9a7f77b50829491666731'O
)
))
} // End of config #0
}, // End of config #0
{ // Config #1
version := 2,
signer_infos := {
{
type_ := e_self,
signerInfo := omit
}
},
subject_info := valueof(m_subject_info_root_ca(
'455453495f506c7567746573745f526f6f74'O // ETSI_Plugtest_Root
)),
subject_attributes := {
valueof(m_subject_attribute_verification_key(
m_publicKey_eccPoint(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'00eee64d49acb410a6701a44d88fea09a0cd82a055c07720df06eb3dc2ddc38e'O,
'b3fd58f18d767a1a69e3be749f4dc968c39cf7387191d5ae23cdb08235fef5de'O
)
)
)),
valueof(m_subject_attribute_encryption_key(
m_publicKey_aesccm(
m_aesccm(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'e6553f8c2fd5587dbdf7e9529e1325e21044d1e5a0f3b6c69ededa03e03400a9'O,
'dbfb791412418770d101f47993a32a93c721265069443ad87ff9ca29815203ce'O
)
)
)
)),
valueof(m_subject_attribute_assurance_level(
m_subjectAssurance(
'001'B,
'00'B
)
)),
valueof(m_subject_attribute_its_aid_list(
{
16512,
16513
}
))
},
validity_restrictions := {
valueof(m_validity_restriction_time_start_and_end(
1411221485,
1513691885
)),
valueof(m_validity_restriction_region(
m_geographicRegion_polygonial(
{
{
latitude := 498716540,
longitude := 86382080
},
{
latitude := 498685550,
longitude := 86411050
},
{
latitude := 492040400,
longitude := 86475600
}
}
)
))
},
signature_ := valueof(m_signature(
m_ecdsaSignature(
m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
'8a526099f57a9195753c9a01480906ec6eaa6c1000570ad026a5e3437d7fddb6'O
),
'42d56f29db683b8d9e0dd2807975e837945e409bd40f3a41650369aa1213ccc5'O
)
))
} // End of config #1
// TODO Add additional configurations
}; // End of modulepar PX_CA_CERTIFICATES
......@@ -183,7 +260,85 @@ module LibItsSecurity_Pixits {
'b58aa41fae5813d9df7f05d255880e18837d6c97ec39696c885189d68bf71b42'O
)
))
} // End of config #0
}, // End of config #0
{ // Config #1
version := 2,
signer_infos := {
{
type_ := e_certificate_digest_with_ecdsap256,
signerInfo := {
digest := '6e3c7a1945325a8e'O
} // End of field signerInfo
}
},
subject_info := valueof(m_subject_info_authorization_authority(
'455453495F506C7567746573745F4141'O // ETSI_Plugtest_Root
)),
subject_attributes := {
valueof(m_subject_attribute_verification_key(
m_publicKey_eccPoint(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'3b2c0b7d6b3d85fe11c4d447973d53cc4460f4fef160fa7a7af0cdd69c95cf02'O,
'0dcbf45f10191e7a25a0b2932d3f97369c630d561e16c55876afaea7366b110e'O
)
)
)),
valueof(m_subject_attribute_encryption_key(
m_publicKey_aesccm(
m_aesccm(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'1ec678837728cfd33aea4fbcde2229bcb513478257088d0741da790d3a391173'O,
'1ec678837728cfd33aea4fbcde2229bcb513478257088d0741da790d3a391173'O
)
)
)
)),
valueof(m_subject_attribute_assurance_level(
m_subjectAssurance(
'001'B,
'00'B
)
)),
valueof(m_subject_attribute_its_aid_list(
{
16512,
16513
}
))
},
validity_restrictions := {
valueof(m_validity_restriction_time_start_and_end(
1411221485,
1513691885
)),
valueof(m_validity_restriction_region(
m_geographicRegion_polygonial(
{
{
latitude := 498716540,
longitude := 86382080
},
{
latitude := 498685550,
longitude := 86411050
},
{
latitude := 492040400,
longitude := 86475600
}
}
)
))
},
signature_ := valueof(m_signature(
m_ecdsaSignature(
m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
'af07453bad5bb473c0c39c418b587c50ffbe2364fa536522946884cb3639b8cd'O
),
'5dc420e4e9cf72483e8d102ab22f1d54e1a17869cb92b0c7a083fc0b9eec4886'O
)
))
} // End of config #1
// TODO Add additional configurations
}; // End of modulepar PX_AA_CERTIFICATES
......@@ -278,7 +433,95 @@ module LibItsSecurity_Pixits {
'4930abcb59b4feda7a59c3c78cdafce8e804f6fe8cab94afcc84bf568d46497d'O
)
))
} // End of config #0
}, // End of config #0
{ // Config #1
version := 2,
signer_infos := {
{
type_ := e_certificate_digest_with_ecdsap256,
signerInfo := {
digest := '7596654d7547f8e6'O
} // End of field signerInfo
}
},
subject_info := valueof(m_subject_info_authorization_ticket),
subject_attributes := {
valueof(m_subject_attribute_verification_key(
m_publicKey_eccPoint(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'618a47c3187721ef0c6e01dede26a0dcacff1f4d23bd5b5bf04a9588bee47148'O,
'c755d50e642c8ffaec0a39b47c660c0ad12f1f9b3dca1f6c0b3f67bf4fcdbbc0'O
)
)
)),
valueof(m_subject_attribute_encryption_key(
m_publicKey_aesccm(
m_aesccm(
m_eccPointecdsa_nistp256_with_sha256_uncompressed(
'e23004a8deb7f7cb29e0d66dff0085427af2be6fb022aadaee5fa84fe3c88035'O,
'cfcdeb0afb941cd6551387c2948257be32c483ffe8a17e24d91e47af9b5baacf'O
)
)
)
)),
valueof(m_subject_attribute_assurance_level(
m_subjectAssurance(
'001'B,
'00'B
)
)),
valueof(m_subject_attribute_its_aid_ssp_list(
{
{
its_aid := 16512,
service_specific_permissions := {
version := '00'O,
sspContainer := omit
}
},
{
its_aid := 16513,
service_specific_permissions := {
version := '00'O,
sspContainer := omit
}
}
}
))
},
validity_restrictions := {
valueof(m_validity_restriction_time_start_and_end(
1411221485,
1513691885
)),
valueof(m_validity_restriction_region(
m_geographicRegion_polygonial(
{
{
latitude := 498716540,
longitude := 86382080
},
{
latitude := 498685550,
longitude := 86411050
},
{
latitude := 492040400,
longitude := 86475600
}
}
)
))
},
signature_ := valueof(m_signature(
m_ecdsaSignature(
m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
'b9780629ed585193a001bd58a93843f598de9a7058e9787ccf90300fcaa17ed8'O
),
'1e98dbf16d9f6a5fa9b106f3b8fd1be6947fa1233771ee8a47f787cf583033de'O
)
))
} // End of config #1
// TODO Add additional configurations
}; // End of modulepar PX_AT_CERTIFICATES
......@@ -290,7 +533,12 @@ module LibItsSecurity_Pixits {
latitude := 498717000,
longitude := 86384000,
elevation := '020E'O
} // End of config #0
}, // End of config #0
{ // Config #1
latitude := 498717020,
longitude := 86384020,
elevation := '0200'O
} // End of config #1
// TODO Add additional configurations
}; // End of modulepar PX_TRHEED_LOCATIONS
......@@ -305,7 +553,15 @@ module LibItsSecurity_Pixits {
aaCertificate := PX_AA_CERTIFICATES[0],
atCertificate := PX_AT_CERTIFICATES[0],
location := PX_TRHEED_LOCATIONS[0]
} // End of config #0
}, // End of config #0
{ // Config #1
signingPrivateKey := '268d60c6929ddd30ad5668573638be6c2b5645273a8fe732e0150674d1a57c32'O,
encryptPrivateKey := 'd323ca3577f4ae080aced73214716350adf89441a2c9cbfea9d4c10503437943'O,
caCertificate := PX_CA_CERTIFICATES[1],
aaCertificate := PX_AA_CERTIFICATES[1],
atCertificate := PX_AT_CERTIFICATES[1],
location := PX_TRHEED_LOCATIONS[1]
} // End of config #1
// TODO Add additional configurations
}; // End of modulepar PX_TA_CONFIGS
......
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