Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /usr/libexec/SmartCardServices/pkcs11/pkcs11.bundle/Contents/MacOS/pkcs11 crashes in C_Initialize()



On 11/09/06, Ludovic Rousseau <email@hidden> wrote:
Hello,

I just discovered that Apple provides a PKCS#11 token in
/usr/libexec/SmartCardServices/pkcs11/pkcs11.bundle/Contents/MacOS/pkcs11.
This token uses the MuscleCard lower level API (use of MSC* functions)
so I guess it is the PKCS#11 provided by Muscle.

I tried to use it and I get a crash in the C_Initialize() call. I
reported a bug in radar as Problem ID: 4726179.

I tried the same sample code on a iMac with an Intel proc and Mac OS X 10.4.7 (same OS X version as on the PowerPC) and I do NOT have a crash but a normal execution.

After debugging the source code of SmartCardServices-26726 I think I
found the problem.
The code is already patched in libmusclecard from upstream at [1] but
this patch has not yet been applied on Apple version.

The patch is attached for info.

Some remarks:
- I used http://darwinsource.opendarwin.org/ but I think this site is
no more up to date since 10.4.7 is not available there
- the bug is also present in SmartCardServices-27738 for Mac OS X 10.4.7 [2]
- I could no find the source code for the Intel version of
SmartCardServices. Where it is?
- Why does it work on Intel and not on PowerPC? The two codes are not the same?

Thanks

[1] http://svn.debian.org/wsvn/pcsclite/trunk/libmusclecard/src/musclecard.c?op=file&rev=0&sc=0
[2] http://www.opensource.apple.com/darwinsource/10.4.7.ppc/SmartCardServices-27738/src/PCSC/musclecard.c

The patch is

--
 Dr. Ludovic Rousseau
diff -ru SmartCardServices-26726/src/PCSC/musclecard.c SmartCardServices-26726.patch/src/PCSC/musclecard.c
--- SmartCardServices-26726/src/PCSC/musclecard.c	2006-09-11 14:43:32.000000000 +0200
+++ SmartCardServices-26726.patch/src/PCSC/musclecard.c	2006-09-11 14:40:48.000000000 +0200
@@ -226,9 +226,12 @@
 							rgReaderStates.rgbAtr, rgReaderStates.cbAtr);
 						currentToken->tokenIdLength = rgReaderStates.cbAtr;
 
+					if (rv != -1)
+					{
                                                 memcpy(currentToken->tokenApp,
                                                         tokenInfo.tokenApp, tokenInfo.tokenAppLen);
                                                         currentToken->tokenAppLen = tokenInfo.tokenAppLen;
+					}
 
                                                 strncpy(currentToken->svProvider,
                                                         tokenInfo.svProvider, MSC_MAXSIZE_SVCPROV);
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/apple-cdsa/email@hidden

This email sent to email@hidden

References: 
 >/usr/libexec/SmartCardServices/pkcs11/pkcs11.bundle/Contents/MacOS/pkcs11 crashes in C_Initialize() (From: "Ludovic Rousseau" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.