Function sgx_trts::trts::rsgx_raw_is_within_enclave [−][src]
pub fn rsgx_raw_is_within_enclave(addr: *const u8, size: usize) -> bool
rsgx_raw_is_within_enclave checks whether a given address is within enclave memory.
The rsgx_raw_is_within_enclave function checks that the buffer located at the pointer addr with its length of size is an address that is strictly within the calling enclave address space.
Description
rsgx_raw_is_within_enclave simply compares the start and end address of the buffer with the calling enclave address space. It does not check the property of the address. Given a function pointer, you sometimes need to confirm whether such a function is within the enclave. In this case, it is recommended to use rsgx_raw_is_within_enclave with a size of 1.
Parameters
addr
The start address of the buffer.
size
The size of the buffer.
Requirements
Library: libsgx_trts.a
Return value
true
The buffer is strictly within the enclave address space.
false
The whole buffer or part of the buffer is not within the enclave, or the buffer is wrapped around.