icsf: use icsf_to_ock_err()

This commit just uses the function icsf_to_ock_err() in a few remaining
places.

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

Replace spaces with tabs in indentation and break some long lines.

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
get_mechanism_list corrections needed for ICSF token

Signed-off-by: Debora V Babb <dvelarde@us.ibm.com>
the output length was an unusual looking number and not correct. It seems
reading an int into an unsigned long does not work well with ber_scanf.

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
Changed symmetric testcases to accept "-securekey" if using securekey token.
This ensures only published test vectors are not run on secure key tokens.
Before we were checking for securekey based on mode name, but ths won't work
for ICSF whose model name is not hardcoded or set by OCK.

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
Add ock token specific t_destroy_object to icsf token.

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
Add a testcase for C_DestroyObjects

Signed-off-by: Joy Latten <latten@linux.vnet.ibm.com>
common: add utility functions to handle attribute arrays

Add the following functions:

 - free_attribute_array()
 - dup_attribute_array()
 - get_attribute_by_type()
 - add_to_attribute_array()

Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
fix: fix multi-part decryption and encryption

Change multi-part decryption and encryption to always return all output
data available.

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