From cf988aa7858d249887ea0818301c7211bb3cab38 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 31 Mar 2011 18:21:38 +0200 Subject: Support setting of CK_C_INITIALIZE_ARGS.pReserved to string. This is a naughty little thing that a lot of PKCS#11 modules require to be properly initialized. So we support setting pReserved to a string that is in the config under the 'x-init-reserved' parameter. --- p11-kit/p11-kit-lib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/p11-kit/p11-kit-lib.c b/p11-kit/p11-kit-lib.c index f57f3d1..e7e913a 100644 --- a/p11-kit/p11-kit-lib.c +++ b/p11-kit/p11-kit-lib.c @@ -367,6 +367,13 @@ load_module_from_config_unlocked (const char *configfile, const char *name) return CKR_GENERAL_ERROR; } + /* + * We support setting of CK_C_INITIALIZE_ARGS.pReserved from + * 'x-init-reserved' setting in the config. This only works with specific + * PKCS#11 modules, and is non-standard use of that field. + */ + module->init_args.pReserved = hash_get (module->config, "x-init-reserved"); + return CKR_OK; } -- cgit v1.1