mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-27 22:32:31 +02:00
ima-evm-utils: treat unallocated banks as an error
The TPM spec differentiates between an unknown bank and an unallocated bank. In terms of re-calculating the PCR, treat them as equivalent. Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
9c2298c367
commit
dc3897f011
@ -1449,6 +1449,11 @@ static int tpm2_pcr_read(int idx, uint8_t *hwpcr, int len, char **errmsg)
|
||||
|
||||
/* get the popen "cmd" return code */
|
||||
ret = pclose(fp);
|
||||
|
||||
/* Treat an unallocated bank as an error */
|
||||
if (!ret && (strlen(pcr) < SHA_DIGEST_LENGTH))
|
||||
ret = -1;
|
||||
|
||||
if (!ret)
|
||||
hex2bin(hwpcr, pcr, SHA_DIGEST_LENGTH);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user