From 1b919a014a68a86580a5cc3619fbf9207e69c52b Mon Sep 17 00:00:00 2001 From: Jordan Hand Date: Mon, 3 Jun 2024 18:10:43 -0700 Subject: [PATCH] Move DeriveContext(recursive) returned handle to NEW_CONTEXT_HANDLE This aligns with the spec and is more consistent with all other commands. --- dpe/src/commands/derive_context.rs | 7 ++++--- verification/testing/deriveContext.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dpe/src/commands/derive_context.rs b/dpe/src/commands/derive_context.rs index c00b2f9e..9ca26996 100644 --- a/dpe/src/commands/derive_context.rs +++ b/dpe/src/commands/derive_context.rs @@ -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 { diff --git a/verification/testing/deriveContext.go b/verification/testing/deriveContext.go index 2d3eb554..e3e8df40 100644 --- a/verification/testing/deriveContext.go +++ b/verification/testing/deriveContext.go @@ -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 {