Skip to content

Commit

Permalink
Move DeriveContext(recursive) returned handle to NEW_CONTEXT_HANDLE
Browse files Browse the repository at this point in the history
This aligns with the spec and is more consistent with all other
commands.
  • Loading branch information
jhand2 committed Jun 4, 2024
1 parent 3d9092d commit 3791c34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dpe/src/commands/derive_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,11 @@ impl CommandExecution for DeriveContextCmd {
..tmp_context
};

// No child context created so handle is unmeaningful
// Return new handle in new_context_handle
Ok(Response::DeriveContext(DeriveContextResp {
handle: ContextHandle::default(),
parent_handle: dpe.contexts[parent_idx].handle,
handle: dpe.contexts[parent_idx].handle,
// Should be ignored since retain_parent cannot be true
parent_handle: ContextHandle::default(),
resp_hdr: ResponseHdr::new(DpeErrorCode::NoError),
}))
} else {
Expand Down
2 changes: 1 addition & 1 deletion verification/testing/deriveContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func TestDeriveContextRecursiveOnDerivedContexts(d client.TestDPEInstance, c cli
if err != nil {
t.Fatalf("[FATAL]: Could not set TCI value: %v", err)
}
childHandle = &resp.ParentContextHandle
childHandle = &resp.NewContextHandle

childHandle, childTcbInfo, err = getTcbInfoForHandle(c, childHandle)
if err != nil {
Expand Down

0 comments on commit 3791c34

Please sign in to comment.