Hi,

I think i've found a bug on OpenSC. Whenever I look for any certificate
on a smart card, searching by its subject, OpenSC returns no matches and
I have 3 certificates on it! 

I've found that on asn1_sequence_wrapper function returns a greater
attribute buffer size than it should be.

I attach a patch created against 2941 revision that works for me. 

Could anyone test it and, if it's correct, apply it to OpenSC code?

Thanks a lot.

Best regards,
-- 
Albert Solana Berengué
[EMAIL PROTECTED]
C3PO, S.L.
http://www.c3po.es
C/Bertran, 113 - 08023 Barcelona
Tel. 93 417 99 55 - Fax. 93 253 12 80
Index: src/pkcs11/framework-pkcs15.c
===================================================================
--- src/pkcs11/framework-pkcs15.c	(revision 2941)
+++ src/pkcs11/framework-pkcs15.c	(working copy)
@@ -2478,7 +2478,7 @@
 	size_t		len2;
 
 	len2 = len;
-	check_attribute_buffer(attr, len + 1 + sizeof(len));
+	check_attribute_buffer(attr, len + 1 + 1);
 
 	dest = (u8 *) attr->pValue;
 	*dest++ = 0x30;	/* SEQUENCE tag */
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to