Skip to content

Add support for PKCS#11 3.2 validation objects #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Jakuje
Copy link
Collaborator

@Jakuje Jakuje commented Aug 18, 2025

The PKCS#11 3.2 introduces a way to query the session for the validation flags of the last operation. This is done with the new API C_GetSessionValidationFlags which is being exposed now also to the users of this crate.

It also defines the new attribute specifying if the given object is matching the requirements for the validation.

Last but not least there is new validation object exposing information about the validation itself.

There is currenly almost no coverage for these, as this is implemented only by kryoptic (as far as I know) and not enabled in the default build we are using in CI.

Opening as draft as it depends on some fixes in kryoptic (latchset/kryoptic#315) as well its based on other code changes here (#304).

Jakuje added 11 commits August 18, 2025 18:39
Signed-off-by: Jakub Jelen <[email protected]>
error: hiding a lifetime that's elided elsewhere is confusing
   --> cryptoki/src/session/object_management.rs:227:25
    |
227 |     pub fn iter_objects(&self, template: &[Attribute]) -> Result<ObjectHandleIterator> {
    |                         ^^^^^ the lifetime is elided here        -------------------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: use `'_` for type paths
    |
227 |     pub fn iter_objects(&self, template: &[Attribute]) -> Result<ObjectHandleIterator<'_>> {
    |                                                                                      ++++

Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
@Jakuje Jakuje force-pushed the pkcs11-3.2-validation branch from de1c46f to 5ad9e90 Compare August 18, 2025 16:40
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.

1 participant