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>
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>
Renaming of library and token config file extension.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Add several directories to gitignore.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reformated ep11_specific.c to more closely follow linux kernel coding style.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Added installation of ep11tok.conf to Makefile

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Fixed configure script to conditionally enable ep11-token build.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Added test case conditions based on mechanism type and key length

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
EP11 token: removed unsupported mechanisms from mechanism list

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Initialize csum and ep11_opaque in ep11.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>