diff options
author | Stefan Walter <stefw@src.gnome.org> | 2008-09-14 22:35:43 +0000 |
---|---|---|
committer | Stefan Walter <stefw@src.gnome.org> | 2008-09-14 22:35:43 +0000 |
commit | 1c47fff72c28d0fc6edbbbbd8d5aaa125a15d2b6 (patch) | |
tree | 60ff65a0ae9f5a4eae09cb54d52ec20ed64a2781 /gp11 | |
parent | e03a8eebf3d7bd3873837fb095ad0d60378ef841 (diff) | |
download | gnome-keyring-1c47fff72c28d0fc6edbbbbd8d5aaa125a15d2b6.tar.gz |
Add init_args field. (gp11_module_initialize): Use init_args structure
* gp11/gp11-module.c (GP11ModulePrivate): Add init_args field.
(gp11_module_initialize): Use init_args structure from private
structure since at least one PKCS#11 module (opensc) requires
that the init_args argument persists in memory.
svn path=/trunk/; revision=1327
Diffstat (limited to 'gp11')
-rw-r--r-- | gp11/gp11-module.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gp11/gp11-module.c b/gp11/gp11-module.c index 370b2c68..a457a745 100644 --- a/gp11/gp11-module.c +++ b/gp11/gp11-module.c @@ -34,6 +34,7 @@ enum { typedef struct _GP11ModulePrivate { GModule *module; + CK_C_INITIALIZE_ARGS init_args; } GP11ModulePrivate; #define GP11_MODULE_GET_PRIVATE(o) \ @@ -216,7 +217,6 @@ gp11_module_info_free (GP11ModuleInfo *module_info) GP11Module* gp11_module_initialize (const gchar *path, gpointer reserved, GError **err) { - CK_C_INITIALIZE_ARGS init_args; CK_C_GetFunctionList get_function_list; GP11ModulePrivate *pv; GP11Module *mod; @@ -264,16 +264,16 @@ gp11_module_initialize (const gchar *path, gpointer reserved, GError **err) return NULL; } - memset (&init_args, 0, sizeof (init_args)); - init_args.flags = CKF_OS_LOCKING_OK; - init_args.CreateMutex = create_mutex; - init_args.DestroyMutex = destroy_mutex; - init_args.LockMutex = lock_mutex; - init_args.UnlockMutex = unlock_mutex; - init_args.pReserved = reserved; + memset (&pv->init_args, 0, sizeof (pv->init_args)); + pv->init_args.flags = CKF_OS_LOCKING_OK; + pv->init_args.CreateMutex = create_mutex; + pv->init_args.DestroyMutex = destroy_mutex; + pv->init_args.LockMutex = lock_mutex; + pv->init_args.UnlockMutex = unlock_mutex; + pv->init_args.pReserved = reserved; /* Now initialize the module */ - rv = (mod->funcs->C_Initialize) (&init_args); + rv = (mod->funcs->C_Initialize) (&pv->init_args); if (rv != CKR_OK) { g_set_error (err, GP11_ERROR, rv, "Couldn't initialize module: %s", gp11_message_from_rv (rv)); |