You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library does not support creation of keys of type CKK_GENERIC_SECRET.
there is no default mechanism set for KeyType.GENERIC_SECRET, it should be Mechanism.GENERIC_SECRET_KEY_GEN
the library does not handle properly CKA_VALUE_LEN attribute: it is only set for AES keys. It result in a CKR_TEMPLATE_INCOMPLETE error for other key types (exept those where a key value length is not needed, such as DES).
The first problem is illustrated by the following excerpt:
Traceback (most recent call last):
File "pkcs11/_pkcs11.pyx", line 98, in pkcs11._pkcs11.MechanismWithParam.__init__
KeyError: <KeyType.GENERIC_SECRET>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/home/eric/stage/./test.py", line 117, in <module>
generate_p11perftest_keys(args.library, args.slotindex, args.password, not args.noop)
File "/usr/home/eric/stage/./test.py", line 27, in generate_p11perftest_keys
des1 = session.generate_key( KeyType.GENERIC_SECRET,
File "pkcs11/_pkcs11.pyx", line 382, in pkcs11._pkcs11.Session.generate_key
File "pkcs11/_pkcs11.pyx", line 100, in pkcs11._pkcs11.MechanismWithParam.__init__
pkcs11.exceptions.ArgumentsBad: No default mechanism for this key type. Please specify `mechanism`.
the second problem is illustrated by the following excerpt (once a mechanism has been set explicitely to clear the first issue):
Traceback (most recent call last):
File "/usr/home/eric/stage/./test.py", line 117, in <module>
generate_p11perftest_keys(args.library, args.slotindex, args.password, not args.noop)
File "/usr/home/eric/stage/./test.py", line 27, in generate_p11perftest_keys
des1 = session.generate_key( KeyType.GENERIC_SECRET,
File "stringsource", line 415, in View.MemoryView.memoryview.__getitem__
File "pkcs11/_errors.pyx", line 88, in pkcs11._pkcs11.assertRV
pkcs11.exceptions.TemplateIncomplete
The text was updated successfully, but these errors were encountered:
keldonin
added a commit
to keldonin/python-pkcs11
that referenced
this issue
Sep 7, 2022
- Adding a default mechanism for `CKK_GENERIC_SECRET` key type
- Fixing condition for including `CKA_VALUE_LEN` when generating a secret key. It is now skipped only for those algorithms that do not want it.
The library does not support creation of keys of type
CKK_GENERIC_SECRET
.KeyType.GENERIC_SECRET
, it should beMechanism.GENERIC_SECRET_KEY_GEN
CKA_VALUE_LEN
attribute: it is only set for AES keys. It result in aCKR_TEMPLATE_INCOMPLETE
error for other key types (exept those where a key value length is not needed, such as DES).The first problem is illustrated by the following excerpt:
the second problem is illustrated by the following excerpt (once a mechanism has been set explicitely to clear the first issue):
The text was updated successfully, but these errors were encountered: