diff --git a/optee-utee/src/object.rs b/optee-utee/src/object.rs index bd1432e5..09fa461e 100644 --- a/optee-utee/src/object.rs +++ b/optee-utee/src/object.rs @@ -224,6 +224,10 @@ impl ObjectHandle { unsafe { *(self.raw) } } + fn is_null(&self) -> bool { + self.raw.is_null() + } + fn from_raw(raw: *mut raw::TEE_ObjectHandle) -> ObjectHandle { Self { raw } } @@ -517,6 +521,15 @@ impl TransientObject { Self(ObjectHandle::from_raw(ptr::null_mut())) } + /// Check if current object is created with null handle. + /// + /// # See Also + /// + /// - [Self::null_object](Self::null_object). + pub fn is_null_object(&self) -> bool { + self.0.is_null() + } + /// Allocate an uninitialized [TransientObject](TransientObject), i.e. a container for attributes. /// /// As allocated, the object is uninitialized.