1
0
mirror of https://github.com/opencryptoki/opencryptoki.git synced 2026-10-24 05:39:17 +03:00

96 Commits

Author SHA1 Message Date
Ingo Franzki
6ace3eef1d Add some vendor defined attributes
Add the following vendor (IBM) defined attributes: CKA_IBM_RESTRICTABLE,
CKA_IBM_NEVER_MODIFIABLE, CKA_IBM_RETAINKEY, CKA_IBM_ATTRBOUND,
CKA_IBM_KEYTYPE, CKA_IBM_CV, CKA_IBM_MACKEY, CKA_IBM_USE_AS_DATA,
CKA_IBM_STRUCT_PARAMS, and CKA_IBM_STD_COMPLIANCE1

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2018-01-31 10:20:07 -02:00
Ingo Franzki
25455537fa Add SHA512_224/256 mechanisms to common code and EP11 token
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>
2018-01-31 10:20:07 -02:00
Ingo Franzki
e4e77e5eff Add SHA-2 based key derivation mechanisms to common code and EP11
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>
2018-01-31 10:20:07 -02:00
Ingo Franzki
099c8f8fd3 Add SHA224_RSA_PKCS_PSS mechanism to common code and EP11 token
Add mechanisms CKM_SHA224_RSA_PKCS_PSS to common code, and the EP11 token.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2018-01-31 10:20:07 -02:00
Ingo Franzki
9eef2136a0 Add SHA224_RSA_PKCS mechanism to common code and EP11 token
Add mechanisms CKM_SHA224_RSA_PKCS to common code, and the EP11 token.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2018-01-31 10:20:07 -02:00
Ingo Franzki
98ee8e868d Add ECDSA_SHA224 mechanism to common code, CCA and EP11 tokens
Add mechanisms CKM_ECDSA_SHA224 to common code, the CCA token,
and the EP11 token.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2018-01-31 10:20:07 -02:00
Ingo Franzki
80304ceb9e Add SHA224 mechanisms to common code, CCA and EP11 tokens
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>
2018-01-31 10:20:07 -02:00
Eduardo Barretto
30fbe64352 Define CK_FALSE and CK_TRUE macros
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>
2017-12-21 15:14:18 -02:00
Eduardo Barretto
90b2b52915 Remove unnecessary executable permission
Some files had a legacy executable permission that in not necessary. So, removed
it.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-31 15:57:12 -02:00
Ingo Tuchscherer
8d0b563658 Fix CKA_ALWAYS_AUTHENTICATE attribute for priv. keys
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>
2017-10-17 13:55:39 -02:00
Ingo Tuchscherer
d6619af8ee MTI [PATCH 85/85]: Increase token number limit
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
415ab181f3 MTI [PATCH 74/85]: Adapt shared memory data
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
d256ec2461 MTI [PATCH 72/85]: Adapt FindObject
Adapt the FindObject functions with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
29089cd62b MTI [PATCH 70/85]: Adapt GetAttributeValue
Adapt the GetAttributeValue function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
b2a06d199c MTI [PATCH 68/85]: Adapt btree management
Adapt the btree management with respect to the newly introduced
token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
65b27069f4 MTI [PATCH 61/85]: Adapt object destroy
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
b096edeb22 MTI [PATCH 59/85]: Manage token data
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
d08a410701 MTI [PATCH 58/85]: Adapt GetMechanismInfo
Adapt the GetMechanismInfo function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
d9b1946b01 MTI [PATCH 53/85]: Adapt digest crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
342ab61db4 MTI [PATCH 32/85]: Adapt object create and object management
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
a63a9cd7da MTI [PATCH 30/85]: Adapt sign crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
e89dd05e0a MTI [PATCH 29/85]: Adapt verify crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
afb10772bc MTI [PATCH 27/85]: Adapt decrypt crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
a81258ec6a MTI [PATCH 26/85]: Adapt encrypt crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
c33cb0cc6e MTI [PATCH 25/85]: Adapt random crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
e48af0293e MTI [PATCH 24/85]: Adapt keygen crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
7b0604968a MTI [PATCH 23/85]: Adapt derive crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
da1946d1db MTI [PATCH 22/85]: Adapt wrap crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
b8e42494cc MTI [PATCH 21/85]: Adapt unwrap crypto functions
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
37b0e6047b MTI [PATCH 20/85]: Adapt get object size
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
01570ad29f MTI [PATCH 19/85]: Adapt object copy
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
123322b78f MTI [PATCH 17/85]: Adapt WaitSlotEvent
Adapt WaitSlotEvent function with respect to the newly introduced
token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
bb79a79c7b MTI [PATCH 16/85]: Adapt GetFunctionState, CancelFunction
Adapt GetFunctionStatus and CancelFunction with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
95eea85136 MTI [PATCH 15/85]: Adapt SetAttributeValue
Adapt the SetAttributeValue function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
c148c43d49 MTI [PATCH 14/85]: Adapt GetSessionInfo
Adapt the GetSessionInfo function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
30a9902551 MTI [PATCH 13/85]: Adapt Get-/SetOperationState
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
73ee83438f MTI [PATCH 12/85]: Adapt CloseSession
Adapt the CloseSession function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
7f01da10f7 MTI [PATCH 11/85]: Adapt OpenSession
Adapt the OpenSession function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
6c3a0d4a0a MTI [PATCH 10/85]: Adapt GetMechanismList
Adapt the GetMechanismList function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
a6d366029a MTI [PATCH 08/85]: Adapt Logout
Adapt the Logout function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
d4efe7f537 MTI [PATCH 07/85]: Adapt Login
Adapt the Login function with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
b992dd4f6f MTI [PATCH 06/85]: Adapt SetPIN
Adapt the SetPin function with respect to the newly introduced
token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
0726a2fa59 MTI [PATCH 05/85]: Adapt InitPIN
Adapt the InitPIN functions with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
39a7685295 MTI [PATCH 04/85]: Initialize token
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
dd1b9ebb6a MTI [PATCH 03/85]: Introduce token data structure
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>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
5dfadcdea2 MTI [PATCH 01/85]: add config option 'tokname'
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>
2017-10-06 15:39:43 -03:00
Ingo Franzki
d509a33528 ep11 token, cca token: Add ECDSA SHA2 support
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>
2017-04-05 13:33:48 -03:00
Paulo Vital
25a05a8209 Remove unecessary CVS header content
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-03-15 16:37:46 -03:00
Paulo Vital
d0874c2fc1 Update license header of source code files to CPL-1.0
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-03-15 16:37:46 -03:00
Vineetha Pai
3f12ca3538 Fix few more compiler warnings
Signed-off-by: Vineetha Pai <vpishar@us.ibm.com>
2016-04-22 16:00:32 -04:00