Add mechanisms CKM_SHA512_224, CKM_SHA512_224_HMAC, CKM_SHA512_224_HMAC_GENERAL
CKM_SHA512_256, CKM_SHA512_256_HMAC, and CKM_SHA512_256_HMAC_GENERAL
to common code and the EP11 token.
Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
Add mechanisms CKM_SHA224_KEY_DERIVATION, CKM_SHA384_KEY_DERIVATION,
and CKM_SHA512_KEY_DERIVATION to common code and EP11.
Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
Add mechanisms CKM_SHA224, CKM_SHA224_HMAC, and CKM_SHA224_HMAC_GENERAL
to common code, the CCA token, and the EP11 token.
Note that some SHA-2 related defines in defs.h need to be changed
to avoid a name clash. Defines for SHA-256 are named SHA2_xxx, defines
for SHA-384 are named SHA3_xxx and defines for SHA-512 are named
SHA5_xxx. The names of those defines are changed for 2 reasons:
1.) How would the defines for SHA-224 by named? SHA2_xxx is misleading here.
2.) There is already a SHA-3. So SHA3_xxx is misleading as well.
The defines are changed to SHA256_xxx, SHA384_xxx, and SHA512_xxx.
Also new defines for SHA224_xxx are added.
This change requires changes in several files where these defines are used.
Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
PKCS#11 v2.20 defines two macros (CK_TRUE and CK_FALSE) for use with
values of type CK_BBOOL. For backwards compatibility, we keep defining
TRUE and FALSE and CK_DISABLE_TRUE_VENDOR which may be set by the
application vendor.
Fix#23.
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
The PKCS#11 standard requires the CKA_ALWAYS_AUTHENTICATE attribute
to be present in private key objects. Actually this attribute is not
set as one of the default attributes. Further, it will be rejected
when it's declared within the application defined key template.
This fix will add the CKA_ALWAYS_AUTHENTICATE attribute by default
to any private key object. The value is set to 'false'. The calling
application is free to overrule by setting the attribute value
within the key template to 'true'.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Increase the number of tokens that can be plugged to opencryptoki.
The new maximum number is set to 1024.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the token specific shared memory data with respect to the
newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the FindObject functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the GetAttributeValue function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the btree management with respect to the newly introduced
token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the destroy object helper function with respect to
the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Extend the helper functions to initialize, load, save and delete
token data with respect to the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the GetMechanismInfo function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt digest related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the create object helper function and object management functions
with respect to the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt sign related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt verify related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt decrypt related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt encrypt related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt random related cryptographic functions with respect to the
newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt key generate related cryptographic functions with respect to
the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt derive related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt wrap related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt unwrap related cryptographic functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the get object size helper function with respect to
the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the copy object helper function with respect to
the newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt WaitSlotEvent function with respect to the newly introduced
token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt GetFunctionStatus and CancelFunction with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the SetAttributeValue function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the GetSessionInfo function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the Get-/SetOperationState functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the CloseSession function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the OpenSession function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the GetMechanismList function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the Logout function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the Login function with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the SetPin function with respect to the newly introduced
token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Adapt the InitPIN functions with respect to the newly
introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Extend the existing initialize functionality with respect to the
multi token support and thus newly introduced token data storage.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Introduce a new data structure that contains token specific information
that refers to an individual single token instance. Áll the local data
from within the shared token library are moved to this location.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Add new config option 'tokname' to setup an individual token
directory for each token instance.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Slightly adapted version of Ingo's patch:
Patch hunks needed relocation because of previous commits
in some files. Removed some trailing whitespaces.
Tested, works.
Signed-off-by: Ingo Franzki <ifranzki@de.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>