diff --git a/tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs b/tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs index df3ec158..f0ac916b 100644 --- a/tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs +++ b/tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs @@ -407,7 +407,7 @@ impl Context { /// # let parent_name = object_name.clone(); /// # /// context - /// .policy_duplication_select(policy_session, object_name, parent_name, false) + /// .policy_duplication_select(policy_session, &object_name, &parent_name, false) /// .expect("Policy command code"); /// # /// # /// Digest of the policy that allows duplication @@ -418,8 +418,8 @@ impl Context { pub fn policy_duplication_select( &mut self, policy_session: PolicySession, - object_name: Name, - new_parent_name: Name, + object_name: &Name, + new_parent_name: &Name, include_object: bool, ) -> Result<()> { let ret = unsafe { @@ -429,8 +429,8 @@ impl Context { self.optional_session_1(), self.optional_session_2(), self.optional_session_3(), - &object_name.try_into()?, - &new_parent_name.try_into()?, + object_name.as_ref(), + new_parent_name.as_ref(), if include_object { 1 } else { 0 }, ) }; diff --git a/tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs b/tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs index f2a860b6..a3ecbcf3 100644 --- a/tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs +++ b/tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs @@ -103,8 +103,8 @@ mod test_duplicate { context .policy_duplication_select( policy_session, - Vec::::new().try_into().unwrap(), - parent_name.clone(), + &Vec::::new().try_into().unwrap(), + &parent_name, false, ) .expect("Policy duplication select"); @@ -227,7 +227,7 @@ mod test_duplicate { // Even if object name is not included in the policy digest ("false" as 3rd paremeter) // Correct name needs to be set or the policy will fail. context - .policy_duplication_select(policy_session, object_name, parent_name, false) + .policy_duplication_select(policy_session, &object_name, &parent_name, false) .unwrap(); context.set_sessions((Some(policy_auth_session), None, None));