Split registrations - #763
Open
simo5 wants to merge 3 commits into
Open
Conversation
simo5
force-pushed
the
split_registration
branch
from
August 7, 2026 22:36
d4e5018 to
c79e526
Compare
Move the algorithm registration logic from a single, large switch statement in `provider.c` to individual module files (ciphers, digests, signatures, etc.). A new `registration.c` file is introduced to map PKCS#11 mechanisms to internal table IDs, allowing each module to independently evaluate and register its supported algorithms. This significantly improves code maintainability, decouples algorithm implementations from the core provider initialization, and makes adding future algorithms much cleaner. Assisted-by: Gemini:Gemini Pro Latest Signed-off-by: Simo Sorce <simo@redhat.com>
Move the initialization mutex from the module context to the provider context and introduce a new `P11PROV_OPS_NEEDS_INIT` state. By handling the lock at the context level, both module and operations initialization are now executed within a single locked section. This reduces lock toggling, optimizes initialization, and prevents race conditions when multiple threads attempt to initialize the provider simultaneously. Assisted-by: Gemini:Gemini Pro Latest Signed-off-by: Simo Sorce <simo@redhat.com>
Register DER decoders for post-quantum algorithms including ML-DSA, ML-KEM, and SLH-DSA variants. This enables the PKCS#11 provider to properly decode and load these keys. Additionally, add tests for ML-DSA, ML-KEM, and SLH-DSA to `tpem_encoder` to verify their PEM encoding and decoding functionality.
simo5
force-pushed
the
split_registration
branch
from
August 7, 2026 22:53
c79e526 to
f60231f
Compare
Collaborator
Author
|
@Jakuje sorry for the huge PR, but in my defense, you opened the bug and asked for it :-D |
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.
Description
Refactor the central operations registration process and split each operation registration into its own operation file.
Additionally fix a locking issue that came up from a Gemini review, and add missing decoders for PQC key types.
Fixes #759
Checklist
Reviewer's checklist: