Skip to content

Conversation

@jrripple
Copy link

@jrripple jrripple commented Jun 5, 2025

When a key is retrieved it can return CK_UNAVAILABLE_INFORMATION for some of its properties. The CK_UNAVAILABLE_INFORMATION value is set to ~0UL or the largest int possible on a system. The python-pkcs11 library would then try to create a buffer of that size and crash.

This commit adds error checking to make sure when
CK_UNAVAILABLE_INFORMATION is returned that the property value is set to blank and returned immediately.

When a key is retrieved it can retrun CK_UNAVAILABLE_INFORMATION for
some of its properties. The CK_UNAVAILABLE_INFORMATION value is set to
~0UL or the largest int possible on a system. The python-pkcs11 library
would then try to create a buffer of that size and crash.

This commit adds error checking to make sure when
CK_UNAVAILABLE_INFORMATION is returned that the property value is set to
blank and returned immediately.
@jrripple
Copy link
Author

jrripple commented Jun 5, 2025

Closing this since @minego did it better in #200

@jrripple jrripple closed this Jun 5, 2025
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