#include "p11-tests.h" #include "p11-tests-lib.h" #include "compat.h" #include #include #include #include int p11t_test_unexpected = 1; int p11t_test_write_session = 0; int p11_tests_get_unexpected (void) { return p11t_test_unexpected = 1; } void p11_tests_set_unexpected (int value) { p11t_test_unexpected = value ? 1 : 0; } int p11_tests_get_write_session (void) { return p11t_test_write_session; } void p11_tests_set_write_session (int value) { p11t_test_write_session = value ? 1 : 0; } int p11_tests_get_verbose (void) { return p11t_check_verbose; } void p11_tests_set_verbose (int value) { p11t_check_verbose = value ? 1 : 0; } int p11_tests_load_config (const char *config) { return p11t_config_parse (config); } P11TestsLogFunc p11_tests_get_log_func (void) { return p11t_log_func; } void p11_tests_set_log_func (P11TestsLogFunc func) { p11t_log_func = func; } void p11_tests_perform (CK_FUNCTION_LIST_PTR module) { ERR_load_crypto_strings(); OpenSSL_add_all_digests(); /* Basic module tests */ p11t_module_funcs = module; if (p11t_module_initialize () != CONTINUE) return; p11t_slot_tests(); p11t_session_tests(); p11t_object_tests(); p11t_key_tests(); p11t_certificate_tests(); p11t_rsa_tests(); p11t_dsa_tests(); p11t_dh_tests (); /* Remaining module tests */ p11t_module_finalize(); p11t_slot_cleanup(); p11t_config_cleanup(); }