| /optee_os/ta/pkcs11/src/ |
| H A D | processing.c | 93 enum pkcs11_rc rc = PKCS11_CKR_OPERATION_NOT_INITIALIZED; in get_active_session() local 97 rc = PKCS11_CKR_OK; in get_active_session() 99 return rc; in get_active_session() 175 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in generate_random_key_value() local 184 rc = get_attribute_ptr(*head, PKCS11_CKA_VALUE_LEN, &data, &data_size); in generate_random_key_value() 185 if (rc || data_size != sizeof(uint32_t)) { in generate_random_key_value() 186 DMSG("%s", rc ? "No attribute value_len found" : in generate_random_key_value() 194 rc = remove_empty_attribute(head, PKCS11_CKA_VALUE); in generate_random_key_value() 195 if (rc != PKCS11_CKR_OK && rc != PKCS11_RV_NOT_FOUND) in generate_random_key_value() 204 rc = add_attribute(head, PKCS11_CKA_VALUE, value, value_len); in generate_random_key_value() [all …]
|
| H A D | processing_rsa.c | 22 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in pkcs2tee_proc_params_rsa_pss() local 30 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_proc_params_rsa_pss() 31 if (rc) in pkcs2tee_proc_params_rsa_pss() 32 return rc; in pkcs2tee_proc_params_rsa_pss() 34 rc = serialargs_get_u32(&args, &mgf); in pkcs2tee_proc_params_rsa_pss() 35 if (rc) in pkcs2tee_proc_params_rsa_pss() 36 return rc; in pkcs2tee_proc_params_rsa_pss() 38 rc = serialargs_get_u32(&args, &salt_len); in pkcs2tee_proc_params_rsa_pss() 39 if (rc) in pkcs2tee_proc_params_rsa_pss() 40 return rc; in pkcs2tee_proc_params_rsa_pss() [all …]
|
| H A D | entry.c | 121 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in TA_InvokeCommandEntryPoint() local 136 if (params[0].memref.size < sizeof(rc)) in TA_InvokeCommandEntryPoint() 157 rc = entry_ping(ptypes, params); in TA_InvokeCommandEntryPoint() 161 rc = entry_ck_slot_list(ptypes, params); in TA_InvokeCommandEntryPoint() 164 rc = entry_ck_slot_info(ptypes, params); in TA_InvokeCommandEntryPoint() 167 rc = entry_ck_token_info(ptypes, params); in TA_InvokeCommandEntryPoint() 170 rc = entry_ck_token_mecha_ids(ptypes, params); in TA_InvokeCommandEntryPoint() 173 rc = entry_ck_token_mecha_info(ptypes, params); in TA_InvokeCommandEntryPoint() 177 rc = entry_ck_open_session(client, ptypes, params); in TA_InvokeCommandEntryPoint() 180 rc = entry_ck_close_session(client, ptypes, params); in TA_InvokeCommandEntryPoint() [all …]
|
| H A D | object.c | 211 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in create_object() local 234 rc = PKCS11_CKR_DEVICE_MEMORY; in create_object() 253 rc = create_object_uuid(get_session_token(session), obj); in create_object() 254 if (rc) in create_object() 264 rc = tee2pkcs_error(res); in create_object() 268 rc = register_persistent_object(get_session_token(session), in create_object() 270 if (rc) in create_object() 297 return rc; in create_object() 307 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_create_object() local 327 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_create_object() [all …]
|
| H A D | pkcs11_attributes.c | 201 enum pkcs11_rc rc = PKCS11_CKR_OK; in pkcs11_import_object_boolprop() local 206 rc = get_attribute(templ, attribute, &bbool, &size); in pkcs11_import_object_boolprop() 207 if (rc) { in pkcs11_import_object_boolprop() 208 if (rc != PKCS11_RV_NOT_FOUND) in pkcs11_import_object_boolprop() 209 return rc; in pkcs11_import_object_boolprop() 226 enum pkcs11_rc rc = PKCS11_CKR_OK; in set_mandatory_boolprops() local 230 rc = pkcs11_import_object_boolprop(out, temp, bp[n]); in set_mandatory_boolprops() 231 if (rc) in set_mandatory_boolprops() 232 return rc; in set_mandatory_boolprops() 235 return rc; in set_mandatory_boolprops() [all …]
|
| H A D | sanitize_object.c | 80 enum pkcs11_rc rc = PKCS11_CKR_OK; in sanitize_class_and_type() local 84 rc = read_attr_advance(src, src_size, &pos, &cli_ref, &data); in sanitize_class_and_type() 85 if (rc) in sanitize_class_and_type() 92 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in sanitize_class_and_type() 101 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in sanitize_class_and_type() 114 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in sanitize_class_and_type() 123 rc = PKCS11_CKR_TEMPLATE_INCONSISTENT; in sanitize_class_and_type() 132 rc = add_attribute(dst, PKCS11_CKA_CLASS, in sanitize_class_and_type() 134 if (rc) in sanitize_class_and_type() 135 return rc; in sanitize_class_and_type() [all …]
|
| H A D | processing_ec.c | 346 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in load_tee_ec_key_attrs() local 372 rc = PKCS11_CKR_OK; in load_tee_ec_key_attrs() 417 rc = PKCS11_CKR_OK; in load_tee_ec_key_attrs() 426 if (rc == PKCS11_CKR_OK) { in load_tee_ec_key_attrs() 433 return rc; in load_tee_ec_key_attrs() 495 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in tee2pkcs_ec_attributes() local 497 rc = tee2pkcs_add_attribute(priv_head, PKCS11_CKA_VALUE, in tee2pkcs_ec_attributes() 499 if (rc) in tee2pkcs_ec_attributes() 502 rc = alloc_get_tee_attribute_data(tee_obj, TEE_ATTR_ECC_PUBLIC_VALUE_X, in tee2pkcs_ec_attributes() 504 if (rc) in tee2pkcs_ec_attributes() [all …]
|
| H A D | processing_asymm.c | 105 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in pkcs2tee_algorithm() local 125 rc = pkcs2tee_algo_rsa_pss(tee_id, proc_params); in pkcs2tee_algorithm() 128 rc = pkcs2tee_algo_rsa_oaep(tee_id, tee_hash_id, proc_params); in pkcs2tee_algorithm() 131 rc = pkcs2tee_algo_rsa_aes_wrap(tee_id, tee_hash_id, in pkcs2tee_algorithm() 140 rc = pkcs2tee_algo_ecdsa(tee_id, proc_params, obj); in pkcs2tee_algorithm() 143 rc = pkcs2tee_algo_ecdh(tee_id, proc_params, obj); in pkcs2tee_algorithm() 146 rc = PKCS11_CKR_OK; in pkcs2tee_algorithm() 160 return rc; in pkcs2tee_algorithm() 298 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in load_tee_key() local 342 rc = pkcs2tee_key_type(&obj->key_type, obj, function); in load_tee_key() [all …]
|
| H A D | pkcs11_token.c | 317 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_ck_slot_info() local 338 rc = serialargs_get(&ctrlargs, &token_id, sizeof(token_id)); in entry_ck_slot_info() 339 if (rc) in entry_ck_slot_info() 340 return rc; in entry_ck_slot_info() 366 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_ck_token_info() local 392 rc = serialargs_get(&ctrlargs, &token_id, sizeof(token_id)); in entry_ck_token_info() 393 if (rc) in entry_ck_token_info() 394 return rc; in entry_ck_token_info() 447 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_ck_token_mecha_ids() local 459 rc = serialargs_get(&ctrlargs, &token_id, sizeof(token_id)); in entry_ck_token_mecha_ids() [all …]
|
| H A D | serializer.c | 29 enum pkcs11_rc rc = PKCS11_CKR_OK; in serialargs_get() local 32 rc = serialargs_get_ptr(args, &src, size); in serialargs_get() 33 if (!rc) in serialargs_get() 36 return rc; in serialargs_get() 43 enum pkcs11_rc rc = PKCS11_CKR_OK; in alloc_and_get() local 56 rc = serialargs_get_ptr(args, &src, size); in alloc_and_get() 57 if (rc) in alloc_and_get() 58 return rc; in alloc_and_get() 111 enum pkcs11_rc rc = PKCS11_CKR_OK; in serialargs_alloc_get_one_attribute() local 115 rc = serialargs_get(args, &head, sizeof(head)); in serialargs_alloc_get_one_attribute() [all …]
|
| H A D | processing_symm.c | 295 enum pkcs11_rc rc = PKCS11_CKR_OK; in hash_secret_helper() local 297 rc = hmac_to_tee_hash(&algo, mech_id); in hash_secret_helper() 298 if (rc) in hash_secret_helper() 299 return rc; in hash_secret_helper() 306 rc = pkcs2tee_load_hashed_attr(tee_attr, TEE_ATTR_SECRET_VALUE, obj, in hash_secret_helper() 309 if (rc) { in hash_secret_helper() 312 return rc; in hash_secret_helper() 330 enum pkcs11_rc rc = PKCS11_CKR_OK; in load_tee_key() local 364 rc = pkcsmech2tee_key_type(&tee_key_type, in load_tee_key() 367 rc = pkcs2tee_key_type(&tee_key_type, obj); in load_tee_key() [all …]
|
| H A D | processing_aes.c | 120 enum pkcs11_rc rc = PKCS11_CKR_OK; in tee_ae_decrypt_update() local 161 rc = tee2pkcs_error(res); in tee_ae_decrypt_update() 173 rc = PKCS11_CKR_DEVICE_MEMORY; in tee_ae_decrypt_update() 180 rc = tee2pkcs_error(res); in tee_ae_decrypt_update() 203 rc = PKCS11_CKR_GENERAL_ERROR; in tee_ae_decrypt_update() 210 rc = PKCS11_CKR_DEVICE_MEMORY; in tee_ae_decrypt_update() 218 rc = tee2pkcs_error(res); in tee_ae_decrypt_update() 230 rc = PKCS11_CKR_GENERAL_ERROR; in tee_ae_decrypt_update() 246 rc = PKCS11_CKR_DEVICE_MEMORY; in tee_ae_decrypt_update() 255 rc = PKCS11_CKR_OK; in tee_ae_decrypt_update() [all …]
|
| H A D | attributes.c | 35 enum pkcs11_rc rc = PKCS11_CKR_OK; in add_attribute() local 39 rc = serialize(bstart, &buf_len, &data32, sizeof(uint32_t)); in add_attribute() 40 if (rc) in add_attribute() 41 return rc; in add_attribute() 44 rc = serialize(bstart, &buf_len, &data32, sizeof(uint32_t)); in add_attribute() 45 if (rc) in add_attribute() 46 return rc; in add_attribute() 48 rc = serialize(bstart, &buf_len, data, size); in add_attribute() 49 if (rc) in add_attribute() 50 return rc; in add_attribute() [all …]
|
| H A D | processing_digest.c | 91 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in init_digest_operation() local 95 rc = allocate_tee_operation(session, proc_params); in init_digest_operation() 96 if (!rc) in init_digest_operation() 99 return rc; in init_digest_operation() 116 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in step_digest_operation() local 177 rc = get_attribute_ptr(obj->attributes, PKCS11_CKA_VALUE, in step_digest_operation() 179 assert(!rc && secret_value && secret_value_size); in step_digest_operation() 213 rc = tee2pkcs_error(res); in step_digest_operation() 215 if (rc == PKCS11_CKR_OK || rc == PKCS11_CKR_BUFFER_TOO_SMALL) in step_digest_operation() 218 return rc; in step_digest_operation()
|
| H A D | persistent_token.c | 102 enum pkcs11_rc rc = PKCS11_CKR_OK; in hash_pin() local 109 rc = do_hash(user, pin, pin_size, s, hash); in hash_pin() 110 if (!rc) in hash_pin() 112 return rc; in hash_pin() 120 enum pkcs11_rc rc = PKCS11_CKR_OK; in verify_pin() local 122 rc = do_hash(user, pin, pin_size, salt, tmp_hash); in verify_pin() 123 if (rc) in verify_pin() 124 return rc; in verify_pin() 127 rc = PKCS11_CKR_PIN_INCORRECT; in verify_pin() 129 return rc; in verify_pin() [all …]
|
| /optee_os/core/drivers/crypto/aspeed/ |
| H A D | hace_ast2600.c | 86 TEE_Result rc = TEE_ERROR_GENERIC; in ast2600_hace_process() local 99 rc = TEE_ERROR_BUSY; in ast2600_hace_process() 121 rc = TEE_ERROR_TARGET_DEAD; in ast2600_hace_process() 128 rc = TEE_SUCCESS; in ast2600_hace_process() 132 return rc; in ast2600_hace_process() 169 TEE_Result rc = TEE_ERROR_GENERIC; in ast2600_hace_update() local 191 rc = ast2600_hace_process(ctx, hctx->buf, blk_size); in ast2600_hace_update() 192 if (rc) in ast2600_hace_update() 193 return rc; in ast2600_hace_update() 202 rc = ast2600_hace_process(ctx, hctx->buf, blk_size); in ast2600_hace_update() [all …]
|
| H A D | crypto_ast2600.c | 25 TEE_Result rc = TEE_ERROR_GENERIC; in crypto_ast2600_init() local 40 rc = ast2600_drvcrypt_register_hash(); in crypto_ast2600_init() 41 if (rc) { in crypto_ast2600_init() 42 EMSG("cannot register hash driver, rc=%d", rc); in crypto_ast2600_init() 43 return rc; in crypto_ast2600_init()
|
| /optee_os/core/lib/scmi-server/ |
| H A D | scmi_server.c | 77 int rc = 0; in scmi_server_initialize() local 83 rc = scmi_configure(cfg); in scmi_server_initialize() 84 if (rc < 0) { in scmi_server_initialize() 85 EMSG("SCMI server configuration failed: %d", rc); in scmi_server_initialize() 91 rc = scmi_arch_init(); in scmi_server_initialize() 92 if (rc < 0) { in scmi_server_initialize() 93 EMSG("SCMI server init failed: %d", rc); in scmi_server_initialize()
|
| /optee_os/core/arch/arm/kernel/ |
| H A D | thread_spmc.c | 368 int rc = 0; in spmc_handle_rxtx_map() local 378 rc = FFA_INVALID_PARAMETERS; in spmc_handle_rxtx_map() 384 rc = FFA_INVALID_PARAMETERS; in spmc_handle_rxtx_map() 392 rc = FFA_DENIED; in spmc_handle_rxtx_map() 426 rc = FFA_NO_MEMORY; in spmc_handle_rxtx_map() 437 rc = FFA_NO_MEMORY; in spmc_handle_rxtx_map() 441 rc = map_buf(tx_pa, sz, &tx); in spmc_handle_rxtx_map() 442 if (rc) in spmc_handle_rxtx_map() 444 rc = map_buf(rx_pa, sz, &rx); in spmc_handle_rxtx_map() 445 if (rc) { in spmc_handle_rxtx_map() [all …]
|
| /optee_os/core/arch/arm/plat-stm32mp1/pm/ |
| H A D | psci.c | 155 int rc = 0; in psci_cpu_on() local 167 rc = PSCI_RET_ALREADY_ON; in psci_cpu_on() 170 rc = PSCI_RET_ON_PENDING; in psci_cpu_on() 173 rc = PSCI_RET_DENIED; in psci_cpu_on() 177 rc = PSCI_RET_SUCCESS; in psci_cpu_on() 185 if (rc == PSCI_RET_SUCCESS) { in psci_cpu_on() 190 return rc; in psci_cpu_on()
|
| /optee_os/core/include/kernel/ |
| H A D | spinlock.h | 102 unsigned int rc; in cpu_spin_trylock() local 105 rc = __cpu_spin_trylock(lock); in cpu_spin_trylock() 106 if (!rc) in cpu_spin_trylock() 108 return !rc; in cpu_spin_trylock()
|
| /optee_os/core/drivers/bnxt/ |
| H A D | bnxt_fw.c | 427 int rc = BNXT_FAILURE; in ape_section_copy() local 485 rc = BNXT_SUCCESS; in ape_section_copy() 488 return rc; in ape_section_copy() 523 int rc = BNXT_SUCCESS; in bnxt_load() local 539 rc = BNXT_FAILURE; in bnxt_load() 546 rc = BNXT_FAILURE; in bnxt_load() 553 rc = BNXT_FAILURE; in bnxt_load() 558 rc = ape_section_copy(bin_hdr, section); in bnxt_load() 559 if (rc != BNXT_SUCCESS) in bnxt_load() 562 rc = ape_section_zero(section); in bnxt_load() [all …]
|
| /optee_os/core/arch/riscv/kernel/ |
| H A D | boot.c | 74 int rc = 0; in start_secondary_cores() local 86 rc = sbi_hsm_hart_get_status(hartid, &status); in start_secondary_cores() 92 if (rc || status != SBI_HSM_STATE_STOPPED) in start_secondary_cores() 97 rc = sbi_hsm_hart_start(hartid, start_addr, 0 /* unused */); in start_secondary_cores() 98 if (rc) { in start_secondary_cores()
|
| /optee_os/lib/libutee/ |
| H A D | tee_api_arith_mpi.c | 28 static void __noreturn mpi_panic(const char *func, int line, int rc) in mpi_panic() argument 30 printf("Panic function %s, line %d, code %d\n", func, line, rc); in mpi_panic() 249 int32_t rc; in TEE_BigIntCmp() local 254 rc = mbedtls_mpi_cmp_mpi(&mpi1, &mpi2); in TEE_BigIntCmp() 259 return rc; in TEE_BigIntCmp() 265 int32_t rc; in TEE_BigIntCmpS32() local 269 rc = mbedtls_mpi_cmp_int(&mpi, shortVal); in TEE_BigIntCmpS32() 273 return rc; in TEE_BigIntCmpS32() 325 bool rc; in TEE_BigIntGetBit() local 330 rc = mbedtls_mpi_get_bit(&mpi, bitIndex); in TEE_BigIntGetBit() [all …]
|
| /optee_os/core/drivers/ |
| H A D | stm32_rng.c | 401 TEE_Result rc = TEE_ERROR_GENERIC; in stm32_rng_read() local 414 rc = enable_rng_clock(); in stm32_rng_read() 415 if (rc) in stm32_rng_read() 416 return rc; in stm32_rng_read() 430 rc = read_available(rng_base, out_ptr, &sz); in stm32_rng_read() 433 assert(!rc || rc == TEE_ERROR_NO_DATA); in stm32_rng_read() 434 if (rc) in stm32_rng_read() 440 rc = TEE_ERROR_GENERIC; in stm32_rng_read() 444 if (!rc) { in stm32_rng_read() 454 assert(!rc || rc == TEE_ERROR_GENERIC); in stm32_rng_read() [all …]
|