From 89aa8463cdf3919ca4f04fc24ec8b154ff56d97e Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Sat, 25 May 2024 13:00:49 -0700 Subject: tpm-v2: allow algorithm name to be configured for pcr_read and pcr_extend For pcr_read and pcr_extend commands allow the digest algorithm to be specified by an additional argument. If not specified it will default to SHA256 for backwards compatibility. Additionally update test_tpm2.py for the changes in output in pcr_read which now shows the algo and algo length in the output. A follow-on to this could be to extend all PCR banks with the detected algo when the argument is 'auto'. Signed-off-by: Tim Harvey Reviewed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas --- test/py/tests/test_tpm2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py index 1d654cd4a23..75f5d31fc67 100644 --- a/test/py/tests/test_tpm2.py +++ b/test/py/tests/test_tpm2.py @@ -257,7 +257,7 @@ def test_tpm2_pcr_read(u_boot_console): updates = int(re.findall(r'\d+', str)[0]) # Check the output value - assert 'PCR #10 content' in read_pcr + assert 'PCR #10 sha256 32 byte content' in read_pcr assert '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' in read_pcr @pytest.mark.buildconfigspec('cmd_tpm_v2') -- cgit v1.2.3