Skip to content

Commit 9f98c22

Browse files
committed
Fixed building errors introduced with merge of parallaxsecond#280
- The parallaxsecond#280 was not rebased upon main and tested before merged which caused compile failure. This has been corrected in this commit. Signed-off-by: Jesper Brynolf <[email protected]>
1 parent 3fc1125 commit 9f98c22

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tss-esapi/src/context/tpm_commands/enhanced_authorization_ea_commands.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl Context {
407407
/// # let parent_name = object_name.clone();
408408
/// #
409409
/// context
410-
/// .policy_duplication_select(policy_session, object_name, parent_name, false)
410+
/// .policy_duplication_select(policy_session, &object_name, &parent_name, false)
411411
/// .expect("Policy command code");
412412
/// #
413413
/// # /// Digest of the policy that allows duplication
@@ -418,8 +418,8 @@ impl Context {
418418
pub fn policy_duplication_select(
419419
&mut self,
420420
policy_session: PolicySession,
421-
object_name: Name,
422-
new_parent_name: Name,
421+
object_name: &Name,
422+
new_parent_name: &Name,
423423
include_object: bool,
424424
) -> Result<()> {
425425
let ret = unsafe {
@@ -429,8 +429,8 @@ impl Context {
429429
self.optional_session_1(),
430430
self.optional_session_2(),
431431
self.optional_session_3(),
432-
&object_name.try_into()?,
433-
&new_parent_name.try_into()?,
432+
object_name.as_ref(),
433+
new_parent_name.as_ref(),
434434
if include_object { 1 } else { 0 },
435435
)
436436
};

tss-esapi/tests/integration_tests/context_tests/tpm_commands/duplication_commands_tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ mod test_duplicate {
103103
context
104104
.policy_duplication_select(
105105
policy_session,
106-
Vec::<u8>::new().try_into().unwrap(),
107-
parent_name.clone(),
106+
&Vec::<u8>::new().try_into().unwrap(),
107+
&parent_name,
108108
false,
109109
)
110110
.expect("Policy duplication select");
@@ -227,7 +227,7 @@ mod test_duplicate {
227227
// Even if object name is not included in the policy digest ("false" as 3rd paremeter)
228228
// Correct name needs to be set or the policy will fail.
229229
context
230-
.policy_duplication_select(policy_session, object_name, parent_name, false)
230+
.policy_duplication_select(policy_session, &object_name, &parent_name, false)
231231
.unwrap();
232232
context.set_sessions((Some(policy_auth_session), None, None));
233233

0 commit comments

Comments
 (0)