Skip to content

Commit

Permalink
tpm2_getmanufec: only attempt to persist the EK if a handle was provided
Browse files Browse the repository at this point in the history
The tool has a -H option to provide a persistent handle to store a EK, but
currently is trying to do it even if no handle was provided.

Make it fail early if that's the case since there's no point in attempting
an operation that will fail.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
  • Loading branch information
martinezjavier authored and William Roberts committed Sep 21, 2017
1 parent 4e4b372 commit a3d6df6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/tpm2_getmanufec.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ int createEKHandle(TSS2_SYS_CONTEXT *sapi_context)
LOG_INFO("EK create succ.. Handle: 0x%8.8x", handle2048ek);

if (!ctx.non_persistent_read) {

if (!ctx.persistent_handle) {
LOG_ERR("Persistent handle for EK was not provided");
return 1;
}

/*
* To make EK persistent, use own auth
*/
Expand Down

0 comments on commit a3d6df6

Please sign in to comment.