本文整理汇总了C++中TEE_PARAM_TYPES函数的典型用法代码示例。如果您正苦于以下问题:C++ TEE_PARAM_TYPES函数的具体用法?C++ TEE_PARAM_TYPES怎么用?C++ TEE_PARAM_TYPES使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TEE_PARAM_TYPES函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bootstrap
static TEE_Result bootstrap(uint32_t param_types,
TEE_Param params[TEE_NUM_PARAMS])
{
TEE_Result res;
struct shdr *shdr;
const uint32_t exp_pt = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INPUT,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE);
if (param_types != exp_pt)
return TEE_ERROR_BAD_PARAMETERS;
shdr = shdr_alloc_and_copy(params->memref.buffer, params->memref.size);
if (!shdr)
return TEE_ERROR_SECURITY;
res = shdr_verify_signature(shdr);
if (res)
goto out;
res = install_ta(shdr, params->memref.buffer, params->memref.size);
out:
shdr_free(shdr);
return res;
}
示例2: rpc_call_cryp
static TEE_Result rpc_call_cryp(uint32_t nParamTypes, TEE_Param pParams[4],
uint32_t cmd)
{
TEE_TASessionHandle cryp_session;
TEE_Result res;
uint32_t origin;
TEE_Param params[4];
uint32_t types =
TEE_PARAM_TYPES(TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE);
TEE_MemFill(params, 0, sizeof(TEE_Param) * 4);
res = TEE_OpenTASession(&cryp_uuid, 0, types, params, &cryp_session,
&origin);
if (res != TEE_SUCCESS) {
EMSG("rpc_sha256 - TEE_OpenTASession returned 0x%x\n",
(unsigned int)res);
return res;
}
res = TEE_InvokeTACommand(cryp_session, 0, cmd, nParamTypes,
pParams, &origin);
if (res != TEE_SUCCESS) {
EMSG("rpc_sha256 - TEE_InvokeTACommand returned 0x%x\n",
(unsigned int)res);
}
TEE_CloseTASession(cryp_session);
return res;
}
示例3: rpc_open
TEE_Result rpc_open(void *session_context, uint32_t param_types,
TEE_Param params[4])
{
TEE_TASessionHandle session;
uint32_t orig;
TEE_Result res;
TEE_UUID uuid = TA_SIMS_TEST_UUID;
uint32_t types =
TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_OUTPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE);
TEE_Param par[4];
(void)session_context;
(void)param_types;
res = TEE_OpenTASession(&uuid, 0, 0, NULL, &session, &orig);
if (res != TEE_SUCCESS)
return res;
TEE_MemFill(params, 0, sizeof(TEE_Param) * 4);
res =
TEE_InvokeTACommand(session, 0, TA_SIMS_CMD_GET_COUNTER, types, par,
&orig);
if (res != TEE_SUCCESS)
goto exit;
exit:
TEE_CloseTASession(session);
return res;
}
示例4: ta_entry_asymmetric_verify_digest
TEE_Result ta_entry_asymmetric_verify_digest(uint32_t param_type,
TEE_Param params[4])
{
TEE_Result res;
TEE_Attribute *attrs;
uint32_t attr_count;
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT,
TEE_PARAM_TYPE_MEMREF_INPUT,
TEE_PARAM_TYPE_MEMREF_INPUT,
TEE_PARAM_TYPE_MEMREF_INPUT));
res = unpack_attrs(params[1].memref.buffer, params[1].memref.size,
&attrs, &attr_count);
if (res != TEE_SUCCESS)
return res;
res =
TEE_AsymmetricVerifyDigest((TEE_OperationHandle) params[0].value.a,
attrs, attr_count,
params[2].memref.buffer,
params[2].memref.size,
params[3].memref.buffer,
params[3].memref.size);
TEE_Free(attrs);
return res;
}
示例5: read_lock_state
static TEE_Result read_lock_state(uint32_t pt, TEE_Param params[TEE_NUM_PARAMS])
{
const uint32_t exp_pt = TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_OUTPUT,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE);
uint32_t lock_state;
uint32_t count;
TEE_Result res;
TEE_ObjectHandle h;
if (pt != exp_pt)
return TEE_ERROR_BAD_PARAMETERS;
res = open_rb_state(DEFAULT_LOCK_STATE, &h);
if (res)
return res;
res = TEE_ReadObjectData(h, &lock_state, sizeof(lock_state), &count);
if (res)
goto out;
if (count != sizeof(lock_state)) {
/*
* Client need write the lock state to recover, this can
* normally not happen.
*/
res = TEE_ERROR_CORRUPT_OBJECT;
goto out;
}
params[0].value.a = lock_state;
out:
TEE_CloseObject(h);
return res;
}
示例6: write_lock_state
static TEE_Result write_lock_state(uint32_t pt,
TEE_Param params[TEE_NUM_PARAMS])
{
const uint32_t exp_pt = TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INPUT,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE);
uint32_t wlock_state;
uint32_t lock_state;
uint32_t count;
TEE_Result res;
TEE_ObjectHandle h;
if (pt != exp_pt)
return TEE_ERROR_BAD_PARAMETERS;
wlock_state = params[0].value.a;
res = open_rb_state(wlock_state, &h);
if (res)
return res;
res = TEE_ReadObjectData(h, &lock_state, sizeof(lock_state), &count);
if (res)
goto out;
if (count == sizeof(lock_state) && lock_state == wlock_state)
goto out;
res = create_rb_state(wlock_state, &h);
out:
TEE_CloseObject(h);
return res;
}
示例7: gprof_stop_pc_sampling
static TEE_Result gprof_stop_pc_sampling(struct tee_ta_session *s,
uint32_t param_types,
TEE_Param params[TEE_NUM_PARAMS])
{
uint32_t exp_pt = TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_OUTPUT,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE);
struct sample_buf *sbuf;
uint32_t rate;
if (exp_pt != param_types)
return TEE_ERROR_BAD_PARAMETERS;
sbuf = s->sbuf;
if (!sbuf)
return TEE_ERROR_BAD_STATE;
assert(sbuf->samples);
/* Stop sampling */
if (sbuf->enabled)
sbuf->enabled = false;
rate = ((uint64_t)sbuf->count * sbuf->freq) / sbuf->usr;
params[0].value.a = rate;
DMSG("TA sampling stats: sample count=%" PRIu32 " user time=%" PRIu64
" cntfrq=%" PRIu32 " rate=%" PRIu32, sbuf->count, sbuf->usr,
sbuf->freq, rate);
free(sbuf);
s->sbuf = NULL;
return TEE_SUCCESS;
}
示例8: cmd_process
TEE_Result cmd_process(uint32_t param_types, TEE_Param params[4])
{
TEE_Result res;
int n;
void *in, *out;
uint32_t insz;
uint32_t outsz;
uint32_t exp_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_MEMREF_INOUT,
TEE_PARAM_TYPE_MEMREF_INOUT,
TEE_PARAM_TYPE_VALUE_INPUT,
TEE_PARAM_TYPE_NONE);
if (param_types != exp_param_types)
return TEE_ERROR_BAD_PARAMETERS;
in = params[0].memref.buffer;
insz = params[0].memref.size;
out = params[1].memref.buffer;
outsz = params[1].memref.size;
n = params[2].value.a;
while (n--) {
res = TEE_CipherUpdate(crypto_op, in, insz, out, &outsz);
CHECK(res, "TEE_CipherUpdate", return res;);
}
示例9: ta_entry_set_operation_key
TEE_Result ta_entry_set_operation_key(uint32_t param_type, TEE_Param params[4])
{
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
return TEE_SetOperationKey((TEE_OperationHandle) params[0].value.a,
(TEE_ObjectHandle) params[0].value.b);
}
示例10: ta_entry_reset_transient_object
TEE_Result ta_entry_reset_transient_object(uint32_t param_type,
TEE_Param params[4])
{
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
TEE_ResetTransientObject((TEE_ObjectHandle) params[0].value.a);
return TEE_SUCCESS;
}
示例11: ta_entry_reset_operation
TEE_Result ta_entry_reset_operation(uint32_t param_type, TEE_Param params[4])
{
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
TEE_ResetOperation((TEE_OperationHandle) params[0].value.a);
return TEE_SUCCESS;
}
示例12: ta_entry_random_number_generate
TEE_Result ta_entry_random_number_generate(uint32_t param_type,
TEE_Param params[4])
{
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
TEE_GenerateRandom(params[0].memref.buffer, params[0].memref.size);
return TEE_SUCCESS;
}
示例13: ta_storage_cmd_trunc
TEE_Result ta_storage_cmd_trunc(uint32_t param_types, TEE_Param params[4])
{
TEE_ObjectHandle o = VAL2HANDLE(params[0].value.a);
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
return TEE_TruncateObjectData(o, params[0].value.b);
}
示例14: ta_storage_cmd_start_enum
TEE_Result ta_storage_cmd_start_enum(uint32_t param_types, TEE_Param params[4])
{
TEE_ObjectEnumHandle oe = VAL2HANDLE(params[0].value.a);
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
return TEE_StartPersistentObjectEnumerator(oe, TEE_STORAGE_PRIVATE);
}
示例15: ta_storage_cmd_close
TEE_Result ta_storage_cmd_close(uint32_t param_types, TEE_Param params[4])
{
ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));
TEE_CloseObject((TEE_ObjectHandle)(uintptr_t)params[0].value.a);
return TEE_SUCCESS;
}