Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > 4cb58acf0bfdd2aaf21efc32197a6da2 > files > 1

openCryptoki-2.2.4-22.el5_4.2.src.rpm

Files opencryptoki-2.2.4.1/usr/lib/pkcs11/common/.defs.h.swp and opencryptoki-2.2.4.1_new/usr/lib/pkcs11/common/.defs.h.swp differ
diff -Nru opencryptoki-2.2.4.1/usr/lib/pkcs11/common/key.c opencryptoki-2.2.4.1_new/usr/lib/pkcs11/common/key.c
--- opencryptoki-2.2.4.1/usr/lib/pkcs11/common/key.c	2006-06-15 17:58:22.000000000 -0400
+++ opencryptoki-2.2.4.1_new/usr/lib/pkcs11/common/key.c	2009-05-14 15:57:11.000000000 -0400
@@ -5204,14 +5204,17 @@
    CK_BBOOL	   found        = FALSE;
 
    
-   /* If the user didn't specify the size of the AES key being
-    * unwrapped, we return. - KEY */
+   /*
+    * CKA_VALUE_LEN attribute is optional in the key template. Default
+    * is to use AES_BLOCK_SIZE and truncate if no value is specified. --KlausK
+    */
    found = template_attribute_find( tmpl, CKA_VALUE_LEN, &val_len_attr );
-   if (!found){
-      st_err_log(48, __FILE__, __LINE__);
-      return CKR_TEMPLATE_INCOMPLETE;
+   if (found){
+      key_size = *(CK_ULONG *)val_len_attr->pValue;
+   }
+   else {
+      key_size = AES_BLOCK_SIZE;		/* same as AES_KEY_SIZE_128 */
    }
-   key_size = *(CK_ULONG *)val_len_attr->pValue;
       
    /* key_size should be one of AES's possible sizes */
    if (key_size != AES_KEY_SIZE_128 &&