Loading ttcn/Pki/LibItsPki_TestSystem.ttcn 0 → 100644 +47 −0 Original line number Diff line number Diff line /** * @author ETSI / STF545 * @version $URL$ * $Id$ * @desc Test System module for ITS PKI * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * */ module LibItsPki_TestSystem { // LibItsCommon import from LibItsCommon_TestSystem all; // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from EtsiTs102941Its_sMessages language "ASN.1:1997" all; import from EtsiTs102941OfflineDataStructures language "ASN.1:1997" all; // LibItsPki type port PkiPort message { in PkiInd; out PkiReq; } // End of port PkiPort type component ItsPkiSystem { port PkiPort pkiPort; } // End of component ItsPkiSystem type component ItsPki extends ItsBaseComponent { port PkiPort pkiPort; } // End of component ItsPki type record PkiReq { } // End of type PkiReq type record PkiInd { } // End of type PkiInd } // End of module LibItsPki_TestSystem ttcn/Security/LibItsSecurity_Functions.ttcn +13 −6 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ module LibItsSecurity_Functions { in EtsiTs103097Data p_encrypedSecuredMessage, out EtsiTs103097Data p_decrypedSecuredMessage ) return boolean { if (not(ischosen(p_encrypedSecuredMessage.content.encryptedData))) { if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { var PKRecipientInfo v_pKRecipientInfo; var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; Loading @@ -127,6 +127,7 @@ module LibItsSecurity_Functions { v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; // Read the certificate based on the recipientId } else { log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); return false; } Loading @@ -146,6 +147,8 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; } else { log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { Loading @@ -164,9 +167,13 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; } else { log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } } else { log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); } return false; Loading Loading
ttcn/Pki/LibItsPki_TestSystem.ttcn 0 → 100644 +47 −0 Original line number Diff line number Diff line /** * @author ETSI / STF545 * @version $URL$ * $Id$ * @desc Test System module for ITS PKI * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * */ module LibItsPki_TestSystem { // LibItsCommon import from LibItsCommon_TestSystem all; // LibIts import from IEEE1609dot2BaseTypes language "ASN.1:1997" all; import from IEEE1609dot2 language "ASN.1:1997" all; import from EtsiTs103097Module language "ASN.1:1997" all; import from EtsiTs102941Its_sMessages language "ASN.1:1997" all; import from EtsiTs102941OfflineDataStructures language "ASN.1:1997" all; // LibItsPki type port PkiPort message { in PkiInd; out PkiReq; } // End of port PkiPort type component ItsPkiSystem { port PkiPort pkiPort; } // End of component ItsPkiSystem type component ItsPki extends ItsBaseComponent { port PkiPort pkiPort; } // End of component ItsPki type record PkiReq { } // End of type PkiReq type record PkiInd { } // End of type PkiInd } // End of module LibItsPki_TestSystem
ttcn/Security/LibItsSecurity_Functions.ttcn +13 −6 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ module LibItsSecurity_Functions { in EtsiTs103097Data p_encrypedSecuredMessage, out EtsiTs103097Data p_decrypedSecuredMessage ) return boolean { if (not(ischosen(p_encrypedSecuredMessage.content.encryptedData))) { if (ischosen(p_encrypedSecuredMessage.content.encryptedData)) { var PKRecipientInfo v_pKRecipientInfo; var RecipientInfo v_recipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0]; Loading @@ -127,6 +127,7 @@ module LibItsSecurity_Functions { v_pKRecipientInfo := p_encrypedSecuredMessage.content.encryptedData.recipients[0].signedDataRecipInfo; // Read the certificate based on the recipientId } else { log("*** " & testcasename() & ":ERROR: Unsupported RecipientInfo variant ***"); return false; } Loading @@ -146,6 +147,8 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; } else { log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } else if (ischosen(v_pKRecipientInfo.encKey.eciesBrainpoolP256r1)) { Loading @@ -164,9 +167,13 @@ module LibItsSecurity_Functions { var bitstring v_decode := oct2bit(v_decryptedSecuredMessage); if (decvalue(v_decode, p_decrypedSecuredMessage) == 0) { return true; } else { log("*** " & testcasename() & ":ERROR: Faild to decode secured message ***"); } } } } else { log("*** " & testcasename() & ":ERROR: Message not encrypted ***"); } return false; Loading