Hello,
I write application on the top of libp11. But I cannot perform NULL
login ! So I must make this patch. Maybe this should be in official code ?
--
NOWICKA Holding Sp. z o.o.
ul. Wejherowska 28, Wroclaw
NIP PL8942653723, KRS 0000087851
Sad Rejonowy W-w Fabryczna, VI wydz. Gospodarczy KRS
Kapital zakladowy wplacony 50.000zl
--- libp11-0.2.2/src/p11_slot.c 2006-04-18 15:09:04.000000000 +0200
+++ libp11-0.2.2.new/src/p11_slot.c 2007-10-03 12:37:00.000000000 +0200
@@ -119,7 +119,7 @@
{
PKCS11_SLOT_private *priv = PRIVSLOT(slot);
PKCS11_CTX *ctx = priv->parent;
- int rv;
+ int rv, pinlen;
/* Calling PKCS11_login invalidates all cached
* keys we have */
@@ -137,9 +137,12 @@
return -1;
}
+ if (pin == NULL) pinlen = 0;
+ else pinlen = strlen(pin);
+
rv = CRYPTOKI_call(ctx, C_Login(priv->session,
so ? CKU_SO : CKU_USER,
- (CK_UTF8CHAR *) pin, strlen(pin)));
+ (CK_UTF8CHAR *) pin, pinlen));
CRYPTOKI_checkerr(PKCS11_F_PKCS11_LOGIN, rv);
priv->loggedIn = 1;
return 0;
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel