1
0
mirror of https://github.com/opencryptoki/opencryptoki.git synced 2026-10-27 06:12:56 +03:00

993 Commits

Author SHA1 Message Date
Joy Latten
fde048b798 Separate Diffie hellman testcase #2 into a section for clear keys and a section for secure keys.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
v3.1
2014-01-27 15:19:02 -06:00
Joy Latten
5c15f8b862 cca token does not support brainpoolP512t1, so skip it in the
ec_func.c testcase.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-27 13:36:59 -06:00
Ingo Tuchscherer
90e12552d9 EP11 key-migration-tool: fixed symbol handling for ep11 library
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-27 12:11:44 -06:00
Joy Latten
3bdfaafbb1 Note not to install ep11.h header file in the ep11 Makefile.am
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-26 23:58:52 -06:00
Joy Latten
8590fa93f7 Update necessary files for version 3.1
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-26 23:38:38 -06:00
Joy Latten
b9ecf36d8a Add README for ep11 token and man page for ep11 migrate tool.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-26 23:19:28 -06:00
Joy Latten
38825420db Initialize csum and ep11_opaque in ep11.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-26 22:33:05 -06:00
Ingo Tuchscherer
9da4a6174a EP11 token: removed unsupported mechanisms from mechanism list
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-23 15:21:42 -06:00
Ingo Tuchscherer
5d9cf3e8b3 Added test case conditions based on mechanism type and key length
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-23 15:20:36 -06:00
Ingo Tuchscherer
050f11b9fd EP11: Fixed key object attributes - part II
Added key properties related to the class and key type

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-23 15:19:38 -06:00
Joy Latten
21d9a7d334 ST_initialize takes a mutex lock before calling the token specific init call.
Thus ep11's token specific init call does not really require a lock
since its access is serialize in ST_Initialize.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-19 23:20:30 -06:00
Ingo Tuchscherer
db436d2f51 Added EP11 token specific default key attributes for secret keys and
EC/RSA public and private keys

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-19 23:19:09 -06:00
Joy Latten
e0ed4ca88d RSA testcase corrections. Prior changes did not consider that
the test vectors included keys other than DES3 and AES to be wrapped.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:19:04 -06:00
Torsten Hendel
c0ba48eb32 EP11 fails with opencryptoki's version of encoding attributes.
According to rfc 5208, encoding of attributes are optional.
Thus can skip encoding them.

Signed-off-by: Torsten Hendel <HENDELT@de.ibm.com>
2014-01-17 16:18:49 -06:00
Joy Latten
f6faf70670 1. 2 lines in code had "P11TOK" instead of "EP11TOK" and this
caused a symbol lookup failure.
2. reformated a function

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:18:21 -06:00
Joy Latten
555b60badb 1. opencryptoki was having problems finding ep11tok.conf.
Made following corrections,
- config dir is either OCK_EP11_TOKEN_DIR or OCK_CONFDIR.
- The config file name is always taken from the ep11 entry in opencryptoki.conf.

2. Moved print_mechanism and print_flags to get rid of build warnings.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:17:38 -06:00
Ingo Tuchscherer
5dd62ff398 Added error handling for memory allocations.
Release pre-allocated memory in error case.
Mode change in token_specific_unwrap_key.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-17 16:17:07 -06:00
Joy Latten
03436b602d Enable ep11 token and migrate utility only when ep11 library and
required header is avaliable.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:16:23 -06:00
Joy Latten
4c95ddd850 1. Use the rng in soft token as a generic rng. Thus in future, if a
token does not implement an rng, it can use the generic one.
2. Since secure key tokens use software des3 rather than token's des3
to encrypt/decrypt private token objects, their masterkeys do not need
to be generated by the token. All this end up doing is creating a blob
and the blob is used for the key. Instead, just use the RNG to create
a  spcific number of bytes for des3 key for the software des3 to use.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:15:45 -06:00
Ingo Tuchscherer
04731e64ea Fixed configure script to conditionally enable ep11-token build.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-17 16:13:52 -06:00
Ingo Tuchscherer
70c410993d Added installation of ep11tok.conf to Makefile
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-17 16:13:19 -06:00
Joy Latten
a8fc0b6e62 Reformated ep11_specific.c to more closely follow linux kernel coding style.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:12:53 -06:00
Joy Latten
52dbc27f83 Add several directories to gitignore.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 16:12:25 -06:00
Ingo Tuchscherer
a8d3862e76 Renaming of library and token config file extension.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2014-01-17 16:12:02 -06:00
Torsten Hendel
f4abd1fd0c testcase fixes for secure key tokens.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Torsten Hendel <HENDELT@de.ibm.com>
Signed-off-by: Harald Freudenberger <FREUDE@de.ibm.com>
2014-01-17 16:11:38 -06:00
orsten Hendel
657305f52b Add new EP11 token functionality
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Torsten Hendel <HENDELT@de.ibm.com>
Signed-off-by: Harald Freudenberger <FREUDE@de.ibm.com>
2014-01-17 16:10:44 -06:00
Joy Latten
95064291fe Problem: A regular user in pkcs11 group cannot issue pkcsconf -t.
When shm_open() creates shared memory object, it honors umask of the
caller. This patch ensures the shared memory has expected permissions
when it is created.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2014-01-17 10:33:19 -06:00
Dan Horák
fef1c24a5f [PATCH] fix build with -Werror=format-security
Refers to SF bug #1037228

Signed-off-by: Dan Horák <dan@danny.cz>
2013-12-03 12:52:32 -06:00
Joy Latten
f4df4a49d4 CCA token was putting incorrect OID info into CKA_ECDSA_PARAMS.
This attribute must be passed in by user when generating EC keypair
and should not be over-written.
Since CKA_EC_POINT is for public key, does not require being in private key.
Created a routine to get signature length when length only.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-11-13 15:59:59 -06:00
Joy Latten
ce8de9df2c Objects were not being encrypted and saved to disk for secure key token.
Needed to call encrypt_data_with_clear_key() and let it determine if
clear key or secure key and do appropriate actions.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-11-13 15:23:52 -06:00
Joy Latten
b3c5e1635e The sha256 in CCA (CSNBOWH) can take input larger than 32MB.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-10-02 17:15:34 -05:00
Joy Latten
84db3078de CCA token was not importing rsa keypair correctly in v3.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-10-02 16:34:40 -05:00
Signed-off-by: Dan Horák
5e7e9c8474 Update options in the pkcsconf man page to match the
pkcsconf binary.

Signed-off-by: Signed-off-by: Dan Horák <dan@danny.cz>
2013-09-04 16:35:38 -05:00
Joy Latten
b50eb39e3c Update the opencryptoki(7) man page and remove reference to
pkcs11_startup and pk_config_data.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-09-04 16:12:38 -05:00
Dan Horák
9c8ab7b0c7 Update unit file for 3.0.
Signed-off-by: Dan Horák <dan@danny.cz>
2013-09-04 15:58:02 -05:00
Joy Latten
8ea9659d64 Add missing copyright.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
v3.0
2013-07-15 11:38:43 -05:00
Joy Latten
285ae71055 More documentation.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-07-12 17:44:20 -05:00
Joy Latten
12c1c71d7e Add to ChangeLog
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-07-12 10:02:54 -05:00
Joy Latten
3a492f7e21 Bump up version to 3.0.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-21 10:53:02 -05:00
Joy Latten
85a0f66ece ICA token was not properly reporting when a mechanism was invalid.
The return value was incorrect when a mechanism could not be found.
Corrected a few return values in the ica token specific get mechanism code.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-21 10:46:44 -05:00
Joy Latten
830a639128 Bugfix: several hmacs were in incorrect case statement.
Also fixed a typo in the testcase vector for sha512 hmac.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-20 15:27:09 -05:00
Joy Latten
7175433ac2 Update docs to reflect v3 changes.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-17 16:12:31 -05:00
Joy Latten
684dd44bc9 Add cfb and ofb test vectors for des3.
Also made a correction in one of the aes test vectors.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-11 22:33:12 +02:00
Joy Latten
92d8978f96 Added publiched test vectors for aes-cfb8 and aes-fb128.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-11 03:24:46 +02:00
Ingo Tuchscherer
2b2bcd7aa7 Fixed Encrypt/Decrypt-Update methods for DES, DES3 and AES in CFB mode
(s-bit size for single crypto operation cycle corrected)

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2013-06-11 03:23:02 +02:00
Ingo Tuchscherer
157127f277 ica-token: added support for:
CBC-MAC for DES3 and AES
        OFB and CFB mode for DES3 and AES
        SHA384HMAC, SHA512HMAC
        new method to retrieve mechanism list for ica token

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-11 03:11:47 +02:00
Joy Latten
be895a5f2a Make using a socket for transferring slot info between pkcsslotd and
the opencryptoki library the default behaviour rather than using
shared memory.
We still use shared memory for some process bookkeeping per slot.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
2013-06-11 03:00:26 +02:00
Ross McIlroy
b9ed7d424a Patch[4/4]:
Part 2 of slot-info via socket.

This patch enables all the non-changing slot information to be
transmitted over  the sockets, rather via shared memory.  By doing this,
the members of the pkcs11 group can no longer override the locations of
the backend library .so files, and so can no longer execute arbitary
code with the preivileges of other pkcs11 group members.

Signed-off-by: Ross McIlroy <rmcilroy@google.com>
2013-06-11 02:56:29 +02:00
Ross McIlroy
3686bd27f8 Patch[3/4]:
Part 1 of slot-info via socket.
Adds an option to use a unix domain socket for the transmission of slot
information from the slot daemon to the library, rather than shared
memory. In this patch, only ck_info is transmitted this way.

Signed-off-by: Ross McIlroy <rmcilroy@google.com>
2013-06-11 02:56:17 +02:00
Ross McIlroy
87d147f2c3 Patch[2/4]:
Move the code in InitSharedMemory that populates the CKInfo and SlotInfo
structures into helper functions in pkcssllotd_util.c.

This is to avoid duplicating code in the upcoming socket slot info patch.

Signed-off-by: Ross McIlroy <rmcilroy@google.com>
2013-06-11 02:54:49 +02:00