Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX SCardTransmit error #48

Open
kevinfiraguay opened this issue Nov 26, 2015 · 6 comments
Open

OSX SCardTransmit error #48

kevinfiraguay opened this issue Nov 26, 2015 · 6 comments

Comments

@kevinfiraguay
Copy link

Hi,
I'm just starting to learn smartcards systems and run into a problem. I have an HID Omikey 5321 CR on OSX El capitan. I installed the drivers from HID for osx. and try to run the exemple code from the node node-pcsclite.
The reader is recognized, and I can read the atr :

card inserted
Protocol( OMNIKEY CardMan (076B:5320) 5321 ): 2
Status( OMNIKEY CardMan (076B:5320) 5321 ): { state: 290,
atr: <Buffer 3b 8f 80 01 80 4f 0c a0 00 00 03 06 03 00 01 00 00 00 00 6a> }

but when it comes to send an APDU it keeps returning me

 [Error: SCardTransmit error: Transaction failed.(0x80100016)]

From the HID device documentation :

Reading all 15 blocks from 0 to 14
Command APDU: ‘FFB0000000’
Response APDE: ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9000’
Attempt to read 16 blocks
Command APDU: ‘FFB0000010’
Response APDE: ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6282’

so I use

reader.transmit(new Buffer([0xFF, 0xB0, 0x00,0x00, 0x00]), 255, protocol, function(err, data) {
... }

But still the same error.

There is surely some steps i missed, so can anyone Help me ?

Thanks in advance

@santigimeno
Copy link
Owner

@kevinfiraguay what kind of card are you inserting in the reader?

@santigimeno
Copy link
Owner

@kevinfiraguay there's usually some sample code in the driver package. Have you tried it? Does it work for you?

@kevinfiraguay
Copy link
Author

Hi, sorry for this late answer and thank you for your reactivity.
The card type is a Mifare classic.
There's no exemple code with the drivers but we do have a java program that works with the card reader and the same card.
It only stop working when i try to send APDU command.

@LudovicRousseau
Copy link
Contributor

@kevinfiraguay your Java program stops working when you try to send APDU commands? I am not sure what you are referring by "It".

You should first try with a simple C program to check your card + reader + driver + PC/SC is working.
See http://ludovicrousseau.blogspot.fr/2010/04/pcsc-sample-in-c.html

You can also check the same C or javascript program on GNU/Linux to check it is not a Mac OS X bug.
See http://ludovicrousseau.blogspot.fr/2015/11/os-x-el-capitan-and-smart-cards-known.html

@kevinfiraguay
Copy link
Author

I'm sorry, my message was not very clear. By "it" I meant my nodejs code.
The Java code works. Thank you for your answers, i'm going to try both your advices and tell you how it worked.
Thanks again

@KarthikEaswaramoorthi
Copy link

hi kevinfiraguay , did you find solution to your problem? please share here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants