Proper Hibernate Sequence for Smartcard Driver

Hello Everybody,

I am currently developeing a smartcard driver, and currently I am
trying to test for WHQL Certification. Unfortunately I encounter multiple
errors in the smartcard test (power management section). I was wondering
what is the proper method of ehibernating whent a IOCTL_SMARTCARD_IS_ABSENT
or IOCTL_SMARTCARD_IS_PRESENT is still active.

Currently in the driver when the driver recieves

IRP_MN_SET_POWER requested Type:DevicePowerState PowerDeviceD3

In the callback that is subsequently called I pause pause card traciking in
the device and pause the loop that sends the tracking commands to the
device.

After that when the system wakes up with

IRP_MN_SET_POWER requested Type:DevicePowerState PowerDeviceD0

In the callback that follows, I restart the tracking thread so that the
tracking command can be resent to the card reader.

Unfortunately the driver fails in the smartcard tests. Am I doing the right
thing for tracking?

Best regards,
Rikki Tamayo

It’s been some years since I wrote a smart card driver, but your posting did
invoke a few memories.

As I remember, the issue with power management and crypto smart cards (or
any crypto hardware) is you can’t just put them to sleep and expect them to
wake back up without the user authenticating with a password. You also can’t
save their state, as that would destroy the cryptographic value (some/many
smart cards you can’t even read the state, you can only get things online
with proper authentication). The smartcard reader I worked on actually had a
keypad, and firmware in the reader on command would transfer the password
into the smartcard without even passing through the computer.

My very fuzzy memory was I had to simulate a remove/insert cycle in the
driver if the system suspended or hibernated. This was the only way to force
an authentication cycle, to get the smart card back online.

  • Jan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rikki Tamayo
Sent: Thursday, April 21, 2005 5:29 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Proper Hibernate Sequence for Smartcard Driver

Hello Everybody,

I am currently developeing a smartcard driver, and currently I am
trying to test for WHQL Certification. Unfortunately I encounter multiple
errors in the smartcard test (power management section). I was wondering
what is the proper method of ehibernating whent a IOCTL_SMARTCARD_IS_ABSENT
or IOCTL_SMARTCARD_IS_PRESENT is still active.

Currently in the driver when the driver recieves

IRP_MN_SET_POWER requested Type:DevicePowerState PowerDeviceD3

In the callback that is subsequently called I pause pause card traciking in
the device and pause the loop that sends the tracking commands to the
device.

After that when the system wakes up with

IRP_MN_SET_POWER requested Type:DevicePowerState PowerDeviceD0

In the callback that follows, I restart the tracking thread so that the
tracking command can be resent to the card reader.

Unfortunately the driver fails in the smartcard tests. Am I doing the right
thing for tracking?

Best regards,
Rikki Tamayo


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@pmatrix.com
To unsubscribe send a blank email to xxxxx@lists.osr.com