diff options
| author | Raymond Mao <[email protected]> | 2025-01-27 06:58:50 -0800 |
|---|---|---|
| committer | Ilias Apalodimas <[email protected]> | 2025-01-28 08:58:41 +0200 |
| commit | e7e166dabf129aae1fc57fe637ffc37d022ea45a (patch) | |
| tree | c3a6df8914f683965889a48ba1a38381f3b79d9e | |
| parent | d487c3283c83d1314f9736bdfc69391dbc347154 (diff) | |
tpm: PCR allocate during PCR extend to disable the unsupported algorithms
During PCR extend process, if any unsupported algorithms are active,
try to use PCR allocate to inactivate them.
Signed-off-by: Raymond Mao <[email protected]>
Acked-by: Ilias Apalodimas <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
| -rw-r--r-- | lib/tpm-v2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c index aa02a9e9611..9ca7933c094 100644 --- a/lib/tpm-v2.c +++ b/lib/tpm-v2.c @@ -344,7 +344,10 @@ u32 tpm2_pcr_extend(struct udevice *dev, u32 index, u32 algorithm, if (!tpm2_check_active_banks(dev)) { log_err("Cannot extend PCRs if all the TPM enabled algorithms are not supported\n"); - return -EINVAL; + + ret = tpm2_pcr_allocate(dev, 0); + if (ret) + return -EINVAL; } /* * Fill the command structure starting from the first buffer: |
