Fixes to keyload_paramenc, unloading of handles

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
pull/129/head
Dimitar Tomov 2020-11-19 15:23:33 +02:00
parent 191412f86b
commit 701359a7dc
1 changed files with 6 additions and 0 deletions

View File

@ -169,8 +169,14 @@ exit:
printf("\nFailure 0x%x: %s\n\n", rc, wolfTPM2_GetRCString(rc));
}
/* Close session */
if (tpmSession.handle.hndl != TPM_RH_NULL) {
wolfTPM2_UnloadHandle(&dev, &tpmSession.handle);
}
/* Close key handles */
wolfTPM2_UnloadHandle(&dev, &newKey.handle);
wolfTPM2_UnloadHandle(&dev, &storage.handle);
wolfTPM2_Cleanup(&dev);
return rc;