Bug 2325522 - tpm2: use first PCR algorithm bank supported by TPM as default
Summary: tpm2: use first PCR algorithm bank supported by TPM as default
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: clevis
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Sergio Arroutbi
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/latchset/clevis/pu...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-11-12 15:34 UTC by Sergio Arroutbi
Modified: 2026-05-06 12:53 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
: 2325524 2325528 (view as bug list)
Environment:
Last Closed: 2026-05-06 12:53:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sergio Arroutbi 2024-11-12 15:34:29 UTC
The default PCR bank for TPM2 is sha1, which is not always supported (it is legacy and optional for implementation). Make this more future-proof and use the first bank with non-empty set of PCRs, which is returned from TPM by tpm2_getcap pcrs.
The swtpm by default does not create sha1 bank, so this fixes usage with swtpm.

Reproducible: Always

Steps to Reproduce:
1.Configure TPM2 bank without sha1
2.Try configuring clevis without specifying bank
3.Check error:
# echo foo | clevis encrypt tpm2 '{"pcr_ids": "7"}' | clevis decrypt
Unable to validate combination of PCR bank 'sha1' and PCR IDs '7'.

Actual Results:  

# echo foo | clevis encrypt tpm2 '{"pcr_ids": "7"}' | clevis decrypt
Unable to validate combination of PCR bank 'sha1' and PCR IDs '7'.



Expected Results:  
Encryption/Decryption should be performed correctly independently of the bank:
# echo foo | clevis encrypt tpm2 '{"pcr_ids": "7"}' | clevis decrypt
foo

Comment 1 Aoife Moloney 2025-02-26 13:16:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 2 Fedora Release Engineering 2026-05-06 11:58:36 UTC
This message is a reminder that Fedora Linux 42 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '42'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 42 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Sergio Arroutbi 2026-05-06 12:53:02 UTC
Resolved in commit:

commit a6e28a0662a52dc2d4fa0d546b69298b26bdd2d4
Author: Sergio Arroutbi <sarroutb>
Date:   Tue Nov 12 16:55:01 2024 +0100

    tpm2: use first PCR algorithm bank supported
    
    Resolves: rhbz#2325522
    
    Signed-off-by: Sergio Arroutbi <sarroutb>


Note You need to log in before you can comment on or make changes to this bug.