]> granicus.if.org Git - p11-kit/commitdiff
Support setting of CK_C_INITIALIZE_ARGS.pReserved to string.
authorStef Walter <stefw@collabora.co.uk>
Thu, 31 Mar 2011 16:21:38 +0000 (18:21 +0200)
committerStef Walter <stefw@collabora.co.uk>
Thu, 31 Mar 2011 16:21:38 +0000 (18:21 +0200)
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

index f57f3d1e4605a8ffef827df30f203746cef23978..e7e913aef229c45f28a61a55e458189756040325 100644 (file)
@@ -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;
 }