parallaxsecond / rust-tss-esapi

TSS 2.0 Enhanced System API (ESAPI) Rust wrapper
https://docs.rs/tss-esapi/
Apache License 2.0
86 stars 51 forks source link

Implement tr_serialize and tr_deserialize #461

Closed brandsimon closed 10 months ago

brandsimon commented 10 months ago

I don't know if the implementation with buffer.len().try_into().map_err and std::slice::from_raw_parts is the cleanest solution. Please let me know if you have ideas for cleaner solutions. Regarding the tests, the new_handle = old_handle + 1, but I think checking the public part (which includes the public key) is the most relevant test for it.

Edit: The test with the new context is needed. Currently it works with the old context, but not with a new one.

brandsimon commented 10 months ago

@Superhepper Thank you very much. Your ffi code works great and looks clean. I changed the test to persist the handle and drop the old context. If the persistent handle exists, it is cleared before the test.

brandsimon commented 10 months ago

@ionut-arm @Superhepper I added descriptions and examples.