parallaxsecond / rust-cryptoki

Rust wrapper for the PKCS #11 API, Cryptoki
https://docs.rs/cryptoki/
Apache License 2.0
77 stars 61 forks source link

bug: `is_fn_supported()` always returns `true` #155

Open arjennienhuis opened 1 year ago

arjennienhuis commented 1 year ago

is_fn_supported() returns true for all libraries and functions I tested with. This makes sense when reading the spec:

Both say:

Every function in the Cryptoki API MUST have an entry point defined in the Cryptoki library’s CK_FUNCTION_LIST structure. If a particular function in the Cryptoki API is not supported by a library, then the function pointer for that function in the library’s CK_FUNCTION_LIST structure should point to a function stub which simply returns CKR_FUNCTION_NOT_SUPPORTED.

ionut-arm commented 1 year ago

Somewhat late on this one, but given how many implementations treat compliance with the spec merely as a "nice to have", it's probably safer to keep the check..

hug-dev commented 1 week ago

Is it a bug if it makes sense with the spec?