Greats news, This is a good progress.
Do you release a patch or should I do? Thank you, François. François Leblanc Service Recherche et Innovation francois.lebl...@cev-sa.com Tél. : 02.33.77.65.00 Fax : 02.33.77.65.01 www.cev-sa.com Avant d'imprimer, pensez à l'environnement De : Jozsef Dojcsak <d...@t-online.hu> A: francois.lebl...@cev-sa.com Date: 07/05/2010 17:41 Objet : Re: [opensc-devel] Cardmod MiniDriver Problem Hi François, I spent some time with the cardmod module and managed to get it running under XP. (Under Win7 I am still getting the annoying popup messages). In order to get it working on XP I had to fix some code in reader-pcsc.c: in the function refresh_attributes() the SCardGetStatusChange API uses the structure priv->reader_state, but the reader_state.szReader pointer was not initialized correctly by the cardmod internal driver, so I enabled the original pcsc initialization by commenting out the line ... cardmod_ops.wait_for_event = NULL; ... This seemed to help, so I could test the CardOS card with the certutil, and it worked well for the 1st key and the 1st certificate. I even tried to deploy the minidriver for Smartcard Logon, but it didn't work at all. Kind Regards and Many Thanks, Jozsef francois.lebl...@cev-sa.com wrote: > > Hello Jozsef, > > Could you try to re-install card drivers on win7 with DeviceManager... > > > I've the same trouble when I set debug to something else than 0 the > certutil command > > freeze... > > With debug = 0, it's working (but I have to wait a little..) > > Regards, > François. > > ------------------------------------------------------------------------ > *François Leblanc* > Service Recherche et Innovation_ > __francois.lebl...@cev-sa.com_ <mailto:francois.lebl...@cev-sa.com> > Tél. : 02.33.77.65.00 > Fax : 02.33.77.65.01_ > __www.cev-sa.com_ > > > Avant d'imprimer, pensez à l'environnement > <www.cev-sa.com> > > > > > > De : Jozsef Dojcsak <d...@t-online.hu> > A: francois.lebl...@cev-sa.com > Date: 03/05/2010 22:30 > Objet : Re: [opensc-devel] Cardmod MiniDriver Problem > > > ------------------------------------------------------------------------ > > > > Hello François, > I managed to apply your patch and also fixed the asn1.c module (which > caused GPF with CardOS cards, please see asn1.c.patch). Unfortunately > the new version produced similar results as before. It was tested under > XP and Win7 (as a reference test, pkcs15-tool was used on both platforms): > > 1) the XP test: > 402.203.0: 0x80070057 (WIN32: 87): ..CertCli Version > The Microsoft Smart Card Resource Manager is running. > Current reader/card status: > Readers: 1 > 0: O2 O2Micro CCID SC Reader 0 > --- Reader: O2 O2Micro CCID SC Reader 0 > --- Status: SCARD_STATE_PRESENT | SCARD_STATE_INUSE > --- Status: The card is being shared by a process. > --- Card: Siemens CardOS V4.3 B > > ======================================================= > Analyzing card in reader: O2 O2Micro CCID SC Reader 0 > O2 O2Micro CCID SC Reader 0: > Microsoft Base Smart Card Crypto Provider: > CryptAcquireContext: Váratlan kártyahiba történt. 0x8010001f (-2146435041) > 317.973.0: 0x8010001f (-2146435041) > 317.1046.0: 0x8010001f (-2146435041) > 317.1100.0: 0x8010001f (-2146435041) > > Done. > CertUtil: -SCInfo command FAILED: 0x8010001f (-2146435041) > CertUtil: Váratlan kártyahiba történt. > 301.3128.0: 0x8010001f (-2146435041) > > +++++++++++++++++++++++++++++++++++++++++++++ > Notes: > - "Váratlan kártyahiba történt" means, "Unexpected card error" - aka > SCARD_E_UNEXPECTED=0x8010001F > - if OPENSC_DEBUG=9 is set, then certutil hangs at "Analyzing card in > reader:..." > +++++++++++++++++++++++++++++++++++++++++++++ > > > 2) the Win7 test (for the sake of simplicity with a German version): > Die Microsoft Smartcard-Ressourcenverwaltung wird ausgeführt. > Aktueller Leser-/Kartenstatus: > Leser: 1 > 0: OMNIKEY AG Smart Card Reader USB 0 > --- Leser: OMNIKEY AG Smart Card Reader USB 0 > --- Status: SCARD_STATE_PRESENT > --- Status: Die Smartcard kann verwendet werden. > --- Karte: CardOS test > --- ATR: > 3b f2 18 00 02 c1 0a 31 fe 58 c8 08 74 ;......1.X..t > > > ======================================================= > Karte im Leser wird analysiert: OMNIKEY AG Smart Card Reader USB 0 > > --------------===========================-------------- > ================ Zertifikat 0 ================ > --- Leser: OMNIKEY AG Smart Card Reader USB 0 > --- Karte: CardOS test > Anbieter = Microsoft Base Smart Card Crypto Provider > Schlüsselcontainer = (null) [Standardcontainer] > > Schlüssel "AT_SIGNATURE" kann nicht geöffnet werden für Leser: OMNIKEY > AG Smart > Card Reader USB 0 > Schlüssel "AT_KEYEXCHANGE" kann nicht geöffnet werden für Leser: OMNIKEY > AG Smar > t Card Reader USB 0 > > --------------===========================-------------- > ================ Zertifikat 0 ================ > --- Leser: OMNIKEY AG Smart Card Reader USB 0 > --- Karte: CardOS test > Anbieter = Microsoft Smart Card Key Storage Provider > Schlüsselcontainer = (null) [Standardcontainer] > > Schlüssel "" kann nicht geöffnet werden für Leser: OMNIKEY AG Smart Card > Reader > USB 0 > > --------------===========================-------------- > > Fertig. > CertUtil: -SCInfo-Befehl wurde erfolgreich ausgeführt. > > +++++++++++++++++++++++++++++++++++++++++++++ > Notes: > - everytime if the certutil tried to read a key info ("Schlüssel > ..."AT_SIGNATURE", "AT_KEYEXCHANGE", ""), there was a popup message (see > opensc_cardoscard.png) requesting to insert another smartcard. The > Smartcard-Status message can be translated like: it has recognized a > smarcard, but another card is required to proceed, because a driver is > needed for the actual card. > +++++++++++++++++++++++++++++++++++++++++++++ > > If you have any idea what else I could test, please let me know. > > Kind Regards > Jozsef > > > francois.lebl...@cev-sa.com wrote: > > > > Can you try this patch to see if the trouble is coming from T1 support, > > > > Regards > > > > François. > > > > > > > > > Hello François, > > thank you for the hint, it is then likely that the unsupported T=1 mode > > causes our problem. > > > > The partial success means: the cardmod DLL is loaded correctly by > > "certutil -SCInfo", but after the OpenSC context creation (right after > > the "[cardmod] reader-pcsc.c:1815:cardmod_detect_readers: returning > > with: 0") it hangs on XP and raises a warning ("like card is not > > supported") on Win7. > > > > My test card is a Siemens CardOS 4.3B, and it does not work with the > > pkcs15-tool in T=0 mode, only in T=1. Please see the attached inf file, > > used on Win7 to install the mini-driver. > > > > Is there a reason to support T0 only in the cardmod reader driver? > > > > Kind Regards > > Jozsef > > > > francois.lebl...@cev-sa.com wrote: > > > Hello Jozsef, > > > > > > cardmod is still experimental module but it should at end work with > > > all cards supported by opensc, > > > > > > for now I only test it on win7 with westcos card (that is my working > > > configuration). > > > > > > So you need and you do it to add your ATR on configuration file > > > yourself, Perhaps can you send > > > > > > me your ATR/ATRmask and the configuration file you set, I will have a > > > look. > > > > > > An other point it's the support for T0 only protocol so if your card > > > is T1 this doesn't work for now... > > > > > > When you said "it did not really worked" what do you mean? > > > > > > Hope I will help, > > > > > > François. > > > > > > > > > > > > First of all many thanks to Francois and Martin for their help! As I > > > wrote, I managed to compile the cardmod mini driver with MSVC9 and > later > > > I also did cross-compile it on Linux. Then I tested the driver on both > > > XP and Win7 with partial success, since I don't have a Westcos card.. > > > > > > And my last question in this topic: Is this mini driver intended for > > > Westcos cards only, or it should work with any other PKCS15/OpenSC > > > compatible cards? (Well, I customized the ATR for other cards, but it > > > did not really worked) > > > > > > Cheers > > > Jozsef > > > > Index: asn1.c > =================================================================== > --- asn1.c (revision 4276) > +++ asn1.c (working copy) > @@ -999,10 +999,10 @@ > break; > case SC_ASN1_INTEGER: > case SC_ASN1_ENUMERATED: > - if (parm != NULL) > + if (parm != NULL) { > r = > sc_asn1_decode_integer(obj, objlen, (int *) entry->parm); > - sc_debug(ctx, SC_LOG_DEBUG_ASN1, > "%*.*sdecoding '%s' returned %d\n", depth, depth, "", entry->name, > *((int *) entry->parm)); > - > + sc_debug(ctx, > SC_LOG_DEBUG_ASN1, "%*.*sdecoding '%s' returned %d\n", depth, depth, > "", entry->name, *((int *) entry->parm)); > + } > break; > case SC_ASN1_BIT_STRING_NI: > case SC_ASN1_BIT_STRING: > [pièce jointe "opensc_cardoscard.png" supprimée par Francois > LEBLANC/CEV/FR/GCD] >
<<image/gif>>
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel