Closed syedelec closed 1 year ago
Hi @syedelec
I want to create a persistent object from an initialized transient object however it did not seem to work
Could you please paste the error message here? thanks!
I have this error:
error[E0308]: mismatched types
--> src/ecdsa.rs:32:14
|
32 | Some(ec_key),
| ^^^^^^ expected struct `ObjectHandle`, found struct `TransientObject`
I have this error:
error[E0308]: mismatched types --> src/ecdsa.rs:32:14 | 32 | Some(ec_key), | ^^^^^^ expected struct `ObjectHandle`, found struct `TransientObject`
Try Some(ec_key.0)
I have another error:
error[E0616]: field `0` of struct `TransientObject` is private
--> src/ecdsa.rs:32:21
|
32 | Some(ec_key.0),
| ^ private field
As a workaround, change this line of code: https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/972760f5bd9777104e653fc31a32da096f1955bd/optee-utee/src/object.rs#L485 to
pub struct TransientObject(pub ObjectHandle);
I will consider which is the best way to add this feature later.
Unfortunately I have another error even with the workaround
error[E0509]: cannot move out of type `TransientObject`, which implements the `Drop` trait
--> src/ecdsa.rs:32:14
|
32 | Some(ec_key.0),
| ^^^^^^^^
| |
| cannot move out of here
| move occurs because `ec_key.0` has type `ObjectHandle`, which does not implement the `Copy` trait
Add a new line #[derive(Copy, Clone)]
above this line of code:
/// An opaque handle on an object.
#[derive(Copy, Clone)]
pub struct ObjectHandle {
raw: *mut raw::TEE_ObjectHandle,
}
Thanks it's working now.
Hello
I want to create a persistent object from an initialized transient object however it did not seem to work and unfortunately there are no examples, the only examples concern creating a persistent object with initial data.
According to code documentation, this should be possible. Refer to code.
Here is a sample code:
Thanks for your help.