Ifdtest2 Part D (SC Reader LOGO) - (Manual Test)
This test verifies the functionality of the smart card reader by validating the PC/SC workgroup test cards. Part D requires the PC/SC test cards.
Test details
Associated requirements |
Device.Input.SmartCardReader.PinDataEntryKeyboardCompliesWithIso Device.Input.SmartCardReader.Supports258And259BytePackets Device.Input.SmartCardReader.SupportsDirectAndInverseConvention Device.Input.SmartCardReader.SupportsNegotiableAndSpecificModes Device.Input.SmartCardReader.SupportsResetCommand Device.Input.SmartCardReader.UsbCcidIssuesNak |
Platforms |
Windows 7 (x64) Windows 7 (x86) Windows RT (ARM-based) Windows 8 (x64) Windows 8 (x86) Windows Server 2012 (x64) Windows Server 2008 R2 (x64) Windows Server 2008 x64 Windows Server 2008 x86Windows RT 8.1Windows 8.1 x64Windows 8.1 x86Windows Server 2012 R2 |
Expected run time |
~5 minutes |
Categories |
Certification Functional |
Type |
Manual |
Running the test
Before you run the test, complete the test setup as described in the test requirements: Smart Card Reader Testing Prerequisites.
Troubleshooting
For troubleshooting information, see Troubleshooting Device.Input Testing.
More information
This test verifies the functionality of the smart card reader by validating the revision two of the PC/SC workgroup test cards.
The test and its hardware must be able to execute specific IFD tests and produce a test report. Specific requirements deal with nominal operation and exceptional operation (error conditions). In addition, these must be applied to all protocols supported by the reader subsystem.
IFDTEST2 performs test cases in three separate test jobs: Reader Interface tests are performed without anything inserted in the reader. Resource Manager Status test cases are performed as a sample card is inserted into and removed from the reader, and do handling of card insertion detection under various conditions (any card can be used for this test).
Card Protocol tests involve operation both with inserted representative ordinarily available smart cards and with special cards that exhibit certain specially programmed behavior. The test cases using ordinarily available cards will perform routine operations on cards selected to represent a variety of communication speed and protocol combinations. These tests have changed with the card-set 2.
Resource manager status test cases
Part A
The card monitor test cases check for correct detection of smart card insertion state and correct handling of operations interrupted by the unexpected removal of the card.
Test detection of empty readers using IOCTL_SMARTCARD_IS_PRESENT
Test detection of inserted card using IOCTL_SMARTCARD_IS_PRESENT
Test removal of inserted card using IOCTL_SMARTCARD_IS_ABSENT
Test correct handling of randomly timed card insert and remove actions for 15 seconds
- Verify that IOCTL_SMARTCARD_IS_PRESENT and IOCTL_SMARTCARD_IS_ABSENT produce valid results
Part C
The resource manager test cases verify successful completion of state change operations normally expected to be commanded by the smart card resource manager.
Verify IOCTL_SMARTCARD_GET_STATE succeeds without card
Verify returned state is valid
Verify correct return from IOCTL_SMARTCARD_IS_PRESENT
Verify correct return from IOCTL_SMARTCARD_IS_ABSENT
Operator inserts a card
Verify IOCTL_SMARTCARD_GET_STATE succeeds with card inserted
Verify returned state is valid
Verify correct return from IOCTL_SMARTCARD_IS_ABSENT
Cold reset the card
Verify card state is SCARD_NEGOTIABLE
Set Card Protocol to T0 or T1
Verify success of IOCTL_SMARTCARD_POWER to turn off the card
Operator removes the card
Verify IOCTL_SMARTCARD_GET_STATE succeeds without a card
Part E
The power management test cases verify that the driver returns the correct state information for the reader across hibernation sequences, even when the state of the reader is changed during hibernation by insertion or removal of a card.
Operator removes all cards
Operator hibernates computer
Operator starts computer
Verify reader state SCARD_ABSENT on return from hibernate
Operator Inserts card
Operator hibernates computer
Operator starts computer
Verify reader state SCARD_PRESENT on return from hibernate
Operator removes card
Operator hibernates computer
Operator removes card during hibernate
Operator starts computer
Verify reader state SCARD_ABSENT on return from hibernate
Operator hibernates computer
Operator inserts card during hibernate
Operator starts computer
Verify reader state SCARD_PRESENT on return from hibernate
Reader interface test cases
Part B
Reader interface test cases check for the correct implementation property and state information at the reader driver.
Check attributes reported by the reader with a sample card inserted
Test that device name reported by the driver is WDM PnP compliant
Test that driver correctly handles attribute read requests with NULL return buffer
Test that driver correctly stops pending i/o requests if the driver is closed and reopened with an i/o operation pending
Test read attributes with no card inserted
SCARD_ATTR_VENDOR_NAME : non-zero-length string
SCARD_ATTR_VENDOR_IFD_TYPE : non-zero-length string
SCARD_ATTR_DEVICE_UNIT : a 4 byte or larger length value
SCARD_ATTR_ATR_STRING : read attempt fails
SCARD_ATTR_DEFAULT_CLK : 1000 <= value <= 20000
SCARD_ATTR_MAX_CLK : 1000 <= value <= 20000
SCARD_ATTR_DEFAULT_DATA_RATE : read attempt succeeds
SCARD_ATTR_MAX_DATA_RATE : read attempt succeeds
SCARD_ATTR_MAX_IFSD : 1 <= value <= 254
SCARD_ATTR_CURRENT_PROTOCOL_TYPE : read attempt fails
Test read attributes with a card inserted
SCARD_ATTR_VENDOR_NAME : non-zero-length string
SCARD_ATTR_VENDOR_IFD_TYPE : non-zero-length string
SCARD_ATTR_DEVICE_UNIT : a 4 byte or larger length value
SCARD_ATTR_ATR_STRING : read attempt succeeds
SCARD_ATTR_DEFAULT_CLK : value 1000 <= value <= 20000
SCARD_ATTR_MAX_CLK : value 1000 <= value <= 20000
SCARD_ATTR_DEFAULT_DATA_RATE : read attempt succeeds
SCARD_ATTR_MAX_DATA_RATE : read attempt succeeds
SCARD_ATTR_MAX_IFSD : 1 <= value <= 254
SCARD_ATTR_CURRENT_PROTOCOL_TYPE : value = 0
Read card state with card removed using IOCTL_SMARTCARD_GET_STATE : state <= SCARD_SWALLOWED
Reset card : verify result is ERROR_UNRECOGNIZED_MEDIA
Card protocol test cases
Part D
Infineon Technologies PC/SC Compliance Test Card (Card 0 / Unlabeled)
ATR: 3B EF 00 00 81 31 20 49
00 5C 50 43 54 10 27 F8
D2 76 00 00 38 33 00 4D
Attempt read with buffer too small
Waiting time extension request - route request figure to file 0001, read back and verify
Block chaining resync test on file 0002: card accepts first block. Then repeatedly requests retransmission of block 2; host resyncs - expect ERROR_IO_DEVICE
Block chaining resync test on file 0002: card repeatedly declares EDC error on block 2; host resyncs - expect ERROR_IO_DEVICE
Wrong block sequence by read to file 0003 - expect ERROR_IO_DEVICE
Ifsc request file id 0004
Force time-out by read to file 0005 - expect ERROR_IO_DEVICE
Read and process result file (A000), parse and report errors
Athena T0 Test Card (Card 1)
ATR: 3B D6 18 00 80 B1 80 6D
1F 03 80 51 00 61 10 30
9E
Reset with long (approx 900 mSec) ATR transmission time
Set Protocol to T0, expect success
Erase all card files by proprietary command, expect success
Create test file 0002, expect success
Select test file 0002, expect success
Write 256 bytes as 4 blocks of 64 bytes, expect success
Read and verify 256 bytes as 4 blocks of 64 bytes, expect success
Write 255 bytes as a single block, expect success. The card will receive the bytes in single-byte mode until 8 bytes remain, at which point the rest of the data will be requested from the host as a single block, expect success
Set receive buffer to 9 bytes and attempt to receive 10 bytes response from card, expect ERROR_INSUFFICIENT BUFFER
Send malformed (Lc inconsistent with data length) select command 00 a4 00 00 08 00, expect ERROR_INVALID_PARAMETER
Select nonexistent file, expect 6A 82
Send command to silence the card (80 00 01 00 01 11), expect ERROR_SEM_TIMEOUT
Reset the card
Send echo command to card to test request wait time extension for extension counts of 1, 2, 5, and 30 extensions, expect success
Athena\Inverse Convention Test Card (Card 2)
ATR: 3F 96 18 80 01 80 51 00
61 10 30 9F
Reset with long (approx 900 mSec) ATR transmission time
Set Protocol to T0, expect success
Erase all card files by proprietary command, expect success
Create test file 0002, expect success
Select test file 0002, expect success
Write 256 bytes as 4 blocks of 64 bytes, expect success
Read and verify 256 bytes as 4 blocks of 64 bytes, expect success
Write 255 bytes as a single block, expect success. The card will receive the bytes in single-byte mode until 128 bytes remain, at which point the rest of the data will be requested from the host as a single block, expect success
Set receive buffer to 9 bytes and attempt to receive 10 bytes response from card, expect ERROR_INSUFFICIENT BUFFER
Send malformed (Lc inconsistent with data length) select command 00 a4 00 00 08 00, expect ERROR_INVALID_PARAMETER
Select nonexistent file, expect 6A 82
Send command to silence the card (80 00 01 00 01 11), expect ERROR_SEM_TIMEOUT
Reset the card
Send echo command to card to test request wait time extension for extension counts of 1, 2, 5, and 30 extensions, expect success
Axalto 32K eGate Test Card (Card 3)
ATR: 3B 95 18 40 FF 62 01 02
01 04
Attempt set protocol T=1, expect ERROR_NOT_SUPPORTED
Set protocol T=0
Authenticate using card transport key, expect success
Clean card state by deleting files from previous runs (Remove RSA public and private key files, the user PIN file, and the test file), expect success
Create new test file 0055, expect success
Test write blocks 1, 25, 75, 128 bytes to test file, expect success
Test read 128 bytes from test file, compare data, expect success
Delete test file 0055, expect success
Create PIN file, expect success
Set user PIN to 00000000, expect success
Create private key file, expect success
Create public key file, expect success
Select private key file, expect success
Authenticate user who has PIN, expect success
Generate key pair, expect success
Hash 16 bytes data, expect success
Get response data to hash operation, 20 bytes + 2 bytes response, expect success
Infineon SiCrypt Card Module Test Card (Card 4)
ATR: 3B DF 18 00 81 31 FE 67
00 5C 49 43 4D D4 91 47
D2 76 00 00 38 33 00 58
Attempt to set protocol T=0, expect ERROR_NOT_SUPPORTED
Set protocol T=1, expect success
Authenticate using PIN 12345678, expect success
Remove files from previous runs if existing
Create new test file 0007, expect success
Select file 0007, expect success
Record system time
Write test blocks of 1, 25, 50, 75, 100, 125, 128 bytes to the card - Read and verify the data after each block write, expect success
Get system time and show elapsed time in seconds for test completion
Select file 0007, expect success
Write 128 byte block of byte value 55, Read back and verify, expect success
Write 128 byte block of byte value AA, Read back and verify, expect success
Write 128 byte block of byte value 00, Read back and verify, expect success
Write 128 byte block of byte value FF, Read back and verify, expect success
Select nonexistent file 7777, expect 9404
Select MF by 00 a4 00 00, expect 90 00 (success)
Select invalid file 77, expect 94 04
Send malformed (Lc inconsistent with data length) select command 00 a4 00 00 08 00, expect 94 04
Send malformed (too short) select command by 00 a4 00, expect 67 00
Create DF 5555 from the MF, expect success
Select into 5555, expect success
Create DF 5656 from 5555, expect success
Select into 5656, expect success
Create File 5757 in DF 5656, expect success
Select that file from MF by full path, expect success
Write 8 bytes to file, Read back and verify, expect success
Delete the selected file, expect success
Attempt to select that file by full path, expect 94 04
Select and delete DF 5656, expect success
Select and delete DF 5555, expect success
Select and delete file 0007, expect success
Running the card reader test
Warning
For the power management test cases in Part D, the computer will hibernate and you may have to remove or reinsert a smart card in the test smart card reader.
Parts A, B, C, and E
Follow the instructions on the screen for Parts A, B, C, and E by using the cards from the PC/SC workgroup test card-set 2. When you are prompted, insert and then remove each smart card from the test smart card reader.
Part D
Follow the instructions on the screen for Part D to complete the four power management test cases. When you are prompted, insert or remove the smart card from the test smart card reader and hibernate or restart the test computer.
To run the Test 1 Card Out/Card Out test case:
Remove the smart card from the test smart card reader.
The computer will automatically hibernate after 15 seconds.
Allow the computer to hibernate for 30 to 60 seconds.
Press the computer power button to bring the computer out of hibernation and continue the test.
When you are prompted, reinsert the smart card in the test smart card reader.
To run the Test 2 Card In/Card Out test case:
Verify that the smart card is in the test smart card reader.
The computer will automatically hibernate after 15 seconds.
Allow the computer to hibernate for 30 to 60 seconds.
Remove the smart card from the test smart card reader.
Press the computer power button to bring the computer out of hibernation.
When you are prompted, reinsert the smart card in the test smart card reader before you start the next test case.
To run the Test 3 Card In/Card In test case:
Verify that the smart card is in the test smart card reader.
The computer will automatically hibernate after 15 seconds.
Allow the computer to hibernate for 30 to 60 seconds.
Press the computer power button to bring the computer out of hibernation.
When you are prompted, remove the smart card from the test smart card reader before you start the next test case.
To run the Test 4 Card Out/Card in test case:
Verify that there is no smart card in the test smart card reader.
The computer will automatically hibernate after 15 seconds.
Allow the computer to hibernate for 30 to 60 seconds.
Reinsert the smart card in the test smart card reader.
Press the computer power button to bring the computer out of hibernation. The smart card reader test is completed.
View the test log files.
Run all of the other required tests.
After you successfully complete all of the tests that are required for this test submission, return the test results.
Command syntax
To run this command outside of HCK Studio, you must stop the Smart Card service, run the command, and then the start the Smart Card service.
Command | Description |
---|---|
ifdtest2.exe -sa -sb -sc -se -sf |
Runs the test. |
File list
File | Location |
---|---|
ifdtest2.exe |
<testbinroot>\nttest\Driverstest\storage\wdk\ |