Commit 3d8a44cf authored by Yann Garcia's avatar Yann Garcia
Browse files

Enhance BfkZipEntries data structure; Update configuration files

parent 1939df82
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1090,7 +1090,7 @@ module ItsPkiItss_TestCases {

          // Test Body
          f_sendUtTriggerEnrolmentRequestPrimitive();
          tc_ac.start; // TDOD To refined, use altstep
          tc_ac.start; // TODO To refined, use altstep
          alt {
            [] utPort.receive(UtPkiTriggerInd: { state := 1 }) {
              tc_ac.stop;
@@ -1420,7 +1420,7 @@ module ItsPkiItss_TestCases {

          // Test Body
          // Give time to the IUT to setup enrol state
          tc_ac.start; // TDOD To refined, use altstep
          tc_ac.start; // TODO To refined, use altstep
          alt {
            [] utPort.receive(UtPkiTriggerInd: { state := 1 }) {
              tc_ac.stop;
@@ -1482,8 +1482,8 @@ module ItsPkiItss_TestCases {
          v_ec_cert_digest := substr(v_ec_cert_hash, lengthof(v_ec_cert_hash) - 8, 8);

          log("*** " & testcasename() & ": INFO: First InnerEcRequest received ***");
          log(">>>>> v_inner_ec_response=", v_inner_ec_response);
          log(">>>>> v_ec_cert_hash=", v_ec_cert_hash);
          log("v_inner_ec_response=", v_inner_ec_response);
          log("v_ec_cert_hash=", v_ec_cert_hash);
          f_selfOrClientSyncAndVerdict(c_prDone, e_success);

          // Test Body
@@ -2891,7 +2891,7 @@ module ItsPkiItss_TestCases {
          } // End of 'alt' statement

          // Test Body
          tc_ac.start; // TDOD To refined, use altstep
          tc_ac.start; // TODO To refined, use altstep
          alt {
            [] utPort.receive(UtPkiTriggerInd: { state := 0 }) {
              tc_ac.stop;
@@ -3071,7 +3071,7 @@ module ItsPkiItss_TestCases {
          } // End of 'alt' statement

          // Test Body
          tc_ac.start; // TDOD To refined, use altstep
          tc_ac.start; // TODO To refined, use altstep
          alt {
            [] utPort.receive(UtPkiTriggerInd: { state := 1 }) {
              tc_ac.stop;
@@ -7024,7 +7024,7 @@ module ItsPkiItss_TestCases {
            }
            [] tc_noac.timeout {
              f_sendUtTriggerEnrolmentRequestPrimitive();
              tc_ac.start; // TDOD To refined, use altstep
              tc_ac.start; // TODO To refined, use altstep
              alt {
                [] utPort.receive(UtPkiTriggerInd: { state := 1 }) {
                  tc_ac.stop;
@@ -7375,7 +7375,7 @@ module ItsPkiItss_TestCases {
            }
            [] tc_noac.timeout {
              f_sendUtTriggerEnrolmentRequestPrimitive();
              tc_ac.start; // TDOD To refined, use altstep
              tc_ac.start; // TODO To refined, use altstep
              alt {
                [] utPort.receive(UtPkiTriggerInd: { state := 1 }) {
                  tc_ac.stop;
+17 −15
Original line number Diff line number Diff line
@@ -7011,7 +7011,7 @@ module ItsPki_TestCases {
          // Wait for v_ee_ra_cert_request.nextDlTime
          var float v_timer := int2float(v_ra_ee_cert_info.nextDlTime - v_ra_ee_cert_info.generationTime + 2);
          log("*** " & testcasename() & ": INFO: Start wailting for " & float2str(v_timer) & " seconds ***");
          log("*** " & testcasename() & ": INFO: Start waiting for " & float2str(v_timer) & " seconds ***");
          f_sleepIgnoreDef(v_timer);
          log("*** " & testcasename() & ": INFO: timer of " & float2str(v_timer) & " seconds expierd message ***");
@@ -7046,8 +7046,9 @@ module ItsPki_TestCases {
              tc_ac.stop;
              // Check item 0 is v_ra_ee_cert_info
              log("Item #0 to decode (EtsiTs102941Data): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[0].content.signedData.tbsData.payload.data.content.unsecuredData);
              var bitstring v_bt := oct2bit(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[0].content.signedData.tbsData.payload.data.content.unsecuredData);
              log("Item #0 to decode (Name): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[0].name);
              log("Item #0 to decode (EtsiTs102941Data): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[0].signed_message.content.signedData.tbsData.payload.data.content.unsecuredData);
              var bitstring v_bt := oct2bit(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[0].signed_message.content.signedData.tbsData.payload.data.content.unsecuredData);
              var EtsiTs102941Data v_etsi_ts102941_data;
              var integer v_result := decvalue(v_bt, v_etsi_ts102941_data);
              if (v_result == 0) {
@@ -7116,7 +7117,7 @@ module ItsPki_TestCases {
          // Wait for v_ee_ra_cert_request.nextDlTime
          var float v_timer := int2float(v_ra_ee_cert_info.nextDlTime - v_ra_ee_cert_info.generationTime + 2);
          log("*** " & testcasename() & ": INFO: Start wailting for " & float2str(v_timer) & " seconds ***");
          log("*** " & testcasename() & ": INFO: Start waiting for " & float2str(v_timer) & " seconds ***");
          f_sleepIgnoreDef(v_timer);
          log("*** " & testcasename() & ": INFO: timer of " & float2str(v_timer) & " seconds expierd message ***");
@@ -7156,7 +7157,7 @@ module ItsPki_TestCases {
                log(
                    "Matching: ", 
                    match(
                          v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i], 
                          v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].signed_message, 
                          mw_etsiTs103097Data_signed(
                                                     mw_signedData(
                                                                   -, 
@@ -7165,7 +7166,7 @@ module ItsPki_TestCases {
                                                                                     mw_ieee1609Dot2_headerInfo(
                                                                                                                c_its_aid_SCR
                    ))))));
                if (not(match(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i], mw_etsiTs103097Data_signed(mw_signedData(-, mw_toBeSignedData(mw_signedDataPayload, mw_ieee1609Dot2_headerInfo())))))) {
                if (not(match(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].signed_message, mw_etsiTs103097Data_signed(mw_signedData(-, mw_toBeSignedData(mw_signedDataPayload, mw_ieee1609Dot2_headerInfo())))))) {
                  v_signature_check_failed := true;
                  break;
                }
@@ -7229,7 +7230,7 @@ module ItsPki_TestCases {
          // Wait for v_ee_ra_cert_request.nextDlTime
          var float v_timer := int2float(v_ra_ee_cert_info.nextDlTime - v_ra_ee_cert_info.generationTime + 2);
          log("*** " & testcasename() & ": INFO: Start wailting for " & float2str(v_timer) & " seconds ***");
          log("*** " & testcasename() & ": INFO: Start waiting for " & float2str(v_timer) & " seconds ***");
          f_sleepIgnoreDef(v_timer);
          log("*** " & testcasename() & ": INFO: timer of " & float2str(v_timer) & " seconds expierd message ***");
@@ -7266,8 +7267,9 @@ module ItsPki_TestCases {
              // Extract certificates
              var boolean v_decrypt_failed := false;
              for (var integer v_i := 1; v_i < lengthof(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages); v_i := v_i + 1) {
                log("Unsecured data to decode (EtsiTs103097Data): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].content.signedData.tbsData.payload.data.content.unsecuredData)
                var bitstring v_bt := oct2bit(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].content.signedData.tbsData.payload.data.content.unsecuredData);
                log("Unsecured data to decode (Name): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].name)
                log("Unsecured data to decode (EtsiTs103097Data): ", v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].signed_message.content.signedData.tbsData.payload.data.content.unsecuredData)
                var bitstring v_bt := oct2bit(v_response.response.body.binary_body.bfk_zip_file.content.signed_messages[v_i].signed_message.content.signedData.tbsData.payload.data.content.unsecuredData);
                var EtsiTs103097Data v_unsecuredData;
                var integer v_result := decvalue(v_bt, v_unsecuredData);
                log("decvalue result: ", v_result);
@@ -7289,7 +7291,7 @@ module ItsPki_TestCases {
                var Ieee1609Dot2Data v_ieee1609dot2_dec_data;
                if (f_decrypt(v_expended_private_key, // Derived private encryption key
                              v_unsecuredData, // data to be decrypted
                              v_ra_ee_cert_info.requestHash, //v_unsecuredData.content.encryptedData.recipients[0].rekRecipInfo.recipientId, // salt
                              'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855'O, // Salt is the SHA256 of the empty string
                              v_ieee1609dot2_dec_data, // decrypted message
                              v_expended_private_key) == false) {
                  v_decrypt_failed := true;
+10 −10
Original line number Diff line number Diff line
@@ -174,13 +174,13 @@ module LibItsPki_Functions {
      log("f_cfHttpUp: vc_aaWholeHash256= ", vc_aaWholeHash256);

      // Storage of enrolment keys in case of re-enrolment
      vc_ec_keys_counter := 0;
      vc_ec_counter := 0;
      vc_ec_private_keys := {};
      vc_ec_public_compressed_key := {};
      vc_ec_compressed_modes := {};
      vc_ec_hashed_id8 := {};
      vc_ec_certificates := {};
      // vc_ec_keys_counter := 0;
      // vc_ec_counter := 0;
      // vc_ec_private_keys := {};
      // vc_ec_public_compressed_key := {};
      // vc_ec_compressed_modes := {};
      // vc_ec_hashed_id8 := {};
      // vc_ec_certificates := {};

      if (PICS_MULTIPLE_END_POINT == false) {
        activate(a_default_pki_http());