keymgmt: fetch CKA_ALLOWED_MECHANISMS on-demand for RSA-PSS type detection - #764
Closed
creatica-soft wants to merge 1 commit into
Closed
keymgmt: fetch CKA_ALLOWED_MECHANISMS on-demand for RSA-PSS type detection#764creatica-soft wants to merge 1 commit into
creatica-soft wants to merge 1 commit into
Conversation
Add the `SUPPORT_SLH_DSA` variable to test initialization scripts and update `setup.sh` to generate an SLH-DSA key pair when supported. Introduce the `tslhdsa` script and update `tgenkey.c` and `tdemoca` to verify SLH-DSA operations (key generation, CSR creation, and signatures) with compatible PKCS#11 tokens. Additionally, this fixes a copy-paste bug in `tdemoca` where the ML-DSA CSR generation incorrectly used the ED25519 key URI. Assisted-by: Gemini:Gemini Pro Latest Signed-off-by: Simo Sorce <simo@redhat.com>
creatica-soft
force-pushed
the
fix/rsa-pss-load-allowed-mechs
branch
from
August 8, 2026 11:47
a712437 to
d2bbeb5
Compare
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.
When an RSA key is loaded from the token (via OSSL_STORE), the CKA_ALLOWED_MECHANISMS attribute is not included in the fetch template. p11prov_obj_is_rsa_pss() then returns false for every loaded key — the encoder emits rsaEncryption instead of id-RSASSA-PSS in SubjectPublicKeyInfo.
The problem
The fix
Add a helper get_or_fetch_allowed_mechs() to p11prov_obj_is_rsa_pss() that:
Testing
Tested with SoftHSM (post-2.7.0 main branch) and p11-kit 0.26.4 on Alpine 3.24. The patch restores correct RSA-PSS SPKI encoding for loaded keys — verified via the FastPKI integration suite where previously a PSS-restricted OCSP responder key had its certificate SPKI incorrectly reported as rsaEncryption.