Re: DEBUGCHK error in smartcard

From: visi (zqvisi_at_hotmail.com)
Date: 07/08/04


Date: Thu, 8 Jul 2004 21:02:22 +0800

Hi Igor,
If I may use CETK to test my driver and if CETK is using CSP? Because I ever
use CETK to testing my driver,but the result is the same to open control
panel,driver reads ATR and returns ATR to OS,then CETK calls several times
IOCTL_SMARTCARD_GET_ATTRIBUTE and IOCTL_SMARTCARD_GET_STATE,then
IOCTL_SMARTCARD_CANCEL_BLOCKING is called.
 The Smart Card Resource Manager APIS is CryptoAPI other than CryptoSPI ?
If I use CryptoAPI to develop simple test application, do i not permit to
write/read date in card because having not CSP?

> (SCardConnect,SCardTransmit,SCardLocateCards,etcs).
"Igor Dvorkin [MS]" <igord@online.microsoft.com> wrote in message
news:slrnceot3b.2ns.igord@iggypop.redmond.corp.microsoft.com...
> It sounds to me like your reader is working. A way to validate this is to
use
> the Smart Card Resource Manager APIS
> (SCardConnect,SCardTransmit,SCardLocateCards,etcs).
>
>
> The Certificate Control panel applet talks to the smartcard using
Cryptography
> API. Thus to use your smartcard from the Certificate Control Panel you
will
> need a Cryptograhic Service Provider (CSP) for your particular smartcard.
> (See following picture).
>
>
> -------------------------------------
> | Certificate Control Panel Applet
> -------------------------------------
> | Cryptography API
> -------------------------------------
> | Smartcard CSP
> -------------------------------------
> | Smart Card Resource Manager
> -------------------------------------
> | Smart Card Driver
> -------------------------------------
>
> If you need to write a CSP for your built in smartcard, we have a sample
> smartcard CSP available at: public/common/sdk/samples/scwcsp. However,
this
> sample is dependant on a particular smartcard.
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Igor Dvorkin ( igord at microsoft dot com)
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> * visi <zqvisi@hotmail.com>:
> > Hi Igor,
> > because the first card state is SCARD_SWALLOWED, when calling
RDF_CARD_POWER
> > routine, it implements SCARD_COLD_RESET ,then read ATR, just then the
card
> > state is SCARD_NEGOTIABLE. Lastly calling
IOCTL_SMARTCARD_CANCEL_BLOCKING,
> > unload driver.
> > I open Sertificate in Control panel, then select sertificate from smart
> > card,The following debug message is output :
> > ********************
> > 0x8bdf623c: ==>>SCR_Open( )
> > 0x8bdf623c: build-in Smart Card Reader : Open(321ac0) - entered
> > 0x8bdf623c: InitializeDevice
> > 0x8bdf623c: build-in Smart Card Reader : CardState 2
> > 0x8bdf623c: <<==SCR_Open( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = GET_ATTRIBUTE
> > 0x8bdf623c: default
> > 0x8bdf623c: ==>>OCTL_SMARTCARD_GET_ATTRIBUTE
> > 0x8bdf623c: <<==SMCDeviceIoControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = GET_STATE
> > 0x8bdf623c: default
> > 0x8bdf623c: IOCTL_SMARTCARD_GET_STATE
> > 0x8bdf623c: <<==SMCDeviceIoControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = POWER
> > 0x8bdf623c: default
> > 0x8bdf623c: IOCTL_SMARTCARD_POWER
> > 0x8bdf623c: ==>>TLP3ReaderPower( )
> > 0x8bdf623c: SCARD_COLD_RESET
> > 0x8bdf623c: build-in Smart Card Reader !TLP3ReaderPower: Enter (1)
> > 0x8bb14774: build-in Smart Card Reader : SCRSerialEvent(321ac0) -
entered
> > 0x8bdf623c: ==>>SCRio( )
> > 0x8bdf623c: <<==SCRio( )
> > 0x8bdf623c: SCI!SmartcardUpdateCardCapabilities:
> > 0x8bdf623c: ATR:
> > 0x8bdf623c: 3B
> > 0x8bdf623c: 16
> > 0x8bdf623c: 94
> > 0x8bdf623c: 01
> > 0x8bdf623c: 01
> > 0x8bdf623c: 02
> > 0x8bdf623c: 07
> > 0x8bdf623c: 01
> > 0x8bdf623c: 00
> > 0x8bdf623c:
> > 0x8bdf623c: Card parameters from ATR:
> > Fl = 09 (5000 KHz), Dl = 04, I = 00, P = 32, N = 00
> > 0x8bdf623c: PTS parameters (PTS_TYPE_DEFAULT):
> > Fl = 01 (3571 KHz), Dl = 01 (9600 Bps, 2 Stop Bits)
> > 0x8bdf623c: Calculated timing values:
> > Work etu = 105 micro sec, Guard time = 0 micro sec
> > 0x8bdf623c: T=0 Values from ATR:
> > WI = 10
> > 0x8bdf623c: T=0 Timing from ATR:
> > WT = 1008 ms
> > 0x8bdf623c: Mode: Negotiable
> >
> >
> > 0x8bdf623c: build-in Smart Card Reader !TLP3ReaderPower: Exit (0)
> > 0x8bdf623c: <<==TLP3ReaderPower( )
> > 0x8bdf623c: <<==SMCDeviceIoControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = GET_STATE
> > 0x8bdf623c: default
> > 0x8bdf623c: IOCTL_SMARTCARD_GET_STATE
> > 0x8bdf623c: <<==SMCDeviceIoControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = GET_ATTRIBUTE
> > 0x8bdf623c: default
> > 0x8bdf623c: ==>>OCTL_SMARTCARD_GET_ATTRIBUTE
> > 0x8bdf623c: SCARD_ATTR_ATR_STRING
> > 0x8bdf623c: <<==SMCDeviceIoControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> >
> > 0x8bdf623c: ==>>SCR_IOControl( )
> > 0x8bdf623c: ==>>SmartcardDeviceControl( )
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Ioctl = *** UNKNOWN ***
> > 0x8bdf623c: IOCTL_SMARTCARD_CANCEL_BLOCKING
> > 0x8bdf623c: SCI!(SmartcardDeviceControl): Exit
> > 0x8bdf623c: <<==SmartcardDeviceControl( )
> > 0x8bdf623c: <<==SCR_IOControl( )
> > 0x8bdf623c: ==>>SCR_Close( )
> > 0x8bdf623c: build-in Smart Card Reader : Close(321ac0) - entered
> > 0x8bdf623c: ==>>ValidateAndEnterDevice( )
> > 0x8bdf623c: <<==ValidateAndEnterDevice( )
> > 0x8bdf623c: <<==SCR_Close( )
> > ***************************
> > I think after driver returns ATR string to OS by SCARD_ATTR_ATR_STRING
> > of OCTL_SMARTCARD_GET_ATTRIBUTE in Smcioctl.c, OS doesn't recognise ATR
> > correctly or OS doesn't support this type smart card or the ATR string
> > format returned is error, so calling IOCTL_SMARTCARD_CANCEL_BLOCKING.
> > the card that I is using is SIM card issued by china mobile, unsureing
who
> > produces it.
> >
> > I ever use ATR=0x3f\0x67\0x25\0x00\0x21\0x20\0x00\0x0F\0x68\0x90\0x00
rather
> > than reading from card, the card state is SCARD_SPECIFIC, when the ATR
is
> > returnd to OS,IOCTL_SMARTCARD_CANCEL_BLOCKING still is called.
> >
> >
> >
> >
> >
> >



Relevant Pages

  • Re: [SmartCard CSP] How can I obtain a PIN to sign HASH ?
    ... "CRYPT_IMPL_MIXED" means not call other CSP. ... smart card", another is "Use a certificate on this computer". ... first one to logon the wireless network, Windows show me a "Input SmartCard ... show the PIN require dialog box. ...
    (microsoft.public.platformsdk.security)
  • Re: Smartcard CSP Problem
    ... the crypto processor is not a smart card and it has its own crypto ... Would a simple CSP DLL work in this case? ... > You don't need to emulate a smartcard CSP for it to work with S-MIME. ...
    (microsoft.public.platformsdk.security)
  • [SmartCard CSP] How can I obtain a PIN to sign HASH ?
    ... We have created a RSA-FULL CSP based SmartCard. ... Now we are using wireless network connection with EAP (Use SmartCard or ... just like I select "Use my smart card". ...
    (microsoft.public.platformsdk.security)
  • Re: DEBUGCHK error in smartcard
    ... I am looking int the CETK. ... If you do not have a CSP you can communicate with the smartcard by using the ... A smartcard CSP will map CryptoAPI calls into Smart Card Resource ...
    (microsoft.public.windowsce.platbuilder)
  • Re: CAs Key on Smart Card Problem
    ... As far as I know Microsoft is using HSMs for storing the root CA keys. ... advanced CSP may indeed be required. ... >> store the CA's private Key on a Smart Card. ...
    (microsoft.public.windows.server.security)