google / pkcs11test

PKCS#11 Test Suite
Apache License 2.0
75 stars 51 forks source link

VENDOR_DEFINED values are not processed correctly #64

Closed Hlipa closed 1 year ago

Hlipa commented 2 years ago

All vendor defined values like CKM_VENDOR_DEFINED are minimal not exact value. Standard says:

[Mechanism types CKM_VENDOR_DEFINED and above are permanently reserved for token vendors.]

but in mechanism_type_name() we can see:

case CKR_VENDOR_DEFINED: return "CKR_VENDOR_DEFINED";

instead of:

if (val >= CKM_VENDOR_DEFINED) return "CKM_VENDOR_DEFINED";

It finally leads to situation when function returns "UNKNOWN" instead of "CKM_VENDOR_DEFINED" string.

daviddrysdale commented 2 years ago

Well spotted – could you send a PR?

Hlipa commented 2 years ago

yes, will do.

bharsaklemukesh975 commented 1 year ago

Hi, if it is still open. can I work on this as my first contribution to open source?

daviddrysdale commented 1 year ago

Sure, sounds good to me – thanks.

daviddrysdale commented 1 year ago

Fixed by #71