From 1e27ca499c0248dff3b0fbb3676a46970c733525 Mon Sep 17 00:00:00 2001 From: ivila <390810839@qq.com> Date: Thu, 30 Jul 2026 10:21:42 +0800 Subject: [PATCH] refactor: hide low-level OP-TEE dependencies --- ci/ci.sh | 1 - crates/Cargo.toml | 3 - crates/optee-teec/src/extension.rs | 3 +- crates/optee-utee-build/src/code_generator.rs | 105 ++++----- .../test_files/test_result.rs | 76 +++---- crates/optee-utee-macros/src/lib.rs | 28 +-- crates/optee-utee/Cargo.toml | 1 - crates/rustls_provider/Cargo.toml | 2 - crates/secure_db/Cargo.toml | 1 - docs/overview-of-optee-rust-examples.md | 1 - docs/ta-development-modes.md | 2 +- examples/Makefile | 3 +- examples/ca/Cargo.lock | 215 +++++++++--------- .../build_with_optee_utee_sys-rs/Cargo.toml | 29 --- .../ca/build_with_optee_utee_sys-rs/Makefile | 20 -- .../build_with_optee_utee_sys-rs/src/main.rs | 39 ---- examples/metadata.json | 5 - examples/ta/Cargo.lock | 181 +++++++-------- examples/ta/Cargo.toml | 2 - examples/ta/acipher-rs/Cargo.toml | 3 +- examples/ta/aes-rs/Cargo.toml | 3 +- examples/ta/authentication-rs/Cargo.toml | 3 +- examples/ta/big_int-rs/Cargo.toml | 3 +- .../build_with_optee_utee_sys-rs/Cargo.toml | 42 ---- .../ta/build_with_optee_utee_sys-rs/Makefile | 21 -- .../ta/build_with_optee_utee_sys-rs/build.rs | 38 ---- .../build_with_optee_utee_sys-rs/src/main.rs | 66 ------ .../ta/build_with_optee_utee_sys-rs/uuid.txt | 1 - examples/ta/client_pool-rs/Cargo.toml | 3 +- examples/ta/diffie_hellman-rs/Cargo.toml | 3 +- examples/ta/digest-rs/Cargo.toml | 3 +- examples/ta/error_handling-rs/Cargo.toml | 3 +- examples/ta/hello_world-rs/Cargo.toml | 3 +- examples/ta/hotp-rs/Cargo.toml | 3 +- examples/ta/inter_ta-rs/Cargo.toml | 3 +- .../message_passing_interface-rs/Cargo.toml | 3 +- examples/ta/mnist-rs/common/Cargo.toml | 1 - examples/ta/mnist-rs/inference/Cargo.toml | 1 - examples/ta/mnist-rs/train/Cargo.toml | 1 - examples/ta/property-rs/Cargo.toml | 3 +- .../ta/proto/src/build_with_optee_utee_sys.rs | 31 --- examples/ta/proto/src/lib.rs | 1 - examples/ta/random-rs/Cargo.toml | 3 +- .../ta/secure_db_abstraction-rs/Cargo.toml | 3 +- examples/ta/secure_storage-rs/Cargo.toml | 3 +- examples/ta/serde-rs/Cargo.toml | 3 +- .../ta/signature_verification-rs/Cargo.toml | 3 +- examples/ta/supp_plugin-rs/Cargo.toml | 3 +- examples/ta/tcp_client-rs/Cargo.toml | 3 +- examples/ta/time-rs/Cargo.toml | 3 +- examples/ta/tls_client-rs/Cargo.toml | 3 +- examples/ta/tls_server-rs/Cargo.toml | 3 +- examples/ta/udp_socket-rs/Cargo.toml | 3 +- tests/test_build_with_optee_utee_sys.sh | 39 ---- 54 files changed, 319 insertions(+), 712 deletions(-) delete mode 100644 examples/ca/build_with_optee_utee_sys-rs/Cargo.toml delete mode 100644 examples/ca/build_with_optee_utee_sys-rs/Makefile delete mode 100644 examples/ca/build_with_optee_utee_sys-rs/src/main.rs delete mode 100644 examples/ta/build_with_optee_utee_sys-rs/Cargo.toml delete mode 100644 examples/ta/build_with_optee_utee_sys-rs/Makefile delete mode 100644 examples/ta/build_with_optee_utee_sys-rs/build.rs delete mode 100644 examples/ta/build_with_optee_utee_sys-rs/src/main.rs delete mode 100644 examples/ta/build_with_optee_utee_sys-rs/uuid.txt delete mode 100644 examples/ta/proto/src/build_with_optee_utee_sys.rs delete mode 100755 tests/test_build_with_optee_utee_sys.sh diff --git a/ci/ci.sh b/ci/ci.sh index 6bde9407..ca078906 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -35,7 +35,6 @@ if [ "$STD" ]; then ./test_secure_db_abstraction.sh else ./test_mnist_rs.sh - ./test_build_with_optee_utee_sys.sh fi ./test_hello_world.sh diff --git a/crates/Cargo.toml b/crates/Cargo.toml index f3383fa8..ecc61625 100644 --- a/crates/Cargo.toml +++ b/crates/Cargo.toml @@ -58,7 +58,6 @@ syn = { version = "2.0.117", features = ["full"] } proc-macro2 = "1.0.106" libc = "0.2.184" rand = "0.10" -once_cell = "1.21.4" serde = { version = "1.0.228" } serde_json = { version = "1.0.149" } log = "0.4.29" @@ -72,8 +71,6 @@ mockall = "0.15.0" rustls = { version = "0.23.37", default-features = false } rustls-rustcrypto = "0.0.2-alpha" getrandom = { version = "0.2.17", default-features = false } -base64ct = "1.8.3" -ed25519-dalek = "2.2.0" bincode = "1.3.3" anyhow = "1.0.103" hashbrown = "0.15.5" diff --git a/crates/optee-teec/src/extension.rs b/crates/optee-teec/src/extension.rs index 2da88685..1b28131e 100644 --- a/crates/optee-teec/src/extension.rs +++ b/crates/optee-teec/src/extension.rs @@ -139,7 +139,8 @@ impl<'a, 'b> PluginParameters<'a, 'b> { /// Returns a mutable reference to the inout buffer. /// /// # Safety - /// The caller is responsible for updating `out_len` (via [`set_out_len`]) + /// The caller is responsible for updating `out_len` (via + /// [`set_out_len`](Self::set_out_len)) /// after writing to the buffer. pub unsafe fn get_buffer_mut(&mut self) -> &mut [u8] { self.buf diff --git a/crates/optee-utee-build/src/code_generator.rs b/crates/optee-utee-build/src/code_generator.rs index b4718629..8cbe690f 100644 --- a/crates/optee-utee-build/src/code_generator.rs +++ b/crates/optee-utee-build/src/code_generator.rs @@ -121,7 +121,7 @@ impl HeaderFileGenerator { let utee_type_name_codes = property_value_utee_type_codes(&prop.value); let utee_value_conv_codes = property_value_as_utee_value_codes(&var_name, &prop.value); ext_property_codes.push(quote! { - optee_utee_sys::user_ta_property { + optee_utee::raw::user_ta_property { name: #prop_name_codes.as_ptr(), prop_type: #utee_type_name_codes, value: #utee_value_conv_codes, @@ -133,64 +133,64 @@ impl HeaderFileGenerator { let property_len = ORIGIN_PROPERTY_LEN + conf.ext_properties.len(); let no_mangle_attribute = no_mangle_attribute_codes(); self.code.extend(quote! { - const IS_SINGLE_INSTANCE: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_SINGLE_INSTANCE) != 0; - const IS_MULTI_SESSION: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_MULTI_SESSION) != 0; - const IS_KEEP_ALIVE: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_INSTANCE_KEEP_ALIVE) != 0; - const IS_KEEP_CRASHED: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_INSTANCE_KEEP_CRASHED) != 0; + const IS_SINGLE_INSTANCE: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_SINGLE_INSTANCE) != 0; + const IS_MULTI_SESSION: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_MULTI_SESSION) != 0; + const IS_KEEP_ALIVE: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_INSTANCE_KEEP_ALIVE) != 0; + const IS_KEEP_CRASHED: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_INSTANCE_KEEP_CRASHED) != 0; const TA_ENDIAN: u32 = 0; - const DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT) != 0; + const DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT) != 0; #no_mangle_attribute pub static ta_num_props: usize = #property_len; #no_mangle_attribute - pub static ta_props: [optee_utee_sys::user_ta_property; #property_len] = [ - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_SINGLE_INSTANCE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + pub static ta_props: [optee_utee::raw::user_ta_property; #property_len] = [ + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_SINGLE_INSTANCE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_SINGLE_INSTANCE as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_MULTI_SESSION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_MULTI_SESSION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_MULTI_SESSION as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_KEEP_ALIVE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_KEEP_ALIVE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_KEEP_ALIVE as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_KEEP_CRASHED, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_KEEP_CRASHED, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_KEEP_CRASHED as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DATA_SIZE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DATA_SIZE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_DATA_SIZE as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_STACK_SIZE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_STACK_SIZE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_STACK_SIZE as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_VERSION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_VERSION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, value: TA_VERSION as *const [u8] as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DESCRIPTION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DESCRIPTION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, value: TA_DESCRIPTION as *const [u8] as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_ENDIAN, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_ENDIAN, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_ENDIAN as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DOES_NOT_CLOSE_HANDLE_ON_CORRUPT_OBJECT, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DOES_NOT_CLOSE_HANDLE_ON_CORRUPT_OBJECT, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT as *const bool as _, }, #(#ext_property_codes),* @@ -207,7 +207,7 @@ impl HeaderFileGenerator { self.code.extend(quote! { #no_mangle_attribute #ta_head_session_attribute - pub static ta_head: optee_utee_sys::ta_head = optee_utee_sys::ta_head { + pub static ta_head: optee_utee::raw::ta_head = optee_utee::raw::ta_head { uuid: #uuid_value_codes, stack_size: #stack_size, flags: TA_FLAGS, @@ -246,7 +246,7 @@ fn property_value_data_codes(value: &PropertyValue) -> Result Result { let (time_low, time_mid, time_hi_and_version, clock_seq_and_node) = uuid.as_fields(); Ok(quote! { - optee_utee_sys::TEE_UUID { + optee_utee::raw::TEE_UUID { timeLow: #time_low, timeMid: #time_mid, timeHiAndVersion: #time_hi_and_version, @@ -261,7 +261,7 @@ fn identity_to_tee_identity_value_codes( ) -> Result { let tee_uuid_codes = uuid_to_tee_uuid_value_codes(uuid)?; Ok(quote! { - optee_utee_sys::TEE_Identity { + optee_utee::raw::TEE_Identity { login: #login, uuid: #tee_uuid_codes, } @@ -273,10 +273,10 @@ fn property_value_rust_type_declaration_codes(value: &PropertyValue) -> proc_mac PropertyValue::U32(_) => "u32", PropertyValue::U64(_) => "u64", PropertyValue::Bool(_) => "bool", - PropertyValue::Uuid(_) => "optee_utee_sys::TEE_UUID", + PropertyValue::Uuid(_) => "optee_utee::raw::TEE_UUID", PropertyValue::Str(_) => "&[u8]", PropertyValue::BinaryBlock(_) => "&[u8]", - PropertyValue::Identity(..) => "optee_utee_sys::TEE_Identity", + PropertyValue::Identity(..) => "optee_utee::raw::TEE_Identity", }) .unwrap() } @@ -291,12 +291,15 @@ fn property_value_as_utee_value_codes( PropertyValue::U64(_) => format!("&{} as *const u64 as *mut _", var_name), PropertyValue::Bool(_) => format!("&{} as *const bool as *mut _", var_name), PropertyValue::Uuid(_) => { - format!("&{} as *const optee_utee_sys::TEE_UUID as *mut _", var_name) + format!( + "&{} as *const optee_utee::raw::TEE_UUID as *mut _", + var_name + ) } PropertyValue::Str(_) => format!("{} as *const [u8] as *mut _", var_name), PropertyValue::BinaryBlock(_) => format!("{} as *const [u8] as *mut _", var_name), PropertyValue::Identity(..) => format!( - "&{} as *const optee_utee_sys::TEE_Identity as *mut _", + "&{} as *const optee_utee::raw::TEE_Identity as *mut _", var_name ), } @@ -307,16 +310,16 @@ fn property_value_as_utee_value_codes( fn property_value_utee_type_codes(value: &PropertyValue) -> proc_macro2::TokenStream { proc_macro2::TokenStream::from_str(match value { - PropertyValue::U32(_) => "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32", - PropertyValue::U64(_) => "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U64", - PropertyValue::Bool(_) => "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL", - PropertyValue::Uuid(_) => "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_UUID", - PropertyValue::Str(_) => "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_STRING", + PropertyValue::U32(_) => "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32", + PropertyValue::U64(_) => "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U64", + PropertyValue::Bool(_) => "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL", + PropertyValue::Uuid(_) => "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_UUID", + PropertyValue::Str(_) => "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_STRING", PropertyValue::BinaryBlock(_) => { - "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BINARY_BLOCK" + "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BINARY_BLOCK" } PropertyValue::Identity(..) => { - "optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_IDENTITY" + "optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_IDENTITY" } }) .unwrap() diff --git a/crates/optee-utee-build/test_files/test_result.rs b/crates/optee-utee-build/test_files/test_result.rs index 40634dae..0d51b69a 100644 --- a/crates/optee-utee-build/test_files/test_result.rs +++ b/crates/optee-utee-build/test_files/test_result.rs @@ -34,75 +34,75 @@ pub static trace_ext_prefix: &[u8] = b"TA\0"; pub unsafe extern "C" fn tahead_get_trace_level() -> c_int { unsafe { trace_level } } -const IS_SINGLE_INSTANCE: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_SINGLE_INSTANCE) +const IS_SINGLE_INSTANCE: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_SINGLE_INSTANCE) != 0; -const IS_MULTI_SESSION: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_MULTI_SESSION) != 0; -const IS_KEEP_ALIVE: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_INSTANCE_KEEP_ALIVE) +const IS_MULTI_SESSION: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_MULTI_SESSION) != 0; +const IS_KEEP_ALIVE: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_INSTANCE_KEEP_ALIVE) != 0; -const IS_KEEP_CRASHED: bool = (TA_FLAGS & optee_utee_sys::TA_FLAG_INSTANCE_KEEP_CRASHED) +const IS_KEEP_CRASHED: bool = (TA_FLAGS & optee_utee::raw::TA_FLAG_INSTANCE_KEEP_CRASHED) != 0; const TA_ENDIAN: u32 = 0; const DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT: bool = (TA_FLAGS - & optee_utee_sys::TA_FLAG_DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT) != 0; + & optee_utee::raw::TA_FLAG_DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT) != 0; #[unsafe(no_mangle)] pub static ta_num_props: usize = 10usize; #[unsafe(no_mangle)] -pub static ta_props: [optee_utee_sys::user_ta_property; 10usize] = [ - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_SINGLE_INSTANCE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, +pub static ta_props: [optee_utee::raw::user_ta_property; 10usize] = [ + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_SINGLE_INSTANCE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_SINGLE_INSTANCE as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_MULTI_SESSION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_MULTI_SESSION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_MULTI_SESSION as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_KEEP_ALIVE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_KEEP_ALIVE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_KEEP_ALIVE as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_KEEP_CRASHED, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_KEEP_CRASHED, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &IS_KEEP_CRASHED as *const bool as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DATA_SIZE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DATA_SIZE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_DATA_SIZE as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_STACK_SIZE, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_STACK_SIZE, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_STACK_SIZE as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_VERSION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_VERSION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, value: TA_VERSION as *const [u8] as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DESCRIPTION, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DESCRIPTION, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_STRING, value: TA_DESCRIPTION as *const [u8] as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_ENDIAN, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_U32, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_ENDIAN, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_U32, value: &TA_ENDIAN as *const u32 as _, }, - optee_utee_sys::user_ta_property { - name: optee_utee_sys::TA_PROP_STR_DOES_NOT_CLOSE_HANDLE_ON_CORRUPT_OBJECT, - prop_type: optee_utee_sys::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, + optee_utee::raw::user_ta_property { + name: optee_utee::raw::TA_PROP_STR_DOES_NOT_CLOSE_HANDLE_ON_CORRUPT_OBJECT, + prop_type: optee_utee::raw::user_ta_prop_type::USER_TA_PROP_TYPE_BOOL, value: &DONT_CLOSE_HANDLE_ON_CORRUPT_OBJECT as *const bool as _, }, ]; #[unsafe(no_mangle)] #[unsafe(link_section = ".ta_head")] -pub static ta_head: optee_utee_sys::ta_head = optee_utee_sys::ta_head { - uuid: optee_utee_sys::TEE_UUID { +pub static ta_head: optee_utee::raw::ta_head = optee_utee::raw::ta_head { + uuid: optee_utee::raw::TEE_UUID { timeLow: 642817260u32, timeMid: 18987u16, timeHiAndVersion: 18741u16, diff --git a/crates/optee-utee-macros/src/lib.rs b/crates/optee-utee-macros/src/lib.rs index 4ba9e592..6043bb01 100644 --- a/crates/optee-utee-macros/src/lib.rs +++ b/crates/optee-utee-macros/src/lib.rs @@ -27,7 +27,7 @@ use syn::spanned::Spanned; /// /// # Examples /// -/// ``` no_run +/// ``` ignore /// #[ta_create] /// fn ta_create() -> Result<()> { } /// ``` @@ -56,9 +56,9 @@ pub fn ta_create(_args: TokenStream, input: TokenStream) -> TokenStream { quote!( #[unsafe(no_mangle)] - pub extern "C" fn TA_CreateEntryPoint() -> optee_utee_sys::TEE_Result { + pub extern "C" fn TA_CreateEntryPoint() -> optee_utee::raw::TEE_Result { match #f_ident() { - Ok(_) => optee_utee_sys::TEE_SUCCESS, + Ok(_) => optee_utee::raw::TEE_SUCCESS, Err(e) => e.raw_code() } } @@ -72,7 +72,7 @@ pub fn ta_create(_args: TokenStream, input: TokenStream) -> TokenStream { /// /// # Examples /// -/// ``` no_run +/// ``` ignore /// #[ta_destroy] /// fn ta_destroy() { } /// ``` @@ -181,7 +181,7 @@ pub fn ta_open_session(_args: TokenStream, input: TokenStream) -> TokenStream { param_types: optee_utee::RawParamTypes, params: &mut optee_utee::RawParams, _: *mut *mut core::ffi::c_void, - ) -> optee_utee_sys::TEE_Result { + ) -> optee_utee::raw::TEE_Result { let mut parameters = match unsafe { optee_utee::FromRawParameters::from_raw(param_types, params) } { @@ -189,7 +189,7 @@ pub fn ta_open_session(_args: TokenStream, input: TokenStream) -> TokenStream { Err(e) => return e.raw_code(), }; match #f_ident(&mut parameters) { - Ok(_) => optee_utee_sys::TEE_SUCCESS, + Ok(_) => optee_utee::raw::TEE_SUCCESS, Err(e) => e.raw_code() } } @@ -211,7 +211,7 @@ pub fn ta_open_session(_args: TokenStream, input: TokenStream) -> TokenStream { param_types: optee_utee::RawParamTypes, params: &mut optee_utee::RawParams, sess_ctx: *mut *mut core::ffi::c_void, - ) -> optee_utee_sys::TEE_Result { + ) -> optee_utee::raw::TEE_Result { let mut parameters = match unsafe { optee_utee::FromRawParameters::from_raw(param_types, params) } { @@ -223,7 +223,7 @@ pub fn ta_open_session(_args: TokenStream, input: TokenStream) -> TokenStream { Ok(_) => { *sess_ctx = alloc::boxed::Box::into_raw(alloc::boxed::Box::new(ctx)) as _; - optee_utee_sys::TEE_SUCCESS + optee_utee::raw::TEE_SUCCESS } Err(e) => e.raw_code() } @@ -242,7 +242,7 @@ pub fn ta_open_session(_args: TokenStream, input: TokenStream) -> TokenStream { /// /// # Examples /// -/// ``` no_run +/// ``` ignore /// #[ta_close_session] /// fn close_session(sess_ctx: &mut T) { } /// @@ -386,7 +386,7 @@ pub fn ta_invoke_command(_args: TokenStream, input: TokenStream) -> TokenStream cmd_id: u32, param_types: optee_utee::RawParamTypes, params: &mut optee_utee::RawParams, - ) -> optee_utee_sys::TEE_Result { + ) -> optee_utee::raw::TEE_Result { let mut parameters = match unsafe { optee_utee::FromRawParameters::from_raw(param_types, params) } { @@ -395,7 +395,7 @@ pub fn ta_invoke_command(_args: TokenStream, input: TokenStream) -> TokenStream }; match #f_ident(cmd_id, &mut parameters) { Ok(_) => { - optee_utee_sys::TEE_SUCCESS + optee_utee::raw::TEE_SUCCESS }, Err(e) => e.raw_code() } @@ -418,9 +418,9 @@ pub fn ta_invoke_command(_args: TokenStream, input: TokenStream) -> TokenStream cmd_id: u32, param_types: optee_utee::RawParamTypes, params: &mut optee_utee::RawParams, - ) -> optee_utee_sys::TEE_Result { + ) -> optee_utee::raw::TEE_Result { if sess_ctx.is_null() { - return optee_utee_sys::TEE_ERROR_SECURITY; + return optee_utee::raw::TEE_ERROR_SECURITY; } let mut parameters = match unsafe { optee_utee::FromRawParameters::from_raw(param_types, params) @@ -432,7 +432,7 @@ pub fn ta_invoke_command(_args: TokenStream, input: TokenStream) -> TokenStream match #f_ident(&mut b, cmd_id, &mut parameters) { Ok(_) => { core::mem::forget(b); - optee_utee_sys::TEE_SUCCESS + optee_utee::raw::TEE_SUCCESS }, Err(e) => { core::mem::forget(b); diff --git a/crates/optee-utee/Cargo.toml b/crates/optee-utee/Cargo.toml index 842249ea..28d28d2e 100644 --- a/crates/optee-utee/Cargo.toml +++ b/crates/optee-utee/Cargo.toml @@ -37,7 +37,6 @@ num_enum.workspace = true [dev-dependencies] rand.workspace = true -once_cell.workspace = true serde.workspace = true serde_json.workspace = true optee-utee-sys = { workspace = true, features = ["mock"] } diff --git a/crates/rustls_provider/Cargo.toml b/crates/rustls_provider/Cargo.toml index 1916d7fc..dd6688ff 100644 --- a/crates/rustls_provider/Cargo.toml +++ b/crates/rustls_provider/Cargo.toml @@ -30,5 +30,3 @@ optee-utee.workspace = true rustls = { workspace = true, default-features = false, features = ["std"] } rustls-rustcrypto = { workspace = true } getrandom = { workspace = true } -base64ct = { workspace = true } -ed25519-dalek = { workspace = true } diff --git a/crates/secure_db/Cargo.toml b/crates/secure_db/Cargo.toml index e63f22d1..9f260306 100644 --- a/crates/secure_db/Cargo.toml +++ b/crates/secure_db/Cargo.toml @@ -25,7 +25,6 @@ edition = "2021" publish = false [dependencies] -optee-utee-sys.workspace = true optee-utee.workspace = true bincode = { workspace = true } diff --git a/docs/overview-of-optee-rust-examples.md b/docs/overview-of-optee-rust-examples.md index 4c9659ac..4ac979d6 100644 --- a/docs/overview-of-optee-rust-examples.md +++ b/docs/overview-of-optee-rust-examples.md @@ -40,4 +40,3 @@ To compile one of the examples, run `make -C examples/EXAMPLE_DIR`. | secure_db_abstraction-rs | `e55291e1-521c-4dca-aa24-51e34ab32ad9` | An abstraction of database base on Secure Storage. | std | | mnist-rs | Train: `1b5f5b74-e9cf-4e62-8c3e-7e41da6d76f6`
Infer: `ff09aa8a-fbb9-4734-ae8c-d7cd1a3f6744` | Training and Performing Inference in Trusted Application. | no-std | | client_pool-rs | `c9d73f40-ba45-4315-92c4-cf1255958729` | Generic Client Session Pool. | both | -| build_with_optee_utee_sys-rs | `bcac6292-5b9d-4b20-a2e5-b389d5e8ae2f` | Using `optee_utee_sys` as `build-dependencies`. | both | diff --git a/docs/ta-development-modes.md b/docs/ta-development-modes.md index db001f65..80e7c139 100644 --- a/docs/ta-development-modes.md +++ b/docs/ta-development-modes.md @@ -37,4 +37,4 @@ permalink: /trustzone-sdk-docs/ta-development-modes.md - **`no-std`**: Excludes `test_tls_client`, `test_tls_server`, `test_secure_db_abstraction`. -- **`std`**: Excludes `test_mnist_rs`, `test_build_with_optee_utee_sys`. \ No newline at end of file +- **`std`**: Excludes `test_mnist_rs`. diff --git a/examples/Makefile b/examples/Makefile index 85f89544..880c10c4 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -64,8 +64,7 @@ COMMON_EXAMPLES = \ time-rs \ udp_socket-rs \ signature_verification-rs \ - client_pool-rs \ - build_with_optee_utee_sys-rs + client_pool-rs # Clean targets STD_ONLY_EXAMPLES_CLEAN = $(STD_ONLY_EXAMPLES:%=%-clean) diff --git a/examples/ca/Cargo.lock b/examples/ca/Cargo.lock index f82f72c8..ff4199e3 100644 --- a/examples/ca/Cargo.lock +++ b/examples/ca/Cargo.lock @@ -96,9 +96,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "arbitrary" @@ -114,7 +114,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -140,13 +140,13 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "async-trait" -version = "0.1.89" +version = "0.1.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -179,7 +179,7 @@ dependencies = [ "num-traits", "pastey", "rayon", - "thiserror 2.0.18", + "thiserror 2.0.19", "v_frame", "y4m", ] @@ -230,9 +230,9 @@ checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" [[package]] name = "bitflags" -version = "2.13.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" [[package]] name = "bitstream-io" @@ -243,14 +243,6 @@ dependencies = [ "no_std_io2", ] -[[package]] -name = "build_with_optee_utee_sys-rs" -version = "0.4.0" -dependencies = [ - "optee-teec", - "proto", -] - [[package]] name = "built" version = "0.8.1" @@ -265,9 +257,9 @@ checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytemuck" -version = "1.25.1" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" [[package]] name = "byteorder-lite" @@ -283,9 +275,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" -version = "1.2.67" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "jobserver", @@ -307,9 +299,9 @@ checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" [[package]] name = "clap" -version = "4.6.2" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd059f9da4f5c36b3787f65d38ccaab1cc315f07b01f89abc8359ee6a8205011" +checksum = "d91e0c145792ef73a6ad36d27c75ac09f1832222a3c209689d90f534685ee5b7" dependencies = [ "clap_builder", "clap_derive", @@ -329,14 +321,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.6.1" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -432,13 +424,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -452,9 +444,9 @@ dependencies = [ [[package]] name = "either" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "equator" @@ -473,7 +465,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -544,9 +536,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" dependencies = [ "futures-core", "futures-sink", @@ -554,32 +546,32 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "futures-sink" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" [[package]] name = "futures-timer" @@ -589,9 +581,9 @@ checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" dependencies = [ "futures-core", "futures-macro", @@ -688,9 +680,9 @@ dependencies = [ [[package]] name = "http" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", "itoa", @@ -868,7 +860,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -927,9 +919,9 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" [[package]] name = "libc" -version = "0.2.186" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libfuzzer-sys" @@ -1143,7 +1135,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1193,7 +1185,7 @@ checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1227,7 +1219,7 @@ version = "0.9.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "uuid", ] @@ -1237,7 +1229,7 @@ version = "0.9.0" dependencies = [ "optee-teec-build", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1309,9 +1301,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" [[package]] name = "potential_utf" @@ -1333,9 +1325,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] @@ -1356,7 +1348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" dependencies = [ "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1422,9 +1414,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -1529,7 +1521,7 @@ dependencies = [ "rand", "rand_chacha", "simd_helpers", - "thiserror 2.0.18", + "thiserror 2.0.19", "v_frame", "wasm-bindgen", ] @@ -1624,9 +1616,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.41" +version = "0.23.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" dependencies = [ "log", "once_cell", @@ -1639,9 +1631,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ "zeroize", ] @@ -1697,9 +1689,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -1716,29 +1708,29 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "serde_json" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "itoa", "memchr", @@ -1773,9 +1765,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" [[package]] name = "simd_helpers" @@ -1828,7 +1820,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1848,9 +1840,20 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.118" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1865,7 +1868,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1901,11 +1904,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.19", ] [[package]] @@ -1916,18 +1919,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] @@ -2004,9 +2007,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.52.3" +version = "1.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" dependencies = [ "pin-project-lite", ] @@ -2030,7 +2033,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -2150,9 +2153,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.5" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" dependencies = [ "js-sys", "wasm-bindgen", @@ -2228,7 +2231,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.119", "wasm-bindgen-shared", ] @@ -2243,9 +2246,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" dependencies = [ "rustls-pki-types", ] @@ -2381,28 +2384,28 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.54" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.54" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -2422,7 +2425,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "synstructure", ] @@ -2462,14 +2465,14 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "zmij" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2f034a4bebf216c9e4b7083603e024cf930873fd67830cfb083c9fa33129d9" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zune-core" diff --git a/examples/ca/build_with_optee_utee_sys-rs/Cargo.toml b/examples/ca/build_with_optee_utee_sys-rs/Cargo.toml deleted file mode 100644 index 66b77730..00000000 --- a/examples/ca/build_with_optee_utee_sys-rs/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -[package] -name = "build_with_optee_utee_sys-rs" -version = "0.4.0" -authors = ["Teaclave Contributors "] -license = "Apache-2.0" -repository = "https://github.com/apache/teaclave-trustzone-sdk.git" -description = "An example of Rust OP-TEE TrustZone SDK." -edition = "2018" - -[dependencies] -proto = { workspace = true } -optee-teec = { workspace = true } diff --git a/examples/ca/build_with_optee_utee_sys-rs/Makefile b/examples/ca/build_with_optee_utee_sys-rs/Makefile deleted file mode 100644 index 31b86d58..00000000 --- a/examples/ca/build_with_optee_utee_sys-rs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -NAME := build_with_optee_utee_sys-rs - -include ../Makefile.include diff --git a/examples/ca/build_with_optee_utee_sys-rs/src/main.rs b/examples/ca/build_with_optee_utee_sys-rs/src/main.rs deleted file mode 100644 index 4f4e3603..00000000 --- a/examples/ca/build_with_optee_utee_sys-rs/src/main.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -use optee_teec::{Context, ErrorKind, Operation, ParamType, Session, Uuid}; -use optee_teec::{ParamNone, ParamValue}; -use proto::build_with_optee_utee_sys::{Command, UUID}; - -fn inc_value(session: &mut Session) -> optee_teec::Result { - let p0 = ParamValue::new(0, 0, ParamType::ValueOutput); - let mut operation = Operation::new(0, p0, ParamNone, ParamNone, ParamNone); - session.invoke_command(Command::IncValue as u32, &mut operation)?; - Ok(operation.parameters().0.a()) -} - -fn main() -> optee_teec::Result<()> { - let mut ctx = Context::new()?; - let uuid = Uuid::parse_str(UUID).map_err(|_| ErrorKind::BadParameters)?; - // Ensure that multiple sessions can be opened concurrently. - let mut session1 = ctx.open_session(uuid.clone())?; - let mut session2 = ctx.open_session(uuid)?; - // Ensure that each session can successfully perform a call. - println!("result is: {}", inc_value(&mut session1)?); - println!("result is: {}", inc_value(&mut session2)?); - Ok(()) -} diff --git a/examples/metadata.json b/examples/metadata.json index da7e13a0..9e1964b1 100644 --- a/examples/metadata.json +++ b/examples/metadata.json @@ -1,10 +1,5 @@ { "examples": { - "build_with_optee_utee_sys-rs": { - "category": "no-std-only", - "tas": ["ta/build_with_optee_utee_sys-rs"], - "cas": ["ca/build_with_optee_utee_sys-rs"] - }, "mnist-rs": { "category": "no-std-only", "tas": [ diff --git a/examples/ta/Cargo.lock b/examples/ta/Cargo.lock index 4bbb30f9..b4f68cb5 100644 --- a/examples/ta/Cargo.lock +++ b/examples/ta/Cargo.lock @@ -8,7 +8,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -53,7 +52,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -77,9 +75,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anyhow" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "atomic_float" @@ -93,7 +91,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -121,7 +118,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -159,16 +155,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "build_with_optee_utee_sys-rs-ta" -version = "0.4.0" -dependencies = [ - "optee-utee", - "optee-utee-build", - "optee-utee-sys", - "proto", -] - [[package]] name = "burn" version = "0.17.1" @@ -193,7 +179,7 @@ dependencies = [ "log", "num-traits", "portable-atomic", - "spin 0.10.0", + "spin 0.10.1", ] [[package]] @@ -226,7 +212,7 @@ dependencies = [ "rand 0.9.5", "serde", "serde_json", - "spin 0.10.0", + "spin 0.10.1", "uuid", ] @@ -239,7 +225,7 @@ dependencies = [ "derive-new 0.7.0", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -272,7 +258,7 @@ dependencies = [ "paste", "portable-atomic-util", "rand 0.9.5", - "spin 0.10.0", + "spin 0.10.1", ] [[package]] @@ -295,9 +281,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.25.1" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" dependencies = [ "bytemuck_derive", ] @@ -310,14 +296,14 @@ checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "cc" -version = "1.2.67" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -377,7 +363,6 @@ dependencies = [ "hex", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -387,7 +372,6 @@ version = "0.4.0" dependencies = [ "burn", "optee-utee", - "optee-utee-sys", "proto", ] @@ -459,7 +443,7 @@ dependencies = [ "portable-atomic", "rand 0.9.5", "serde", - "spin 0.9.8", + "spin 0.9.9", ] [[package]] @@ -486,7 +470,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -514,7 +498,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -525,7 +509,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -545,7 +529,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", "unicode-xid", ] @@ -555,7 +539,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -577,7 +560,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -667,7 +649,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -780,7 +761,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -814,7 +794,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -827,10 +806,9 @@ dependencies = [ "common", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "serde_json", - "spin 0.9.8", + "spin 0.9.9", ] [[package]] @@ -848,7 +826,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -864,14 +841,14 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin 0.9.9", ] [[package]] name = "libc" -version = "0.2.186" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libc_alloc" @@ -908,9 +885,9 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "matrixmultiply" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" dependencies = [ "autocfg", "rawpointer", @@ -928,7 +905,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "serde_json", ] @@ -1020,7 +996,7 @@ checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1057,7 +1033,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn", + "syn 2.0.119", "uuid", ] @@ -1066,7 +1042,7 @@ name = "optee-utee-macros" version = "0.9.0" dependencies = [ "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1172,9 +1148,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" dependencies = [ "serde", ] @@ -1204,7 +1180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.119", ] [[package]] @@ -1218,9 +1194,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] @@ -1231,7 +1207,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1245,9 +1220,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -1323,7 +1298,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1389,9 +1363,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.41" +version = "0.23.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" dependencies = [ "once_cell", "rustls-pki-types", @@ -1402,9 +1376,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ "zeroize", ] @@ -1465,8 +1439,6 @@ dependencies = [ name = "rustls_provider" version = "0.9.0" dependencies = [ - "base64ct", - "ed25519-dalek", "getrandom", "optee-utee", "rustls", @@ -1507,7 +1479,6 @@ dependencies = [ "bincode 1.3.3", "hashbrown", "optee-utee", - "optee-utee-sys", "serde", ] @@ -1518,7 +1489,6 @@ dependencies = [ "anyhow", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "secure_db", "serde", @@ -1530,7 +1500,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1542,9 +1511,9 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -1556,7 +1525,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "serde", "serde_json", @@ -1574,29 +1542,29 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 3.0.3", ] [[package]] name = "serde_json" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "itoa", "memchr", @@ -1638,7 +1606,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1650,9 +1617,9 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "spin" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" dependencies = [ "lock_api", "portable-atomic", @@ -1660,9 +1627,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" dependencies = [ "lock_api", "portable-atomic", @@ -1696,7 +1663,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1711,15 +1678,25 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] [[package]] name = "syn" -version = "2.0.118" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1733,7 +1710,6 @@ dependencies = [ "cfg_block", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1743,7 +1719,6 @@ version = "0.4.0" dependencies = [ "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1755,7 +1730,6 @@ dependencies = [ "getrandom", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "rustls", "rustls_provider", @@ -1771,7 +1745,6 @@ dependencies = [ "lazy_static", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "rustls", "rustls_provider", @@ -1786,10 +1759,9 @@ dependencies = [ "common", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", "serde_json", - "spin 0.9.8", + "spin 0.9.9", ] [[package]] @@ -1805,7 +1777,6 @@ dependencies = [ "cfg_block", "optee-utee", "optee-utee-build", - "optee-utee-sys", "proto", ] @@ -1845,9 +1816,9 @@ checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" [[package]] name = "uuid" -version = "1.23.5" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" [[package]] name = "version_check" @@ -1863,9 +1834,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "webpki-roots" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" dependencies = [ "rustls-pki-types", ] @@ -1956,22 +1927,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.54" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.54" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] @@ -1991,11 +1962,11 @@ checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.119", ] [[package]] name = "zmij" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd2f034a4bebf216c9e4b7083603e024cf930873fd67830cfb083c9fa33129d9" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/examples/ta/Cargo.toml b/examples/ta/Cargo.toml index 6e669047..1ca4c78a 100644 --- a/examples/ta/Cargo.toml +++ b/examples/ta/Cargo.toml @@ -23,7 +23,6 @@ members = [ "aes-rs", "authentication-rs", "big_int-rs", - "build_with_optee_utee_sys-rs", "client_pool-rs", "diffie_hellman-rs", "digest-rs", @@ -58,7 +57,6 @@ authors = ["Teaclave Contributors "] [workspace.dependencies] proto = { path = "proto" } -optee-utee-sys = { path = "../../crates/optee-utee-sys" } optee-utee = { path = "../../crates/optee-utee", features = ["unwind_stubs"] } optee-utee-build = { path = "../../crates/optee-utee-build" } rustls_provider = { path = "../../crates/rustls_provider" } diff --git a/examples/ta/acipher-rs/Cargo.toml b/examples/ta/acipher-rs/Cargo.toml index 423a9f5a..09e0dc2d 100644 --- a/examples/ta/acipher-rs/Cargo.toml +++ b/examples/ta/acipher-rs/Cargo.toml @@ -26,12 +26,11 @@ edition = "2018" [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [build-dependencies] proto = { workspace = true } diff --git a/examples/ta/aes-rs/Cargo.toml b/examples/ta/aes-rs/Cargo.toml index 128d3065..dfdd2412 100644 --- a/examples/ta/aes-rs/Cargo.toml +++ b/examples/ta/aes-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/authentication-rs/Cargo.toml b/examples/ta/authentication-rs/Cargo.toml index 1675359c..2c05f0ff 100644 --- a/examples/ta/authentication-rs/Cargo.toml +++ b/examples/ta/authentication-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/big_int-rs/Cargo.toml b/examples/ta/big_int-rs/Cargo.toml index cc40c721..38c11844 100644 --- a/examples/ta/big_int-rs/Cargo.toml +++ b/examples/ta/big_int-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/build_with_optee_utee_sys-rs/Cargo.toml b/examples/ta/build_with_optee_utee_sys-rs/Cargo.toml deleted file mode 100644 index f0defa65..00000000 --- a/examples/ta/build_with_optee_utee_sys-rs/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -[package] -name = "build_with_optee_utee_sys-rs-ta" -version = "0.4.0" -authors = ["Teaclave Contributors "] -license = "Apache-2.0" -repository = "https://github.com/apache/teaclave-trustzone-sdk.git" -description = "An example of Rust OP-TEE TrustZone SDK." -edition = "2021" - -[features] -default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] - -[dependencies] -proto = { workspace = true } -optee-utee-sys = { workspace = true } -optee-utee = { workspace = true } - -[build-dependencies] -proto = { workspace = true } -optee-utee-build = { workspace = true } -optee-utee-sys = { workspace = true, features = ["no_link"] } - -[package.metadata.optee.ta] -uuid-path = "uuid.txt" diff --git a/examples/ta/build_with_optee_utee_sys-rs/Makefile b/examples/ta/build_with_optee_utee_sys-rs/Makefile deleted file mode 100644 index bd2c3e43..00000000 --- a/examples/ta/build_with_optee_utee_sys-rs/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -UUID ?= $(shell cat uuid.txt) -NAME := build_with_optee_utee_sys-rs-ta - -include ../Makefile.include diff --git a/examples/ta/build_with_optee_utee_sys-rs/build.rs b/examples/ta/build_with_optee_utee_sys-rs/build.rs deleted file mode 100644 index b051bee0..00000000 --- a/examples/ta/build_with_optee_utee_sys-rs/build.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -use optee_utee_build::{Error, TaConfig}; - -fn main() -> Result<(), Error> { - // For Rust editions 2018 and earlier, You must set workspace.resolver = "2" - // in your Cargo.toml to prevent feature unification of optee-utee-sys when - // it is used in both dependencies and build-dependencies. - // - // For editions after 2018, this setting is enabled by default and does not - // need to be specified. - // - // For reference: - // 1. resolver version 2: https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2 - // 2. resolver versions: https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - let flags: u32 = optee_utee_sys::TA_FLAG_SINGLE_INSTANCE - | optee_utee_sys::TA_FLAG_MULTI_SESSION - | optee_utee_sys::TA_FLAG_INSTANCE_KEEP_ALIVE; - - let config = TaConfig::new_default_with_cargo_env(proto::build_with_optee_utee_sys::UUID)? - .ta_flags(flags); - optee_utee_build::build(config) -} diff --git a/examples/ta/build_with_optee_utee_sys-rs/src/main.rs b/examples/ta/build_with_optee_utee_sys-rs/src/main.rs deleted file mode 100644 index d72f481c..00000000 --- a/examples/ta/build_with_optee_utee_sys-rs/src/main.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#![no_std] -#![no_main] - -use core::sync::atomic::{AtomicU32, Ordering}; -use optee_utee::prelude::*; -use optee_utee::{ErrorKind, Result}; -use proto::build_with_optee_utee_sys::Command; - -static GLOBAL_VALUE: AtomicU32 = AtomicU32::new(0); - -#[ta_create] -fn create() -> Result<()> { - GLOBAL_VALUE.store(0, Ordering::Relaxed); - trace_println!("[+] TA create"); - Ok(()) -} - -#[ta_open_session] -fn open_session(_params: &mut ParametersNone) -> Result<()> { - trace_println!("[+] TA open session"); - Ok(()) -} - -#[ta_close_session] -fn close_session() { - trace_println!("[+] TA close session"); -} - -#[ta_destroy] -fn destroy() { - trace_println!("[+] TA destroy"); -} - -#[ta_invoke_command] -fn invoke_command(cmd_id: u32, (p0, _, _, _): &mut ParametersAny<'_>) -> Result<()> { - trace_println!("[+] TA invoke command"); - let values = p0.as_value_output()?; - - match Command::from(cmd_id) { - Command::IncValue => { - let result = GLOBAL_VALUE.fetch_add(1, Ordering::Relaxed); - values.set_a(result); - Ok(()) - } - _ => Err(ErrorKind::BadParameters.into()), - } -} - -include!(concat!(env!("OUT_DIR"), "/user_ta_header.rs")); diff --git a/examples/ta/build_with_optee_utee_sys-rs/uuid.txt b/examples/ta/build_with_optee_utee_sys-rs/uuid.txt deleted file mode 100644 index 44bb5385..00000000 --- a/examples/ta/build_with_optee_utee_sys-rs/uuid.txt +++ /dev/null @@ -1 +0,0 @@ -bcac6292-5b9d-4b20-a2e5-b389d5e8ae2f \ No newline at end of file diff --git a/examples/ta/client_pool-rs/Cargo.toml b/examples/ta/client_pool-rs/Cargo.toml index f920a525..18c82255 100644 --- a/examples/ta/client_pool-rs/Cargo.toml +++ b/examples/ta/client_pool-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } hex = { workspace = true, default-features = false } diff --git a/examples/ta/diffie_hellman-rs/Cargo.toml b/examples/ta/diffie_hellman-rs/Cargo.toml index 60c1ca04..0e37a5e2 100644 --- a/examples/ta/diffie_hellman-rs/Cargo.toml +++ b/examples/ta/diffie_hellman-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/digest-rs/Cargo.toml b/examples/ta/digest-rs/Cargo.toml index ab030f21..5ab89c94 100644 --- a/examples/ta/digest-rs/Cargo.toml +++ b/examples/ta/digest-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/error_handling-rs/Cargo.toml b/examples/ta/error_handling-rs/Cargo.toml index b293f7d8..1c08d958 100644 --- a/examples/ta/error_handling-rs/Cargo.toml +++ b/examples/ta/error_handling-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/hello_world-rs/Cargo.toml b/examples/ta/hello_world-rs/Cargo.toml index d6169c3b..60607174 100644 --- a/examples/ta/hello_world-rs/Cargo.toml +++ b/examples/ta/hello_world-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/hotp-rs/Cargo.toml b/examples/ta/hotp-rs/Cargo.toml index 0603d2e7..e01382e5 100644 --- a/examples/ta/hotp-rs/Cargo.toml +++ b/examples/ta/hotp-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/inter_ta-rs/Cargo.toml b/examples/ta/inter_ta-rs/Cargo.toml index 5ee8062f..2326bfe8 100644 --- a/examples/ta/inter_ta-rs/Cargo.toml +++ b/examples/ta/inter_ta-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/message_passing_interface-rs/Cargo.toml b/examples/ta/message_passing_interface-rs/Cargo.toml index 93d95a18..2eacbb4e 100644 --- a/examples/ta/message_passing_interface-rs/Cargo.toml +++ b/examples/ta/message_passing_interface-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } serde_json = { workspace = true, default-features = false, features = ["alloc"] } diff --git a/examples/ta/mnist-rs/common/Cargo.toml b/examples/ta/mnist-rs/common/Cargo.toml index 66bdb841..1c108a01 100644 --- a/examples/ta/mnist-rs/common/Cargo.toml +++ b/examples/ta/mnist-rs/common/Cargo.toml @@ -27,6 +27,5 @@ edition.workspace = true [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } burn = { workspace = true } diff --git a/examples/ta/mnist-rs/inference/Cargo.toml b/examples/ta/mnist-rs/inference/Cargo.toml index 25713495..42a29b97 100644 --- a/examples/ta/mnist-rs/inference/Cargo.toml +++ b/examples/ta/mnist-rs/inference/Cargo.toml @@ -28,7 +28,6 @@ edition.workspace = true [dependencies] common = { workspace = true } proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } burn = { workspace = true } serde_json = { workspace = true } diff --git a/examples/ta/mnist-rs/train/Cargo.toml b/examples/ta/mnist-rs/train/Cargo.toml index 2c950960..d20ef41e 100644 --- a/examples/ta/mnist-rs/train/Cargo.toml +++ b/examples/ta/mnist-rs/train/Cargo.toml @@ -28,7 +28,6 @@ edition.workspace = true [dependencies] common = { workspace = true } proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } burn = { workspace = true } spin = { workspace = true } diff --git a/examples/ta/property-rs/Cargo.toml b/examples/ta/property-rs/Cargo.toml index 180f504a..7406c3d0 100644 --- a/examples/ta/property-rs/Cargo.toml +++ b/examples/ta/property-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } [build-dependencies] diff --git a/examples/ta/proto/src/build_with_optee_utee_sys.rs b/examples/ta/proto/src/build_with_optee_utee_sys.rs deleted file mode 100644 index 9b8011c9..00000000 --- a/examples/ta/proto/src/build_with_optee_utee_sys.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -use num_enum::{FromPrimitive, IntoPrimitive}; - -#[derive(FromPrimitive, IntoPrimitive)] -#[repr(u32)] -pub enum Command { - IncValue, - #[default] - Unknown, -} - -// If Uuid::parse_str() returns an InvalidLength error, there may be an extra -// newline in your uuid.txt file. You can remove it by running -// `truncate -s 36 uuid.txt`. -pub const UUID: &str = include_str!("../../build_with_optee_utee_sys-rs/uuid.txt"); diff --git a/examples/ta/proto/src/lib.rs b/examples/ta/proto/src/lib.rs index e89143fd..a4e4bec4 100644 --- a/examples/ta/proto/src/lib.rs +++ b/examples/ta/proto/src/lib.rs @@ -21,7 +21,6 @@ pub mod acipher; pub mod aes; pub mod authentication; pub mod big_int; -pub mod build_with_optee_utee_sys; pub mod client_pool; pub mod diffie_hellman; pub mod digest; diff --git a/examples/ta/random-rs/Cargo.toml b/examples/ta/random-rs/Cargo.toml index 0dbe568d..ac081e15 100644 --- a/examples/ta/random-rs/Cargo.toml +++ b/examples/ta/random-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/secure_db_abstraction-rs/Cargo.toml b/examples/ta/secure_db_abstraction-rs/Cargo.toml index 2f83c089..f82d40b5 100644 --- a/examples/ta/secure_db_abstraction-rs/Cargo.toml +++ b/examples/ta/secure_db_abstraction-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true, features = ["std"] } optee-utee = { workspace = true, features = ["std"] } secure_db = { workspace = true } diff --git a/examples/ta/secure_storage-rs/Cargo.toml b/examples/ta/secure_storage-rs/Cargo.toml index a3622e55..7339d1af 100644 --- a/examples/ta/secure_storage-rs/Cargo.toml +++ b/examples/ta/secure_storage-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/serde-rs/Cargo.toml b/examples/ta/serde-rs/Cargo.toml index 04ed73e0..9ed4aef2 100644 --- a/examples/ta/serde-rs/Cargo.toml +++ b/examples/ta/serde-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } serde = { workspace = true, default-features = false, features = ["derive"] } serde_json = { workspace = true, default-features = false, features = ["alloc"] } diff --git a/examples/ta/signature_verification-rs/Cargo.toml b/examples/ta/signature_verification-rs/Cargo.toml index b4d04588..523a9a25 100644 --- a/examples/ta/signature_verification-rs/Cargo.toml +++ b/examples/ta/signature_verification-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/supp_plugin-rs/Cargo.toml b/examples/ta/supp_plugin-rs/Cargo.toml index b29dd8ed..9927ce4b 100644 --- a/examples/ta/supp_plugin-rs/Cargo.toml +++ b/examples/ta/supp_plugin-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/tcp_client-rs/Cargo.toml b/examples/ta/tcp_client-rs/Cargo.toml index 513b523e..9883ed1c 100644 --- a/examples/ta/tcp_client-rs/Cargo.toml +++ b/examples/ta/tcp_client-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } cfg_block = { workspace = true } diff --git a/examples/ta/time-rs/Cargo.toml b/examples/ta/time-rs/Cargo.toml index fd9e3c83..adbcad89 100644 --- a/examples/ta/time-rs/Cargo.toml +++ b/examples/ta/time-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true } [build-dependencies] diff --git a/examples/ta/tls_client-rs/Cargo.toml b/examples/ta/tls_client-rs/Cargo.toml index 5bff2230..1b8be72c 100644 --- a/examples/ta/tls_client-rs/Cargo.toml +++ b/examples/ta/tls_client-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true, features = ["std"] } optee-utee = { workspace = true, features = ["std"] } rustls_provider = { workspace = true } diff --git a/examples/ta/tls_server-rs/Cargo.toml b/examples/ta/tls_server-rs/Cargo.toml index 56d4817f..f28e717b 100644 --- a/examples/ta/tls_server-rs/Cargo.toml +++ b/examples/ta/tls_server-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true, features = ["std"] } optee-utee = { workspace = true, features = ["std"] } rustls_provider = { workspace = true } diff --git a/examples/ta/udp_socket-rs/Cargo.toml b/examples/ta/udp_socket-rs/Cargo.toml index 3941c923..2d3a2829 100644 --- a/examples/ta/udp_socket-rs/Cargo.toml +++ b/examples/ta/udp_socket-rs/Cargo.toml @@ -26,11 +26,10 @@ edition = "2018" [features] default = [] -std = ["optee-utee/std", "optee-utee-sys/std"] +std = ["optee-utee/std"] [dependencies] proto = { workspace = true } -optee-utee-sys = { workspace = true } optee-utee = { workspace = true, features = ["unwind_stubs"] } cfg_block = { workspace = true } diff --git a/tests/test_build_with_optee_utee_sys.sh b/tests/test_build_with_optee_utee_sys.sh deleted file mode 100755 index ef2c4da5..00000000 --- a/tests/test_build_with_optee_utee_sys.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -set -xe - -# Include base script -source setup.sh - -# Copy TA and host binary -copy_ta_to_qemu ../examples/ta/target/$TARGET_TA/release/*.ta -copy_ca_to_qemu ../examples/ca/target/$TARGET_HOST/release/build_with_optee_utee_sys-rs - -# Run command twice, ensure the instance are keeping alive. -OUTPUT1=$(run_in_qemu "build_with_optee_utee_sys-rs") || print_detail_and_exit -OUTPUT2=$(run_in_qemu "build_with_optee_utee_sys-rs") || print_detail_and_exit - -# Script specific checks -{ - grep -q "result is: 0" <<< "$OUTPUT1" && - grep -q "result is: 1" <<< "$OUTPUT1" && - grep -q "result is: 2" <<< "$OUTPUT2" && - grep -q "result is: 3" <<< "$OUTPUT2" -} || print_detail_and_exit