ItsPki_TestCases.ttcn 338 KB
Newer Older
                                                                                                                  )))));
        tc_ac.start;
        alt {
          [] a_await_atv_http_request_from_iut( // Wait for authorizationValidation Request from IUT to EA
                                               mw_http_request(
                                                               mw_http_request_post(
                                                                                    PICS_HTTP_POST_URI_ATV,
                                                                                    -,
                                                                                    mw_http_message_body_binary(
                                                                                                                mw_binary_body_ieee1609dot2_data(
                                                                                                                                                 mw_authorizationRequestMessage(
                                                                                                                                                                                mw_encryptedData(
                                                                                                                                                                                                 { *, mw_recipientInfo_pskRecipInfo, * },
                                                                                                                                                                                                 mw_SymmetricCiphertext_aes128ccm
                                                                                                                                                                                                 )))))),
                                               v_request
                                                ) {
            var integer v_result;
            
            tc_ac.stop;

            f_verify_http_at_request_from_iut_atv(v_request.request, v_aes_sym_key, v_authentication_vector, v_request_hash, v_inner_at_request, v_result);
            // Set verdict
            if (v_result == 0) {
              log("*** " & testcasename() & ": INFO: IUT has sent AuthorizationValidation request ***");
              f_selfOrClientSyncAndVerdict(c_prDone, e_success);
            } else {
              log("*** " & testcasename() & ": FAIL: Failed to verify AuthorizationValidation request ***");
              f_selfOrClientSyncAndVerdict(c_prDone, e_error);
            }
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Test Body
        // Send AuthorizationValidationResponse
          f_init_default_headers_list(-, "inner_atv_response", v_headers);
          f_http_build_authorization_response(v_inner_at_request, ok, v_request_hash, vc_eaPrivateKey, vc_eaWholeHash, v_aes_enc_key, v_inner_at_response, v_ieee1609dot2_signed_and_encrypted_data);
          f_http_send(
                      v_headers,
                      m_http_request(
                                     m_http_request_post(
                                                         PICS_HTTP_POST_URI_AT,
                                                         v_headers,
                                                         m_http_message_body_binary(
                                                                                    m_binary_body_ieee1609dot2_data(
                                                                                                                    v_ieee1609dot2_signed_and_encrypted_data
                                                                                                                    )))));
        tc_ac.start;
        alt {
          [] a_await_at_http_response_from_iut(
                                               mw_http_response(
                                                                mw_http_response_ok(
                                                                                    mw_http_message_body_binary(
                                                                                                                mw_binary_body_ieee1609dot2_data(
                                                                                                                                                 mw_enrolmentRequestMessage(
                                                                                                                                                                            mw_encryptedData(
                                                                                                                                                                                             { *, mw_recipientInfo_pskRecipInfo(vc_eaHashedId8), * },
                                                                                                                                                                                             mw_SymmetricCiphertext_aes128ccm
                                                                                                                                                                                             )))))),
                                               v_response
                                               ) {
            var integer v_result;
            
            tc_ac.stop;
            
            // Verify IUT response
            f_verify_http_at_response_from_iut_aa(v_response.response, v_private_key_at, v_aes_sym_key, v_authentication_vector, v_request_hash, v_inner_at_response, v_result);
            // Set verdict
            if (v_result == 0) {
              log("*** " & testcasename() & ": PASS: IUT has sent AuthorizationValidation response ***");
              f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            } else {
              log("*** " & testcasename() & ": FAIL: Failed to verify AuthorizationValidation response ***");
              f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cfHttpDown();
      } // End of testcase TC_SECPKI_AA_AUTHVAL_RCV_01_BV
      
      /**
       * @desc Check that AA doesn't accept Authorization Validation Response message when  this message is 
       *       signed with certificate without appropriate permissions
       * <pre>
       * Pics Selection: PICS_IUT_AA_ROLE
       * Initial conditions: 
       *     with {
       *          the ITSS in "enrolled" state
       *          the EA in "operational" state
       *          and the IUT(AA) in "operational" state
       *          and the IUT had received the AuthorizationRequest from the ITSS
       *          and the IUT sent the AuthorizationValidationRequest
       *     }
       * Expected behaviour:
       *     ensure that {
       *         when {
       *            the IUT receives the AuthorizationValidationResponseMessage
       *                containing signer
       *                    containing digest
       *                        indicating HashedId8 of the certificate
       *                    containing appPermissions
       *                        not containing an item of type PsidSsp
       *                        containing psid
       *                            indicating AID_CERT_REQ
       *                        or containing an item of type PsidSsp
       *                            containing psid
       *                                indicating AID_CERT_REQ
       *                        and containing ssp
       *                             containing opaque[0] (version) 
       *                                 indicating other value than 1
       *                        or containing opaque[1] (value) 
       *                            indicating "AuthorizationValidationResponse" (bit 4) set to 0
       *         }
       *         then {
       *            the IUT answers with an AuthorisationValidationResponseMessage
       *                containing responseCode
       *                    indicating non-zero value
       *         }
       *     }
       * </pre>
       * 
       * @see       ETSI TS 103 525-2 v0.0.10 SECPKI_AA_AUTHVAL_RCV_02_BI
       * @reference ETSI TS 102 941, clause 6.2.3.3.2
       */
      testcase TC_SECPKI_AA_AUTHVAL_RCV_02_BI() runs on ItsPkiHttp system ItsPkiHttpSystem {} // End of testcase TC_SECPKI_AA_AUTHVAL_RCV_02_BI
      
    } // End of group authorization_validation_response
garciay's avatar
garciay committed
    
garciay's avatar
garciay committed
  } // End of group aa_beavior
  
} // End of module ItsPki_TestCases