diff --git a/tss-esapi/tests/integration_tests/context_tests/general_esys_tr_tests.rs b/tss-esapi/tests/integration_tests/context_tests/general_esys_tr_tests.rs index ffdfdeaf..dc695135 100644 --- a/tss-esapi/tests/integration_tests/context_tests/general_esys_tr_tests.rs +++ b/tss-esapi/tests/integration_tests/context_tests/general_esys_tr_tests.rs @@ -468,10 +468,12 @@ mod test_tr_serialize_tr_deserialize { .unwrap() .key_handle; let data = context.tr_serialize(key_handle.into()).unwrap(); - let new_handle = context.tr_deserialize(&data).unwrap().into(); + // Load handle in a new context + let mut context_new = create_ctx_with_session(); + let new_handle = context_new.tr_deserialize(data).unwrap().into(); assert_eq!( context.read_public(key_handle).unwrap(), - context.read_public(new_handle).unwrap() + context_new.read_public(new_handle).unwrap() ); } }