Lines Matching refs:rc
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()
343 if (rc) in load_tee_key()
344 return rc; in load_tee_key()
352 rc = load_tee_rsa_key_attrs(&tee_attrs, &tee_attrs_count, obj); in load_tee_key()
355 rc = load_tee_ec_key_attrs(&tee_attrs, &tee_attrs_count, obj); in load_tee_key()
358 rc = load_tee_eddsa_key_attrs(&tee_attrs, &tee_attrs_count, in load_tee_key()
364 if (rc) in load_tee_key()
365 return rc; in load_tee_key()
408 enum pkcs11_rc rc = PKCS11_CKR_OK; in init_tee_operation() local
413 rc = pkcs2tee_rsa_nopad_context(proc); in init_tee_operation()
421 rc = pkcs2tee_proc_params_rsa_pss(proc, proc_params); in init_tee_operation()
422 if (rc) in init_tee_operation()
425 rc = pkcs2tee_validate_rsa_pss(proc, obj); in init_tee_operation()
428 rc = pkcs2tee_proc_params_rsa_oaep(proc, proc_params); in init_tee_operation()
431 rc = pkcs2tee_proc_params_eddsa(proc, proc_params); in init_tee_operation()
434 rc = pkcs2tee_proc_params_rsa_aes_wrap(proc, proc_params); in init_tee_operation()
440 return rc; in init_tee_operation()
448 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in init_asymm_operation() local
452 rc = allocate_tee_operation(session, function, proc_params, obj); in init_asymm_operation()
453 if (rc) in init_asymm_operation()
454 return rc; in init_asymm_operation()
456 rc = load_tee_key(session, obj, function); in init_asymm_operation()
457 if (rc) in init_asymm_operation()
458 return rc; in init_asymm_operation()
460 rc = init_tee_operation(session, proc_params, obj); in init_asymm_operation()
461 if (!rc) in init_asymm_operation()
464 return rc; in init_asymm_operation()
481 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in step_asymm_operation() local
544 rc = PKCS11_CKR_DEVICE_MEMORY; in step_asymm_operation()
561 rc = PKCS11_CKR_DEVICE_MEMORY; in step_asymm_operation()
587 rc = PKCS11_CKR_DEVICE_MEMORY; in step_asymm_operation()
606 rc = PKCS11_CKR_DEVICE_MEMORY; in step_asymm_operation()
645 rc = PKCS11_CKR_OK; in step_asymm_operation()
652 rc = PKCS11_CKR_GENERAL_ERROR; in step_asymm_operation()
690 rc = tee2pkcs_error(res); in step_asymm_operation()
691 if (rc != PKCS11_CKR_OK) in step_asymm_operation()
709 rc = PKCS11_CKR_FUNCTION_FAILED; in step_asymm_operation()
721 rc = PKCS11_CKR_SIGNATURE_LEN_RANGE; in step_asymm_operation()
733 rc = PKCS11_CKR_FUNCTION_FAILED; in step_asymm_operation()
739 rc = PKCS11_CKR_SIGNATURE_LEN_RANGE; in step_asymm_operation()
760 rc = PKCS11_CKR_FUNCTION_FAILED; in step_asymm_operation()
765 rc = PKCS11_CKR_SIGNATURE_LEN_RANGE; in step_asymm_operation()
788 rc = tee2pkcs_error(res); in step_asymm_operation()
789 if (rc == PKCS11_CKR_ARGUMENTS_BAD) in step_asymm_operation()
790 rc = PKCS11_CKR_DATA_LEN_RANGE; in step_asymm_operation()
799 rc = tee2pkcs_error(res); in step_asymm_operation()
800 if (rc == PKCS11_CKR_ARGUMENTS_BAD) in step_asymm_operation()
801 rc = PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE; in step_asymm_operation()
811 rc = tee2pkcs_error(res); in step_asymm_operation()
820 rc = tee2pkcs_error(res); in step_asymm_operation()
839 rc = PKCS11_CKR_DATA_LEN_RANGE; in step_asymm_operation()
847 rc = tee2pkcs_error(res); in step_asymm_operation()
848 if (rc == PKCS11_CKR_ARGUMENTS_BAD) in step_asymm_operation()
849 rc = PKCS11_CKR_DATA_LEN_RANGE; in step_asymm_operation()
859 rc = PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE; in step_asymm_operation()
868 rc = tee2pkcs_error(res); in step_asymm_operation()
869 if (rc == PKCS11_CKR_ARGUMENTS_BAD) in step_asymm_operation()
870 rc = PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE; in step_asymm_operation()
885 rc = PKCS11_CKR_DATA_LEN_RANGE; in step_asymm_operation()
890 rc = PKCS11_CKR_BUFFER_TOO_SMALL; in step_asymm_operation()
905 rc = PKCS11_CKR_DATA_INVALID; in step_asymm_operation()
913 rc = tee2pkcs_error(res); in step_asymm_operation()
928 rc = tee2pkcs_error(res); in step_asymm_operation()
929 if (rc == PKCS11_CKR_OK) { in step_asymm_operation()
948 rc = PKCS11_CKR_SIGNATURE_INVALID; in step_asymm_operation()
982 rc = tee2pkcs_error(res); in step_asymm_operation()
991 rc = tee2pkcs_error(res); in step_asymm_operation()
1006 (rc == PKCS11_CKR_OK || rc == PKCS11_CKR_BUFFER_TOO_SMALL)) { in step_asymm_operation()
1013 rc = PKCS11_CKR_GENERAL_ERROR; in step_asymm_operation()
1021 return rc; in step_asymm_operation()
1028 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in do_asymm_derivation() local
1042 rc = get_u32_attribute(*head, PKCS11_CKA_VALUE_LEN, &key_bit_size); in do_asymm_derivation()
1043 if (rc) in do_asymm_derivation()
1044 return rc; in do_asymm_derivation()
1058 rc = pkcs2tee_param_ecdh(proc_params, &a_ptr, &a_size); in do_asymm_derivation()
1059 if (rc) in do_asymm_derivation()
1080 rc = alloc_get_tee_attribute_data(out_handle, TEE_ATTR_SECRET_VALUE, in do_asymm_derivation()
1082 if (rc) in do_asymm_derivation()
1086 rc = PKCS11_CKR_KEY_SIZE_RANGE; in do_asymm_derivation()
1088 rc = add_attribute(head, PKCS11_CKA_VALUE, a_ptr, in do_asymm_derivation()
1095 return rc; in do_asymm_derivation()
1102 enum pkcs11_rc rc = PKCS11_CKR_OK; in wrap_rsa_aes_key() local
1130 rc = tee2pkcs_error(res); in wrap_rsa_aes_key()
1135 rc = PKCS11_CKR_BUFFER_TOO_SMALL; in wrap_rsa_aes_key()
1145 rc = PKCS11_CKR_KEY_SIZE_RANGE; in wrap_rsa_aes_key()
1147 rc = PKCS11_CKR_FUNCTION_FAILED; in wrap_rsa_aes_key()
1158 rc = PKCS11_CKR_ARGUMENTS_BAD; in wrap_rsa_aes_key()
1168 return rc; in wrap_rsa_aes_key()
1175 enum pkcs11_rc rc = PKCS11_CKR_OK; in unwrap_rsa_aes_key() local
1207 rc = tee2pkcs_error(res); in unwrap_rsa_aes_key()
1215 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in unwrap_rsa_aes_key()
1224 rc = PKCS11_CKR_WRAPPED_KEY_INVALID; in unwrap_rsa_aes_key()
1232 return rc; in unwrap_rsa_aes_key()
1239 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in wrap_data_by_asymm_enc() local
1244 rc = wrap_rsa_aes_key(proc, data, data_sz, out_buf, out_sz); in wrap_data_by_asymm_enc()
1250 return rc; in wrap_data_by_asymm_enc()
1257 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in unwrap_key_by_asymm() local
1262 rc = unwrap_rsa_aes_key(proc, data, data_sz, out_buf, out_sz); in unwrap_key_by_asymm()
1268 return rc; in unwrap_key_by_asymm()