Skip to content

Add CKO_MECHANISM objects and add CKA_UNIQUE_ID to all objects#421

Open
simo5 wants to merge 3 commits intolatchset:mainfrom
simo5:cko_mech
Open

Add CKO_MECHANISM objects and add CKA_UNIQUE_ID to all objects#421
simo5 wants to merge 3 commits intolatchset:mainfrom
simo5:cko_mech

Conversation

@simo5
Copy link
Member

@simo5 simo5 commented Feb 12, 2026

Description

Add CKA_UNIQUE_ID to all objects, for builtin objects add a stable id so it is always the same on each run
Add CKO_MECHANISM objects, this is not super useful today yet, but come 3.3 it will be the way to discover which parameter sets each mechanism can handle.

Fixes: #417
Fixes: #420

Checklist

  • Test suite updated
  • Rustdoc string were added or updated
  • CHANGELOG and/or other documentation added or updated
  • This is not a code change

Reviewer's checklist:

  • Any issues marked for closing are fully addressed
  • There is a test suite reasonably covering new functionality or modifications
  • This feature/change has adequate documentation added
  • A changelog entry is added if the change is significant
  • Code conform to coding style that today cannot yet be enforced via the check style test
  • Commits have short titles and sensible text
  • Doc string are properly updated

@simo5 simo5 requested a review from Jakuje February 12, 2026 23:46
@simo5 simo5 force-pushed the cko_mech branch 2 times, most recently from 2df2cc2 to 269817f Compare February 13, 2026 15:15
simo5 and others added 2 commits February 13, 2026 10:15
Enable the `v8` feature in the `uuid` crate to support custom UUID generation.
Add a new `generate_stable_unique` method to the Object struct that creates
deterministic IDs based on the object class and a provided value. Update FIPS
validation and profile object creation to use this method for consistent
identification.

Co-authored-by: Gemini <gemini@google.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
Generate CKO_MECHANISM objects for each supported mechanism during token
initialization. This allows applications to query for supported mechanisms
using the object search API.

Update the object search filter to treat CKO_MECHANISM and CKO_VALIDATION as
built-in types to ensure they are discoverable. Include a test case verifying
the existence and attributes of these new objects.

Co-authored-by: Gemini <gemini@google.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
@simo5 simo5 force-pushed the cko_mech branch 2 times, most recently from 1bc4be7 to ac1fd9c Compare February 14, 2026 02:28
Add a `class` field to the `Object` struct and update `Object::new()`
to require the object class as an argument. This allows accessing the
class without searching the attribute vector.

Update all `ObjectFactory` implementations to store the associated
class type upon initialization. Update storage backends to initialize
objects with `CK_UNAVAILABLE_INFORMATION` until the class attribute
is read.

Refactor `is_sensitive()` and `is_extractable()` to rely on the
stored class for default behaviors, simplifying the logic for
internal objects.

Signed-off-by: Simo Sorce <simo@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CKA_UNIQUE_ID to all objects, including non storage object generated on startup Add support for CKO_MECHANISM objects

1 participant