icsf: keep LDAP handle in a global structure

Add a list of open sessions that will keep the handle for the LDAP
connection.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
fix formatting for SC_GenerateKeu in new_host.c

Fix indentation and break long lines.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
token-specific function for symmetric key generation

Add a new token-specific function t_generate_key for symmetric key generation.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
icsf: add support for symmetric key generation

This commit adds to ICSF token the token-specific function for symmetric
key generation. It also adds a helper function in icsf_specific.c that
checks permissions based on the current session and on the object/key
attributes, this function can be reused for object creation.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
fix: remove unused macro ICSF_DIR

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
fix: rename t_session() to t_open_session()

Also rename token_specific_session() to token_specific_open_session().

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
add some comments about ICSF tag numbers and services

Include some comments in icsf.c and icsf.h to make clear the service
that is called and how tag numbers work.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Indent with tabs instead of spaces

in icsf_specific.c

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Change lock ICSF's t_login to protect shared memory

Change the point where the futex is locked to cover any access to shared
memory in token_specific_login.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
icsf: use a RW lock for sessions

Change the way the sessions list is protected, replacing the futex with
a RW lock for that.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
icsf: fix wrong variable sid in destroy_objects

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>