Skip to content

Commit

Permalink
ESYS TEST: Check reference counting for Esys_TR_FromTPMPublic.
Browse files Browse the repository at this point in the history
The test esys-tr-fromTpmPublic-key is extended.
It is tested whether an esys object can be still used after
two calls of Esys_TR_FromTPMPublic and one Esys_Close for this object.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
  • Loading branch information
JuergenReppSIT authored and AndreasFuchsTPM committed Nov 29, 2023
1 parent f9ea4bf commit 9b8988a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/integration/esys-tr-fromTpmPublic-key.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,21 @@ test_esys_tr_fromTpmPublic_key(ESYS_CONTEXT * ectx)
goto_if_error(r, "Flushing primary", error_name1);

r = Esys_TR_Close(ectx, &keyHandle);
goto_if_error(r, "TR close on nv object", error_name1);
goto_if_error(r, "TR close on object", error_name1);

r = Esys_TR_FromTPMPublic(ectx, TPM2_PERSISTENT_FIRST,
ESYS_TR_NONE, ESYS_TR_NONE, ESYS_TR_NONE,
&keyHandle);
goto_if_error(r, "TR from TPM public", error_name1);

r = Esys_TR_FromTPMPublic(ectx, TPM2_PERSISTENT_FIRST,
ESYS_TR_NONE, ESYS_TR_NONE, ESYS_TR_NONE,
&keyHandle);
goto_if_error(r, "TR from TPM public", error_name1);

r = Esys_TR_Close(ectx, &keyHandle);
goto_if_error(r, "TR close on object", error_name1)

LOG_ERROR("Key handle (2) 0x%x", keyHandle);

r = Esys_TR_GetName(ectx, keyHandle, &name2);
Expand Down

0 comments on commit 9b8988a

Please sign in to comment.