Skip to content

fix: return an error if C_GetFunctionList couldn't be found#345

Merged
wiktor-k merged 3 commits intoparallaxsecond:mainfrom
supervacuus:fix/error_on_missing_symbol
Jan 19, 2026
Merged

fix: return an error if C_GetFunctionList couldn't be found#345
wiktor-k merged 3 commits intoparallaxsecond:mainfrom
supervacuus:fix/error_on_missing_symbol

Conversation

@supervacuus
Copy link
Contributor

When a user provides an incorrect library during construction, the interface fallback on V2 would panic instead of returning an error: NLnetLabs/kmip2pkcs11#19

This PR

  • adds a new error variant (MissingSymbol), and
  • checks whether required symbol in the V2-fallback, C_GetFunctionList, actually exists in pkcs11_lib before calling it

Signed-off-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
@supervacuus supervacuus force-pushed the fix/error_on_missing_symbol branch from 843b005 to 46e0882 Compare January 18, 2026 20:44
wiktor-k
wiktor-k previously approved these changes Jan 19, 2026
Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very clean and straightforward 👌

@wiktor-k wiktor-k requested review from Jakuje and hug-dev January 19, 2026 12:22
Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Signed-off-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
Signed-off-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
Copy link
Collaborator

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! Thank you

@wiktor-k wiktor-k enabled auto-merge January 19, 2026 12:54
@wiktor-k wiktor-k merged commit f3e5af1 into parallaxsecond:main Jan 19, 2026
44 checks passed
@supervacuus supervacuus deleted the fix/error_on_missing_symbol branch January 20, 2026 10:16
ximon18 added a commit to NLnetLabs/kmip2pkcs11 that referenced this pull request Feb 16, 2026
…ryptoki#345 to avoid panicking on non-PKCS#11 module file as input. (fixes #19)
ximon18 added a commit to NLnetLabs/kmip2pkcs11 that referenced this pull request Feb 16, 2026
* Upgrade to cryptoki 0.12.0 to take upstream fix parallaxsecond/rust-cryptoki#345 to avoid panicking on non-PKCS#11 module file as input. (fixes #19)

* Fix failure to find SoftHSM when running the full test on Fedora 43.
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.

3 participants