diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2007-07-03 09:26:44 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2007-07-03 09:26:44 +0000 |
commit | e0e6137dd3ab3694a3bdd1c2845a9fe2efee5087 (patch) | |
tree | c3eb6f90ff249fa634d8dc7aa13ef1b4eff947bf /src/pluto/smartcard.c | |
parent | 4979e85871fa9e389800dcc887a23f67776652fc (diff) | |
download | strongswan-e0e6137dd3ab3694a3bdd1c2845a9fe2efee5087.tar.bz2 strongswan-e0e6137dd3ab3694a3bdd1c2845a9fe2efee5087.tar.xz |
support of PKCS#11 init arguments required by NSS softoken, patch contributed by Robert Varga
Diffstat (limited to 'src/pluto/smartcard.c')
-rw-r--r-- | src/pluto/smartcard.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pluto/smartcard.c b/src/pluto/smartcard.c index 744f8a6f3..067d0f046 100644 --- a/src/pluto/smartcard.c +++ b/src/pluto/smartcard.c @@ -690,12 +690,16 @@ scx_find_all_cert_objects(void) #endif /* - * load and initialize PKCS#11 cryptoki module + * load and initialize PKCS#11 cryptoki module + * + * init_args should be unused when we have a PKCS#11 compliant module, + * but NSS softoken breaks that API. */ void -scx_init(const char* module) +scx_init(const char* module, const char *init_args) { #ifdef SMARTCARD + CK_C_INITIALIZE_ARGS args = { .pReserved = init_args, }; CK_RV rv; if (scx_initialized) @@ -726,8 +730,8 @@ scx_init(const char* module) DBG(DBG_CONTROL | DBG_CRYPT, DBG_log("pkcs11 module initializing...") - ) - rv = pkcs11_functions->C_Initialize(NULL); + ) + rv = pkcs11_functions->C_Initialize(init_args ? &args : NULL); if (rv != CKR_OK) { plog("failed to initialize pkcs11 module: %s" |