mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-10 07:08:22 +00:00
tpm2: NVRAM file does exist if we get TPM_DECRYPT_ERROR
In case the NVRAM file cannot be decrypted we get a TPM_DECRYPT_ERROR error which also indicates that the file exists. So do not return FALSE in this case, which would delete the existing file and start over with a blank file. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
8fb8816c3c
commit
63f70197c8
@ -80,7 +80,7 @@ TPM_BOOL _TPM2_CheckNVRAMFileExists(void)
|
||||
if (cbs->tpm_nvram_loaddata) {
|
||||
ret = cbs->tpm_nvram_loaddata(&data, &length, tpm_number, name);
|
||||
TPM_Free(data);
|
||||
if (ret == TPM_SUCCESS)
|
||||
if (ret == TPM_SUCCESS || ret == TPM_DECRYPT_ERROR)
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* TPM_LIBTPMS_CALLBACKS */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user