[2] [WIP] Certify TPM-created EdDSA keys - #1135
Draft
stefanberger wants to merge 13 commits into
Draft
stefanberger wants to merge 13 commits into
stefanberger wants to merge 13 commits into
Conversation
Add a regular expression parser that can parse the following type of string passed as description of a public key: pubkey=65ac32,algo=ml-kem-1024 If parsing it succeeds, then build the command line parameter for swtpm_cert with the extracted parameters, otherwise fall back to trying to parse for EC and RSA keys. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Extend the EK parameters table with parameters for an ML-KEM primary key and implement functions for creating an ML-KEM primary key and also an ML-KEM storage primary key (SPK). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Extend the EK key algo table with options for ML-KEM keys as 1st and 2nd EK keys. Since we are now depending on libtpms v0.11 with ML-KEM support, it may not be necessary to test whether the key types are supported. The user has to choose a profile that supports the requested key type, though. A user currently has to used the 'default-v2' or a custom profile where ML-KEM keys are enabled. Print an error if IAK and IDevID keys are supposed to be ML-KEM keys. Mention the new key algorithms in the the man pages for swtpm_setup.conf and swtpm_setup. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Extend the EK, IAK, and IDevID tables with parameters for an ML-DSA primary key and implement functions for creating an ML-DSA primary key. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Extend the EK key algo table with options for ML-DSA keys as 1st and 2nd EK keys. Since we are now depending on libtpms v0.11 with ML-DSA support, it may not be necessary to test whether the key types are supported. The user has to choose a profile that supports the requested key type, though. A user currently has to use the 'default-v2' or a custom profile where ML-KEM keys are enabled. Mention the new key algorithms in the the man pages for swtpm_setup.conf and swtpm_setup. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Run TPM2_GetCapability(TPM_PROPERTIES) to query the TPM 2 for the maximum NV buffer size that can be used for writing data to an NV space. With the larger certificates it now makes sense to query when the number of bytes to write is beyond 1kb. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Display the the type of storage primary key that was created and mention in the help screen and man page that an ML-KEM key will be used instead of a ML-DSA key. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
…setup Add some test case for having swtpm_setup create ML-KEM and ML-DSA EK keys. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Extend the test that is checking created EK certificates to now also create ML-KEM and ML-DSA certificates. Don't try to use use tpm2_createek with these key algorithms, since they are not supported by the tool, yet. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add a test case that starts the TPM 2 with the default-v2 profile which enables ML-KEM and ML-DSA and check that the TPM 2 cannot be initialized when the buffer size is set to 5kb and that it can be initialized once the buffer size is at 8kb. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
stefanberger
marked this pull request as draft
June 4, 2026 15:07
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.