On Wed, 2005-05-25 at 07:06 +1000, Geoffrey Elgey wrote: 
> G'day,
> 
> > Is this a PKCS#11 issue, a card issue, a libmusclepkcs11 issue, a Muscle 
> > applet issue, or a programming issue? I'd like to store and view 
> > mutliple data objects on a card, but it seems that I can only view one 
> > data object afterwards.

A while ago I had made a patch dealing with data objects where the
CKA_VALUE was being stored in the attribute file under certain
circumstances (which usually causes the attribute file to run out of
space).  I do not know if this will fix your problem but it might be
worth a try.  See attached patch for p11_object.c

-- 
// Chris
--- p11_object.c.orig	2004-11-28 09:30:31.000000000 -0500
+++ p11_object.c	2005-05-24 22:22:30.000000000 -0400
@@ -434,22 +434,34 @@
         /* Intentionally blank */;
     else
     {
+        CK_RV trans_rv;
+
         for (i = 0; i < ulCount; i++)
         {
+            CK_BBOOL token = TRUE;
+
             log_Log(LOG_LOW, "SetAttributeValue:");
             object_LogAttribute(&pTemplate[i]);
 
+            /* CKA_VALUE is never stored in the attribute object */
+            if (pTemplate[i].type == CKA_VALUE)
+               token = FALSE;
+
             if (CKR_ERROR(rv = object_AddAttribute(object,
                                                    pTemplate[i].type,
-                                                   TRUE, /* Fixme: Always a token attribute? */
+                                                   token,
                                                    (CK_BYTE *)pTemplate[i].pValue,
                                                    pTemplate[i].ulValueLen, 0)))
                 break;
         }
     
-        (void)CKR_ERROR(rv = object_WriteAttributes(session, object));
+        if (!CKR_ERROR_NOLOG(rv))
+            (void)CKR_ERROR(rv = object_WriteAttributes(session, object));
+
+        (void)CKR_ERROR(trans_rv = slot_EndTransaction(session->session.slotID, MSC_LEAVE_TOKEN));
 
-        (void)CKR_ERROR(rv = slot_EndTransaction(session->session.slotID, MSC_LEAVE_TOKEN));
+        if (rv == CKR_OK)
+            rv = trans_rv;
     }
 
 finish:
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to