Lines Matching refs:rc

209 	enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR;  in create_object()  local
232 rc = PKCS11_CKR_DEVICE_MEMORY; in create_object()
251 rc = create_object_uuid(get_session_token(session), obj); in create_object()
252 if (rc) in create_object()
262 rc = tee2pkcs_error(res); in create_object()
266 rc = register_persistent_object(get_session_token(session), in create_object()
268 if (rc) in create_object()
295 return rc; in create_object()
305 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_create_object() local
325 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_create_object()
326 if (rc) in entry_create_object()
327 return rc; in entry_create_object()
329 rc = serialargs_alloc_get_attributes(&ctrlargs, &template); in entry_create_object()
330 if (rc) in entry_create_object()
331 return rc; in entry_create_object()
334 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_create_object()
344 rc = create_attributes_from_template(&head, template, template_size, in entry_create_object()
350 if (rc) in entry_create_object()
357 rc = check_created_attrs_against_processing(PKCS11_PROCESSING_IMPORT, in entry_create_object()
359 if (rc) in entry_create_object()
362 rc = check_created_attrs_against_token(session, head); in entry_create_object()
363 if (rc) in entry_create_object()
366 rc = check_access_attrs_against_token(session, head); in entry_create_object()
367 if (rc) in entry_create_object()
375 rc = create_object(session, head, &obj_handle); in entry_create_object()
376 if (rc) in entry_create_object()
398 return rc; in entry_create_object()
408 enum pkcs11_rc rc = PKCS11_CKR_OK; in entry_destroy_object() local
420 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_destroy_object()
421 if (rc) in entry_destroy_object()
422 return rc; in entry_destroy_object()
424 rc = serialargs_get_u32(&ctrlargs, &object_handle); in entry_destroy_object()
425 if (rc) in entry_destroy_object()
426 return rc; in entry_destroy_object()
445 rc = check_access_attrs_against_token(session, object->attributes); in entry_destroy_object()
446 if (rc) in entry_destroy_object()
458 return rc; in entry_destroy_object()
496 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_find_objects_init() local
511 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_find_objects_init()
512 if (rc) in entry_find_objects_init()
513 return rc; in entry_find_objects_init()
515 rc = serialargs_alloc_get_attributes(&ctrlargs, &template); in entry_find_objects_init()
516 if (rc) in entry_find_objects_init()
517 return rc; in entry_find_objects_init()
520 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_find_objects_init()
526 rc = PKCS11_CKR_OPERATION_ACTIVE; in entry_find_objects_init()
532 rc = PKCS11_CKR_FUNCTION_FAILED; in entry_find_objects_init()
536 rc = sanitize_client_object(&req_attrs, template, in entry_find_objects_init()
539 if (rc) in entry_find_objects_init()
545 rc = PKCS11_CKR_DEVICE_MEMORY; in entry_find_objects_init()
565 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_find_objects_init()
589 rc = find_ctx_add(find_ctx, in entry_find_objects_init()
591 if (rc) in entry_find_objects_init()
604 rc = load_persistent_object_attributes(obj); in entry_find_objects_init()
605 if (rc) { in entry_find_objects_init()
606 rc = PKCS11_CKR_GENERAL_ERROR; in entry_find_objects_init()
628 rc = PKCS11_CKR_DEVICE_MEMORY; in entry_find_objects_init()
633 rc = find_ctx_add(find_ctx, handle); in entry_find_objects_init()
634 if (rc) in entry_find_objects_init()
642 rc = PKCS11_CKR_OK; in entry_find_objects_init()
649 return rc; in entry_find_objects_init()
661 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_find_objects() local
677 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_find_objects()
678 if (rc) in entry_find_objects()
679 return rc; in entry_find_objects()
716 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_find_objects_final() local
725 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_find_objects_final()
726 if (rc) in entry_find_objects_final()
727 return rc; in entry_find_objects_final()
749 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_get_attribute_value() local
767 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_get_attribute_value()
768 if (rc) in entry_get_attribute_value()
769 return rc; in entry_get_attribute_value()
771 rc = serialargs_get(&ctrlargs, &object_handle, sizeof(uint32_t)); in entry_get_attribute_value()
772 if (rc) in entry_get_attribute_value()
773 return rc; in entry_get_attribute_value()
775 rc = serialargs_alloc_get_attributes(&ctrlargs, &template); in entry_get_attribute_value()
776 if (rc) in entry_get_attribute_value()
777 return rc; in entry_get_attribute_value()
780 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_get_attribute_value()
786 rc = PKCS11_CKR_OBJECT_HANDLE_INVALID; in entry_get_attribute_value()
790 rc = check_access_attrs_against_token(session, obj->attributes); in entry_get_attribute_value()
791 if (rc) { in entry_get_attribute_value()
792 rc = PKCS11_CKR_OBJECT_HANDLE_INVALID; in entry_get_attribute_value()
856 rc = get_attribute(obj->attributes, cli_head.id, data_ptr, in entry_get_attribute_value()
859 switch (rc) { in entry_get_attribute_value()
871 rc = PKCS11_CKR_GENERAL_ERROR; in entry_get_attribute_value()
890 rc = PKCS11_CKR_OK; in entry_get_attribute_value()
892 rc = PKCS11_CKR_ATTRIBUTE_SENSITIVE; in entry_get_attribute_value()
894 rc = PKCS11_CKR_ATTRIBUTE_TYPE_INVALID; in entry_get_attribute_value()
896 rc = PKCS11_CKR_BUFFER_TOO_SMALL; in entry_get_attribute_value()
907 return rc; in entry_get_attribute_value()
919 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_get_object_size() local
931 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_get_object_size()
932 if (rc) in entry_get_object_size()
933 return rc; in entry_get_object_size()
935 rc = serialargs_get(&ctrlargs, &object_handle, sizeof(uint32_t)); in entry_get_object_size()
936 if (rc) in entry_get_object_size()
937 return rc; in entry_get_object_size()
946 rc = check_access_attrs_against_token(session, obj->attributes); in entry_get_object_size()
947 if (rc) in entry_get_object_size()
968 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_set_attribute_value() local
983 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_set_attribute_value()
984 if (rc) in entry_set_attribute_value()
985 return rc; in entry_set_attribute_value()
987 rc = serialargs_get(&ctrlargs, &object_handle, sizeof(uint32_t)); in entry_set_attribute_value()
988 if (rc) in entry_set_attribute_value()
989 return rc; in entry_set_attribute_value()
991 rc = serialargs_alloc_get_attributes(&ctrlargs, &template); in entry_set_attribute_value()
992 if (rc) in entry_set_attribute_value()
993 return rc; in entry_set_attribute_value()
996 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_set_attribute_value()
1002 rc = PKCS11_CKR_OBJECT_HANDLE_INVALID; in entry_set_attribute_value()
1010 rc = PKCS11_CKR_SESSION_READ_ONLY; in entry_set_attribute_value()
1017 rc = check_access_attrs_against_token(session, obj->attributes); in entry_set_attribute_value()
1018 if (rc) { in entry_set_attribute_value()
1019 rc = PKCS11_CKR_USER_NOT_LOGGED_IN; in entry_set_attribute_value()
1025 rc = PKCS11_CKR_ACTION_PROHIBITED; in entry_set_attribute_value()
1036 rc = create_attributes_from_template(&head, template, template_size, in entry_set_attribute_value()
1040 if (rc) in entry_set_attribute_value()
1044 rc = check_attrs_against_modification(session, head, obj, function); in entry_set_attribute_value()
1045 if (rc) in entry_set_attribute_value()
1052 rc = modify_attributes_list(&obj->attributes, head); in entry_set_attribute_value()
1053 if (rc) in entry_set_attribute_value()
1057 rc = update_persistent_object_attributes(obj); in entry_set_attribute_value()
1058 if (rc) in entry_set_attribute_value()
1068 return rc; in entry_set_attribute_value()
1080 enum pkcs11_rc rc = PKCS11_CKR_GENERAL_ERROR; in entry_copy_object() local
1099 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_copy_object()
1100 if (rc) in entry_copy_object()
1101 return rc; in entry_copy_object()
1103 rc = serialargs_get(&ctrlargs, &object_handle, sizeof(uint32_t)); in entry_copy_object()
1104 if (rc) in entry_copy_object()
1105 return rc; in entry_copy_object()
1107 rc = serialargs_alloc_get_attributes(&ctrlargs, &template); in entry_copy_object()
1108 if (rc) in entry_copy_object()
1109 return rc; in entry_copy_object()
1112 rc = PKCS11_CKR_ARGUMENTS_BAD; in entry_copy_object()
1118 rc = PKCS11_CKR_OBJECT_HANDLE_INVALID; in entry_copy_object()
1126 rc = PKCS11_CKR_SESSION_READ_ONLY; in entry_copy_object()
1133 rc = check_access_attrs_against_token(session, obj->attributes); in entry_copy_object()
1134 if (rc) { in entry_copy_object()
1135 rc = PKCS11_CKR_USER_NOT_LOGGED_IN; in entry_copy_object()
1141 rc = PKCS11_CKR_ACTION_PROHIBITED; in entry_copy_object()
1152 rc = create_attributes_from_template(&head, template, template_size, in entry_copy_object()
1156 if (rc) in entry_copy_object()
1160 rc = check_attrs_against_modification(session, head, obj, function); in entry_copy_object()
1161 if (rc) in entry_copy_object()
1177 rc = get_attribute(head, PKCS11_CKA_EXTRACTABLE, &bbool, &size); in entry_copy_object()
1178 if (!rc && !bbool) { in entry_copy_object()
1179 rc = add_attribute(&head, PKCS11_CKA_NEVER_EXTRACTABLE, in entry_copy_object()
1181 if (rc) in entry_copy_object()
1184 rc = PKCS11_CKR_OK; in entry_copy_object()
1194 rc = PKCS11_CKR_DEVICE_MEMORY; in entry_copy_object()
1204 rc = modify_attributes_list(&head_new, head); in entry_copy_object()
1205 if (rc) in entry_copy_object()
1213 rc = create_object(session, head_new, &obj_handle); in entry_copy_object()
1214 if (rc) in entry_copy_object()
1236 return rc; in entry_copy_object()