p11_dict *config;
} gl = { NULL, NULL };
+/* These are global variables to be overridden in tests */
+const char *p11_config_system_file = P11_SYSTEM_CONFIG_FILE;
+const char *p11_config_user_file = P11_USER_CONFIG_FILE;
+const char *p11_config_package_modules = P11_PACKAGE_CONFIG_MODULES;
+const char *p11_config_system_modules = P11_SYSTEM_CONFIG_MODULES;
+const char *p11_config_user_modules = P11_USER_CONFIG_MODULES;
+
/* -----------------------------------------------------------------------------
* P11-KIT FUNCTIONALITY
*/
return CKR_OK;
/* Load the global configuration files */
- config = _p11_conf_load_globals (P11_SYSTEM_CONFIG_FILE, P11_USER_CONFIG_FILE, &mode);
+ config = _p11_conf_load_globals (p11_config_system_file, p11_config_user_file, &mode);
if (config == NULL)
return CKR_GENERAL_ERROR;
assert (mode != CONF_USER_INVALID);
configs = _p11_conf_load_modules (mode,
- P11_PACKAGE_CONFIG_MODULES,
- P11_SYSTEM_CONFIG_MODULES,
- P11_USER_CONFIG_MODULES);
+ p11_config_package_modules,
+ p11_config_system_modules,
+ p11_config_user_modules);
if (configs == NULL) {
rv = CKR_GENERAL_ERROR;
p11_dict_free (config);
#include "compat.h"
#include "pkcs11.h"
+/* These are global variables to be overridden in tests */
+extern const char *p11_config_system_file;
+extern const char *p11_config_user_file;
+extern const char *p11_config_package_modules;
+extern const char *p11_config_system_modules;
+extern const char *p11_config_user_modules;
+
CK_RV _p11_load_config_files_unlocked (const char *system_conf,
const char *user_conf,
int *user_mode);