rust-cryptoki icon indicating copy to clipboard operation
rust-cryptoki copied to clipboard

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

Open arjennienhuis opened this issue 2 years ago • 1 comments

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

  • http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html
  • http://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/pkcs11-base-v3.0.html

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.

arjennienhuis avatar Jun 21 '23 12:06 arjennienhuis

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..

ionut-arm avatar Nov 25 '23 16:11 ionut-arm