Skip to content

Commit

Permalink
Merge pull request #327 from dgarske/sealing_fixes
Browse files Browse the repository at this point in the history
Fixes and improvements for secret sealing/unsealing
  • Loading branch information
lealem47 authored Feb 3, 2024
2 parents 0b3448c + c34a0c2 commit bc1415d
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 106 deletions.
9 changes: 8 additions & 1 deletion examples/boot/secret_unseal.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,14 @@ int TPM2_Boot_SecretUnseal_Example(void* userCtx, int argc, char *argv[])
goto exit;
}
printf("Loaded sealBlob to 0x%x\n", (word32)sealBlob.handle.hndl);
wolfTPM2_SetAuthHandle(&dev, 0, &sealBlob.handle);

/* use the policy session for unseal */
rc = wolfTPM2_SetAuthSession(&dev, 0, &tpmSession,
(TPMA_SESSION_decrypt | TPMA_SESSION_encrypt |
TPMA_SESSION_continueSession));
if (rc != 0) goto exit;
/* set the sealed object name 0 (required) */
wolfTPM2_SetAuthHandleName(&dev, 0, &sealBlob.handle);

/* unseal */
unsealIn.itemHandle = sealBlob.handle.hndl;
Expand Down
Loading

0 comments on commit bc1415d

Please sign in to comment.