| /optee_os/lib/libutee/ |
| H A D | tee_api_objects.c | 59 TEE_Result res = TEE_SUCCESS; in TEE_GetObjectInfo() local 61 res = _utee_cryp_obj_get_info((unsigned long)object, &info); in TEE_GetObjectInfo() 63 if (res != TEE_SUCCESS) in TEE_GetObjectInfo() 64 TEE_Panic(res); in TEE_GetObjectInfo() 88 TEE_Result res = TEE_SUCCESS; in __GP11_TEE_GetObjectInfo() local 90 res = _utee_cryp_obj_get_info((unsigned long)object, &info); in __GP11_TEE_GetObjectInfo() 92 if (res != TEE_SUCCESS) in __GP11_TEE_GetObjectInfo() 93 TEE_Panic(res); in __GP11_TEE_GetObjectInfo() 117 TEE_Result res = TEE_SUCCESS; in TEE_GetObjectInfo1() local 119 res = _utee_cryp_obj_get_info((unsigned long)object, &info); in TEE_GetObjectInfo1() [all …]
|
| H A D | tee_api_property.c | 146 TEE_Result res; in propget_get_property() local 155 res = propset_get(h, &eps, &eps_len); in propget_get_property() 156 if (res != TEE_SUCCESS) in propget_get_property() 157 return res; in propget_get_property() 166 res = _utee_get_property_name_to_index((unsigned long)h, name, in propget_get_property() 169 if (res != TEE_SUCCESS) in propget_get_property() 170 return res; in propget_get_property() 171 res = _utee_get_property((unsigned long)h, index, NULL, NULL, in propget_get_property() 180 res = propset_get(pe->prop_set, &eps, &eps_len); in propget_get_property() 181 if (res != TEE_SUCCESS) in propget_get_property() [all …]
|
| /optee_os/lib/libutils/ext/ |
| H A D | fault_mitigation.c | 24 unsigned long steps, unsigned long res) in ___ftmn_return_res() argument 28 if ((check->res ^ FTMN_DEFAULT_HASH) != res) in ___ftmn_return_res() 30 return res; in ___ftmn_return_res() 34 unsigned long steps, unsigned long res) in ___ftmn_expect_state() argument 36 if ((check->res ^ FTMN_DEFAULT_HASH) != res) in ___ftmn_expect_state() 45 unsigned long res) in ___ftmn_callee_done() argument 48 arg->res = arg->hash ^ res; in ___ftmn_callee_done() 53 unsigned long res) in ___ftmn_callee_done_not_zero() argument 55 if (res == 0) in ___ftmn_callee_done_not_zero() 58 arg->res = arg->hash ^ res; in ___ftmn_callee_done_not_zero() [all …]
|
| /optee_os/core/pta/tests/ |
| H A D | lockdep.c | 17 TEE_Result res = TEE_ERROR_GENERIC; in self_test_lockdep1() local 28 res = __lockdep_lock_release(&thread1, 1); in self_test_lockdep1() 29 if (!res) in self_test_lockdep1() 33 res = __lockdep_lock_acquire(&graph, &thread1, 1); in self_test_lockdep1() 34 if (res) in self_test_lockdep1() 38 res = __lockdep_lock_release(&thread1, 1); in self_test_lockdep1() 39 if (res) in self_test_lockdep1() 43 res = __lockdep_lock_acquire(&graph, &thread1, 1); in self_test_lockdep1() 44 if (res) in self_test_lockdep1() 48 res = __lockdep_lock_acquire(&graph, &thread1, 3); in self_test_lockdep1() [all …]
|
| H A D | fs_htree.c | 96 TEE_Result res = TEE_SUCCESS; in test_read_init() local 101 res = test_get_offs_size(type, idx, vers, &offs, &sz); in test_read_init() 102 if (res == TEE_SUCCESS) { in test_read_init() 110 return res; in test_read_init() 170 #define CHECK_RES(res, cleanup) \ argument 172 TEE_Result _res = (res); \ 200 TEE_Result res = TEE_SUCCESS; in read_block() local 204 res = tee_fs_htree_read_block(ht, bn, b); in read_block() 205 if (res != TEE_SUCCESS) in read_block() 206 return res; in read_block() [all …]
|
| /optee_os/core/tee/ |
| H A D | tee_fs_key_manager.c | 44 TEE_Result res; in do_hmac() local 50 res = crypto_mac_alloc_ctx(&ctx, TEE_FS_KM_HMAC_ALG); in do_hmac() 51 if (res != TEE_SUCCESS) in do_hmac() 52 return res; in do_hmac() 54 res = crypto_mac_init(ctx, in_key, in_key_size); in do_hmac() 55 if (res != TEE_SUCCESS) in do_hmac() 58 res = crypto_mac_update(ctx, message, message_size); in do_hmac() 59 if (res != TEE_SUCCESS) in do_hmac() 62 res = crypto_mac_final(ctx, out_key, out_key_size); in do_hmac() 63 if (res != TEE_SUCCESS) in do_hmac() [all …]
|
| H A D | tee_ree_fs.c | 68 TEE_Result res; in out_of_place_write() local 98 res = tee_fs_htree_read_block(&fdp->ht, in out_of_place_write() 100 if (res != TEE_SUCCESS) in out_of_place_write() 109 res = copy_from_user(block + offset, data_user_ptr, in out_of_place_write() 111 if (res) in out_of_place_write() 112 return res; in out_of_place_write() 117 res = tee_fs_htree_write_block(&fdp->ht, start_block_num, in out_of_place_write() 119 if (res != TEE_SUCCESS) in out_of_place_write() 139 return res; in out_of_place_write() 231 TEE_Result res; in ree_fs_rpc_read_init() local [all …]
|
| H A D | fs_htree.c | 112 TEE_Result res; in rpc_read() local 117 res = ht->stor->rpc_read_init(ht->stor_aux, &op, type, idx, vers, &p); in rpc_read() 118 if (res != TEE_SUCCESS) in rpc_read() 119 return res; in rpc_read() 121 res = ht->stor->rpc_read_final(&op, &bytes); in rpc_read() 122 if (res != TEE_SUCCESS) in rpc_read() 123 return res; in rpc_read() 151 TEE_Result res; in rpc_write() local 155 res = ht->stor->rpc_write_init(ht->stor_aux, &op, type, idx, vers, &p); in rpc_write() 156 if (res != TEE_SUCCESS) in rpc_write() [all …]
|
| H A D | tee_rpmb_fs.c | 302 TEE_Result res = TEE_SUCCESS; in tee_rpmb_key_gen() local 305 res = TEE_ERROR_BAD_PARAMETERS; in tee_rpmb_key_gen() 313 return res; in tee_rpmb_key_gen() 370 static void get_op_result_bits(uint8_t *bytes, uint8_t *res) in get_op_result_bits() argument 372 *res = *(bytes + 1) & RPMB_RESULT_MASK; in get_op_result_bits() 380 TEE_Result res = TEE_ERROR_GENERIC; in tee_rpmb_mac_calc() local 387 res = crypto_mac_alloc_ctx(&ctx, TEE_ALG_HMAC_SHA256); in tee_rpmb_mac_calc() 388 if (res) in tee_rpmb_mac_calc() 389 return res; in tee_rpmb_mac_calc() 391 res = crypto_mac_init(ctx, key, keysize); in tee_rpmb_mac_calc() [all …]
|
| H A D | tee_svc_storage.c | 85 TEE_Result res = TEE_SUCCESS; in tee_svc_storage_read_head() local 94 res = fops->open(o->pobj, &size, &o->fh); in tee_svc_storage_read_head() 95 if (res != TEE_SUCCESS) in tee_svc_storage_read_head() 100 res = fops->read(o->fh, 0, &head, NULL, &bytes); in tee_svc_storage_read_head() 101 if (res != TEE_SUCCESS) { in tee_svc_storage_read_head() 102 if (res == TEE_ERROR_CORRUPT_OBJECT) in tee_svc_storage_read_head() 108 res = TEE_ERROR_OVERFLOW; in tee_svc_storage_read_head() 112 res = TEE_ERROR_CORRUPT_OBJECT; in tee_svc_storage_read_head() 117 res = TEE_ERROR_BAD_FORMAT; in tee_svc_storage_read_head() 121 res = tee_obj_set_type(o, head.objectType, head.maxObjectSize); in tee_svc_storage_read_head() [all …]
|
| H A D | tee_cryp_hkdf.c | 20 TEE_Result res; in hkdf_extract() local 32 res = tee_alg_get_digest_size(hash_algo, &salt_len); in hkdf_extract() 33 if (res != TEE_SUCCESS) in hkdf_extract() 37 res = crypto_mac_alloc_ctx(&ctx, hmac_algo); in hkdf_extract() 38 if (res) in hkdf_extract() 47 res = crypto_mac_init(ctx, salt, salt_len); in hkdf_extract() 48 if (res != TEE_SUCCESS) in hkdf_extract() 51 res = crypto_mac_update(ctx, ikm, ikm_len); in hkdf_extract() 52 if (res != TEE_SUCCESS) in hkdf_extract() 55 res = crypto_mac_final(ctx, prk, *prk_len); in hkdf_extract() [all …]
|
| H A D | tadb.c | 101 TEE_Result res = TEE_SUCCESS; in ta_operation_open() local 116 res = thread_rpc_cmd(OPTEE_RPC_CMD_FS, ARRAY_SIZE(params), params); in ta_operation_open() 117 if (!res) in ta_operation_open() 120 return res; in ta_operation_open() 163 TEE_Result res = maybe_grow_files(db, idx); in set_file() local 165 if (!res) in set_file() 168 return res; in set_file() 197 TEE_Result res = db->ops->read(db->fh, idx * l, entry, NULL, &l); in read_ent() local 199 if (!res && l != sizeof(*entry)) in read_ent() 202 return res; in read_ent() [all …]
|
| H A D | tee_svc_cryp.c | 723 TEE_Result res = TEE_SUCCESS; in op_attr_secret_value_from_user() local 729 res = copy_from_user(key + 1, buffer, size); in op_attr_secret_value_from_user() 730 if (!res) in op_attr_secret_value_from_user() 733 return res; in op_attr_secret_value_from_user() 740 TEE_Result res; in op_attr_secret_value_to_user() local 745 res = copy_from_user(&s, size, sizeof(s)); in op_attr_secret_value_to_user() 746 if (res != TEE_SUCCESS) in op_attr_secret_value_to_user() 747 return res; in op_attr_secret_value_to_user() 750 res = copy_to_user(size, &key_size, sizeof(key_size)); in op_attr_secret_value_to_user() 751 if (res != TEE_SUCCESS) in op_attr_secret_value_to_user() [all …]
|
| H A D | fs_dirfile.c | 74 TEE_Result res = maybe_grow_files(dirh, idx); in set_file() local 76 if (!res) in set_file() 79 return res; in set_file() 99 TEE_Result res; in read_dent() local 103 res = dirh->fops->read(dirh->fh, sizeof(struct dirfile_entry) * idx, in read_dent() 105 if (!res && l != sizeof(*dent)) in read_dent() 106 res = TEE_ERROR_ITEM_NOT_FOUND; in read_dent() 108 return res; in read_dent() 114 TEE_Result res; in write_dent() local 116 res = dirh->fops->write(dirh->fh, sizeof(*dent) * n, dent, in write_dent() [all …]
|
| /optee_os/core/pta/ |
| H A D | attestation.c | 55 TEE_Result res = TEE_ERROR_GENERIC; in generate_key() local 57 res = allocate_key(); in generate_key() 58 if (res) in generate_key() 61 res = crypto_bignum_bin2bn((uint8_t *)&e, sizeof(e), key->e); in generate_key() 62 if (res) in generate_key() 72 res = crypto_acipher_gen_rsa_key(key, CFG_ATTESTATION_PTA_KEY_SIZE); in generate_key() 73 if (!res) in generate_key() 79 return res; in generate_key() 116 TEE_Result res = TEE_ERROR_GENERIC; in serialize_key() local 154 return res; in serialize_key() [all …]
|
| /optee_os/core/crypto/ |
| H A D | rng_fortuna.c | 99 TEE_Result res; in key_from_data() local 101 res = hash_init(ctx); in key_from_data() 102 if (res) in key_from_data() 103 return res; in key_from_data() 104 res = hash_update(ctx, data, dlen); in key_from_data() 105 if (res) in key_from_data() 106 return res; in key_from_data() 132 TEE_Result res; in crypto_rng_init() local 145 res = crypto_hash_alloc_ctx(&state.pool_ctx[n], HASH_ALGO); in crypto_rng_init() 146 if (res) in crypto_rng_init() [all …]
|
| /optee_os/core/pta/veraison_attestation/ |
| H A D | sign.c | 65 TEE_Result res = TEE_SUCCESS; in hash_sha256() local 68 res = crypto_hash_alloc_ctx(&ctx, TEE_ALG_SHA256); in hash_sha256() 69 if (res != TEE_SUCCESS) in hash_sha256() 70 return res; in hash_sha256() 71 res = crypto_hash_init(ctx); in hash_sha256() 72 if (res != TEE_SUCCESS) in hash_sha256() 74 res = crypto_hash_update(ctx, msg, msg_len); in hash_sha256() 75 if (res != TEE_SUCCESS) in hash_sha256() 77 res = crypto_hash_final(ctx, hash, TEE_SHA256_HASH_SIZE); in hash_sha256() 81 return res; in hash_sha256() [all …]
|
| /optee_os/ta/avb/ |
| H A D | entry.c | 41 TEE_Result res; in open_rb_state() local 43 res = TEE_OpenPersistentObject(storageid, rb_obj_name, in open_rb_state() 45 if (!res) in open_rb_state() 81 TEE_Result res; in read_rb_idx() local 87 res = get_slot_offset(params[0].value.a, &slot_offset); in read_rb_idx() 88 if (res) in read_rb_idx() 89 return res; in read_rb_idx() 91 res = open_rb_state(DEFAULT_LOCK_STATE, &h); in read_rb_idx() 92 if (res) in read_rb_idx() 93 return res; in read_rb_idx() [all …]
|
| /optee_os/core/lib/libtomcrypt/ |
| H A D | sm2-kep.c | 28 TEE_Result res = TEE_ERROR_GENERIC; in sm2_kep_compute_Z() local 43 res = crypto_hash_alloc_ctx(&ctx, TEE_ALG_SM3); in sm2_kep_compute_Z() 44 if (res) in sm2_kep_compute_Z() 47 res = crypto_hash_init(ctx); in sm2_kep_compute_Z() 48 if (res) in sm2_kep_compute_Z() 51 res = crypto_hash_update(ctx, ENTLEN, sizeof(ENTLEN)); in sm2_kep_compute_Z() 52 if (res) in sm2_kep_compute_Z() 55 res = crypto_hash_update(ctx, id, idlen); in sm2_kep_compute_Z() 56 if (res) in sm2_kep_compute_Z() 60 res = crypto_hash_update(ctx, buf, sizeof(buf)); in sm2_kep_compute_Z() [all …]
|
| /optee_os/core/tests/ |
| H A D | ftmn_boot_tests.c | 20 TEE_Result res = simple_call_func_res; in simple_call_func1() local 22 FTMN_CALLEE_DONE(res); in simple_call_func1() 23 return res; in simple_call_func1() 36 TEE_Result res = TEE_SUCCESS; in simple_call() local 41 FTMN_CALL_FUNC(res, &ftmn, FTMN_INCR0, simple_call_func1); in simple_call() 42 ftmn_expect_state(&ftmn, FTMN_INCR1, FTMN_STEP_COUNT(1), res); in simple_call() 45 FTMN_CALL_FUNC(res, &ftmn, FTMN_INCR0, simple_call_func1); in simple_call() 46 ftmn_expect_state(&ftmn, FTMN_INCR1, FTMN_STEP_COUNT(2, 1), res); in simple_call() 48 FTMN_CALL_FUNC(res, &ftmn, FTMN_INCR0, in simple_call() 50 ftmn_expect_state(&ftmn, FTMN_INCR1, FTMN_STEP_COUNT(3, 2), res); in simple_call() [all …]
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | sm2-kep.c | 33 TEE_Result res = TEE_ERROR_GENERIC; in sm2_kep_compute_Z() local 49 res = crypto_hash_alloc_ctx(&ctx, TEE_ALG_SM3); in sm2_kep_compute_Z() 50 if (res) in sm2_kep_compute_Z() 53 res = crypto_hash_init(ctx); in sm2_kep_compute_Z() 54 if (res) in sm2_kep_compute_Z() 57 res = crypto_hash_update(ctx, ENTLEN, sizeof(ENTLEN)); in sm2_kep_compute_Z() 58 if (res) in sm2_kep_compute_Z() 61 res = crypto_hash_update(ctx, id, idlen); in sm2_kep_compute_Z() 62 if (res) in sm2_kep_compute_Z() 67 res = TEE_ERROR_GENERIC; in sm2_kep_compute_Z() [all …]
|
| /optee_os/core/kernel/ |
| H A D | ldelf_syscalls.c | 33 TEE_Result res = vm_unmap(uctx, va, byte_count); in unmap_or_panic() local 35 if (res) { in unmap_or_panic() 37 va, byte_count, res); in unmap_or_panic() 45 TEE_Result res = TEE_SUCCESS; in ldelf_syscall_map_zi() local 57 res = GET_USER_SCALAR(va_copy, va); in ldelf_syscall_map_zi() 58 if (res) in ldelf_syscall_map_zi() 59 return res; in ldelf_syscall_map_zi() 71 res = vm_map_pad(uctx, &va_copy, num_bytes, prot, vm_flags, in ldelf_syscall_map_zi() 74 if (!res) { in ldelf_syscall_map_zi() 75 res = PUT_USER_SCALAR(va_copy, va); in ldelf_syscall_map_zi() [all …]
|
| H A D | ree_fs_ta.c | 93 TEE_Result res = TEE_SUCCESS; in check_update_version() local 109 res = ops->open(&pobj, NULL, &fh); in check_update_version() 110 if (res != TEE_SUCCESS && res != TEE_ERROR_ITEM_NOT_FOUND) in check_update_version() 113 if (res == TEE_ERROR_ITEM_NOT_FOUND) { in check_update_version() 115 res = ops->create(&pobj, false, NULL, 0, NULL, 0, &db_hdr, NULL, in check_update_version() 117 if (res != TEE_SUCCESS) in check_update_version() 122 res = ops->read(fh, 0, &db_hdr, NULL, &len); in check_update_version() 123 if (res != TEE_SUCCESS) in check_update_version() 131 res = ops->write(fh, 0, &db_hdr, NULL, sizeof(db_hdr)); in check_update_version() 132 if (res != TEE_SUCCESS) in check_update_version() [all …]
|
| H A D | huk_subkey.c | 39 TEE_Result res = TEE_SUCCESS; in huk_compat() local 47 res = get_otp_die_id(chip_id, sizeof(chip_id)); in huk_compat() 48 if (res) in huk_compat() 49 return res; in huk_compat() 50 res = crypto_mac_update(ctx, chip_id, sizeof(chip_id)); in huk_compat() 51 if (res) in huk_compat() 52 return res; in huk_compat() 67 TEE_Result res = TEE_SUCCESS; in __huk_subkey_derive() local 74 res = crypto_mac_alloc_ctx(&ctx, TEE_ALG_HMAC_SHA256); in __huk_subkey_derive() 75 if (res) in __huk_subkey_derive() [all …]
|
| /optee_os/core/arch/arm/kernel/ |
| H A D | secure_partition.c | 135 TEE_Result res = TEE_SUCCESS; in sp_partition_info_get() local 157 if (!count_only && !res) { in sp_partition_info_get() 161 res = spmc_fill_partition_entry(ffa_vers, buf, buf_size, in sp_partition_info_get() 169 return res; in sp_partition_info_get() 223 TEE_Result res = TEE_SUCCESS; in sp_create_ctx() local 235 res = vm_info_init(&spc->uctx, &spc->ts_ctx); in sp_create_ctx() 236 if (res) in sp_create_ctx() 249 return res; in sp_create_ctx() 280 TEE_Result res = TEE_SUCCESS; in sp_create_session() local 291 res = new_session_id(&s->endpoint_id); in sp_create_session() [all …]
|