ta/wallet_ta.c
/**
  * Computes wallet version of current wallet.
  * \param session_data A data pointer to a session context.
  * \param param_types The types of the four parameters.
  * \param params A pointer to an array of four parameters.
  * \return TEE_SUCCESS in case of success otherwise returns the result
  *         received from the failed operation. The information about all
  *         possible returns is present in TEE Client API Specification - 4.4.2
  *         published by GlobalPlatform.
  */
Computes wallet version of current wallet.
\param session_data A data pointer to a session context.
\param param_types The types of the four parameters.
\param params A pointer to an array of four parameters.
\return TEE_SUCCESS in case of success otherwise returns the result
received from the failed operation. The information about all
possible returns is present in TEE Client API Specification - 4.4.2
published by GlobalPlatform.
Computes wallet version of current wallet . \ param session_data A data pointer to a session context . \ param param_types The types of the four parameters . \ param params A pointer to an array of four parameters . \ return TEE_SUCCESS in case of success otherwise returns the result received from the failed operation . The information about all possible returns is present in TEE Client API Specification - 4 . 4 . 2 published by GlobalPlatform .
static TEE_Result update_wallet_version(Session_data * session_data, uint32_t param_types, TEE_Param params[4])
{
	uint32_t exp_param_types = TEE_PARAM_TYPES(
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE,
									TEE_PARAM_TYPE_NONE);
	(void)&params;
	if (param_types != exp_param_types)
		return TEE_ERROR_BAD_PARAMETERS;
	if (session_data->is_hidden_wallet)
        return TEE_ERROR_BAD_STATE;
    if (session_data->is_encryption_key_non_zero)
        session_data->current_wallet->unencrypted.version = VERSION_IS_ENCRYPTED;
    else
        session_data->current_wallet->unencrypted.version = VERSION_UNENCRYPTED;
    return TEE_SUCCESS;
}
static TEE_Result update_wallet_version ( Session_data * session_data , uint32_t param_types , TEE_Param params [ 4 ] ) { uint32_t exp_param_types = TEE_PARAM_TYPES ( TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE , TEE_PARAM_TYPE_NONE ) ; ( void ) & params ; if ( param_types != exp_param_types ) return TEE_ERROR_BAD_PARAMETERS ; if ( session_data -> is_hidden_wallet ) return TEE_ERROR_BAD_STATE ; if ( session_data -> is_encryption_key_non_zero ) session_data -> current_wallet -> unencrypted . version = VERSION_IS_ENCRYPTED ; else session_data -> current_wallet -> unencrypted . version = VERSION_UNENCRYPTED ; return TEE_SUCCESS ; }
Computes wallet version of current wallet.
Computes wallet version of current wallet .
/* This function does not expect any parameters */ /* Parameters unused */ /* Some sanity checks */ /*
     * Hidden wallet should never ever have their version fields updated;
     * that would give away their presence.
     */