static CK_RV
sys_C_Initialize (CK_VOID_PTR init_args)
{
+ static CK_C_INITIALIZE_ARGS def_args =
+ { NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL, };
CK_C_INITIALIZE_ARGS *args = NULL;
int supplied_ok;
CK_RV rv;
rv = CKR_OK;
- /* pReserved must be NULL */
args = init_args;
+ if (args == NULL)
+ args = &def_args;
/* ALL supplied function pointers need to have the value either NULL or non-NULL. */
supplied_ok = (args->CreateMutex == NULL && args->DestroyMutex == NULL &&
teardown (cu);
}
+static void
+test_null_initialize (CuTest *cu)
+{
+ CK_FUNCTION_LIST *module;
+ CK_RV rv;
+
+ /* This is the entry point of the trust module, linked to this test */
+ rv = C_GetFunctionList (&module);
+ CuAssertTrue (cu, rv == CKR_OK);
+
+ rv = module->C_Initialize (NULL);
+ CuAssertTrue (cu, rv == CKR_OK);
+
+ rv = module->C_Finalize (NULL);
+ CuAssertIntEquals (cu, CKR_OK, rv);
+}
+
static void
test_multi_initialize (CuTest *cu)
{
putenv ("P11_KIT_STRICT=1");
p11_library_init ();
+ SUITE_ADD_TEST (suite, test_null_initialize);
SUITE_ADD_TEST (suite, test_multi_initialize);
SUITE_ADD_TEST (suite, test_get_slot_list);
SUITE_ADD_TEST (suite, test_get_slot_info);