[pkg-opensc-commit] [pkcs11-helper] 183/253: Add an option to specify additional string at initargs.pReserved, so that NSS provider may work

Eric Dorland eric at moszumanska.debian.org
Fri Jan 6 23:39:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository pkcs11-helper.

commit 055492cff89a0053db39711bc6ea0eddb7470957
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Thu Jun 18 10:22:54 2009 +0000

    Add an option to specify additional string at initargs.pReserved, so that NSS provider may work
---
 lib/pkcs11h-core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/pkcs11h-core.c b/lib/pkcs11h-core.c
index eb9e58b..e54a636 100644
--- a/lib/pkcs11h-core.c
+++ b/lib/pkcs11h-core.c
@@ -646,6 +646,8 @@ pkcs11h_addProvider (
 
 	_pkcs11h_provider_t provider = NULL;
 	CK_C_GetFunctionList gfl = NULL;
+	CK_C_INITIALIZE_ARGS initargs;
+	CK_C_INITIALIZE_ARGS_PTR pinitargs = NULL;
 	CK_INFO info;
 	CK_RV rv = CKR_FUNCTION_FAILED;
 
@@ -745,7 +747,12 @@ pkcs11h_addProvider (
 		goto cleanup;
 	}
 
-	if ((rv = provider->f->C_Initialize (NULL)) != CKR_OK) {
+	memset(&initargs, 0, sizeof(initargs));
+	if ((initargs.pReserved = getenv("PKCS11H_INIT_ARGS_RESERVED")) != NULL) {
+		pinitargs = &initargs;
+	}
+
+	if ((rv = provider->f->C_Initialize (pinitargs)) != CKR_OK) {
 		if (rv == CKR_CRYPTOKI_ALREADY_INITIALIZED) {
 			rv = CKR_OK;
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git



More information about the pkg-opensc-commit mailing list