Move opencryptoki.conf from "{prefix}/etc" to "{prefix}/etc/opencryptoki".
Thus we have created an opencryptoki directory off of /etc and we can
store all the ock related config files here.

Also moved OCK_CONFDIR from under pkcsslotd so that other opencryptoki
utilities can use it too.

Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Marcelo Cerri
Add functions for password based key derivation, master key handling and racf
protection when using simple auth to bind to ldap server.

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Marcelo Cerri
New config tool for icsf token.
Done:
(1) Lists all the tokens.
(2) Allows user to add one token specifying the token name. It writes a slot
    entry in existing opencryptoki.conf and it creates a
    /etc/opencryptoki/<token-name>.conf file and writes the token info as well
    as authentication info into this conf file.

ToDo:
(1) Add sasl authentication.
(2) possibly add a delete token function that removes the slot entry.
(3) manpage.

Syntax Examples:
To list available tokens under the RACF auth
./pkcsicsf -l -m simple -b racfid=suimgti,profileType=user,cn=myracf -u ldap://9.12.47.101:3031

To add the token named OTUBO
./pkcsicsf -a OTUBO -m simple -b racfid=suimgti,profileType=user,cn=myracf -u ldap://9.12.47.101:3031

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Marcelo Cerri
fix: add missing commas in error message array

Some messages in the error message array are not separated with commas,
which causes some messages to be concatenated and some error numbers
(used as indexes) to not match with its correlated message.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
icsf: update ICSF token directory

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
data store: skip master key generation for tokens that doesn't use it

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
add slot id for init_token token-specific call

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
icsf: add basic token-specific functions for ICSF token

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
loadsave: fix multi-thread issue with static variable

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
fix formatting for loadsave.c

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
loadsave: make get_pk_dir available outside loadsave.c

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
fix formatting in icsf_stdll/Makefile.am

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
new_host: move user and group checks to a separated function

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
shm: add slot ID to token-specific t_attach_shm calls

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
formatting: fix indentation in cca_stdll/Makefile.am

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
formatting: indent ica_s390_stdll/Makefile.am similar to other makefiles

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
shared memory: add a new shared memory facility that can be reused by tokens

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
shared memory: update existing tokens to use the new facility

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
icsf: add token-specific attach_shm call

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Reviewed-by: Debora Babb
Reviewed-by: Joy Latten
formatting: fix formatting of apiutil.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
Reviewed-by: Joy Latten