Skip to content

Commit

Permalink
Use hex in CKM_VENDOR_DEFINED_...
Browse files Browse the repository at this point in the history
Use CKM_VENDOR_DEFINED_0x45 instdead of CKM_VENDOR_DEFINED_45 to
indicates the value is in hex.

The real value returned by the PKCS#11 lib is
CKM_VENDOR_DEFINED + 0x45 = 0x80000045
  • Loading branch information
LudovicRousseau committed Feb 24, 2020
1 parent da249de commit 0ba7678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyKCS11/__init__.py
Expand Up @@ -662,7 +662,7 @@ def getMechanismList(self, slot):
for x in range(len(mechanismList)):
mechanism = mechanismList[x]
if mechanism >= CKM_VENDOR_DEFINED:
k = 'CKM_VENDOR_DEFINED_%X' % (mechanism - CKM_VENDOR_DEFINED)
k = 'CKM_VENDOR_DEFINED_0x%X' % (mechanism - CKM_VENDOR_DEFINED)
CKM[k] = mechanism
CKM[mechanism] = k
m.append(CKM[mechanism])
Expand Down

0 comments on commit 0ba7678

Please sign in to comment.