Added token_keysize to the token_specific_struct.

When token_keysize is set, that indicates we are using a secure key
token and the keysize for the secure key.
Otherwise, it is set to 0, indicating this is not a secure key token and
thus no specific keysize required.
Thus token_keysize can also be used to indicate a secure key token.

This was needed so that symmetric key gens could know when to save the
token generated key to a CKA_VALUE or a CKA_IBM_OPAQUE.
Fixed the symmetric key gens (aes, des, des3).
Also, this fixes master key handling which was broken in cca token because
we were building CKA_IBM_OPAQUE in token and passing back zeroes for the
generated key.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to NODAE define.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to NOODM define.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to TEST_MUTEXES and TEST_COND_VARS.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to SLOTD_DECLARE_VARs

since it is never declared or usedand looks to be a carryover from original AIX port.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to PER_PROCESS_MUTEXES

It is not used and looks to be acarryover from original AIX port.
Also removed garbage.c since it is not used and also looks to be a carryover
from original aix port.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Allow pkcsslotd to read opencryptoki.conf to determine slots and slot info instead of reading from pk_config_data.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove reference to pkcs_slot and pkcs11_startup

since we no longer needthese. Allow necessary directories and
permissions that were created by pkcs11_startup to be created by
install.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove files that are not being used.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
We should always used the code defined by PKCS64.

Thus we no longer really need this define, thus removed it from pkcsslotd.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Remove all reference to AIX message catalogs.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
refactor such that each c file includes only what it needs.

Thus allowing to clean up pkcsslotd.h

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Add a man page for opencryptoki.conf and remove the man pages for pkcs_slot and pkcs11_startup.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Change rng to use token_specific structure.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Task6: change CCA token code to use common new_host.c

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Fix formatting of common/tok_spec_struct.h

Moved some comments and used "indent -npro -kr -i8 -ts8 -sob -l80 -ss
-ncs -cp1 -il0".

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Fix formatting of soft_stdll/tok_struct.h

Used "indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 -il0".

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Fix formatting of tpm_stdll/tok_struct.h

Used "indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 -il0".

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Fix formatting of cca_stdll/tok_struct.h

Used "indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 -il0"

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Fix formatting of common/loadsave.c

Used "indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 -il0"

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb <dvelarde@us.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>