/// Creates a temporary session and call a command.
///
/// Returns error code on failure.
///
/// # Safety
///  - op should be prepared carefully (especially for TEEC_MEMREF_TEMP_*
///    param types: TEEC_TempMemoryReference::buffer should point to valid
///    memory block) otherwise dereference of arbitrary memory can happened.
///  - command_id is a valid TEE request ID
///
Creates a temporary session and call a command.
Returns error code on failure.
Creates a temporary session and call a command . Returns error code on failure .
unsafe fn call_command(op: &mut TeecOperation, command_id: u32) -> Result<(), u32> {
    let mut tee_context = TeeContext::new()?;
    // SAFETY: tee_session is dropped at the end of the function, before the spawning context
    let mut tee_session = tee_context.new_session()?;
    let mut return_origin: u32 = 0;
    // SAFETY: op is a valid operation, return_origin points to a u32 that is valid for writes
    tee_session.invoke_command(command_id, op, &mut return_origin)
}
unsafe fn call_command ( op : & mut TeecOperation , command_id : u32 ) -> Result < ( ) , u32 > { let mut tee_context = TeeContext :: new ( ) ? ; // SAFETY: tee_session is dropped at the end of the function, before the spawning context let mut tee_session = tee_context . new_session ( ) ? ; let mut return_origin : u32 = 0 ; // SAFETY: op is a valid operation, return_origin points to a u32 that is valid for writes tee_session . invoke_command ( command_id , op , & mut return_origin ) }
Creates a temporary session and call a command.
Creates a temporary session and call a command .
op
&mut TeecOperation
command_id
u32
safety
op should be prepared carefully (especially for TEEC_MEMREF_TEMP_
param types: TEEC_TempMemoryReference::buffer should point to valid
memory block) otherwise dereference of arbitrary memory can happened.
command_id is a valid TEE request ID
op should be prepared carefully ( especially for TEEC_MEMREF_TEMP_ param types : TEEC_TempMemoryReference :: buffer should point to valid memory block ) otherwise dereference of arbitrary memory can happened . command_id is a valid TEE request ID