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

Dual interface cards with MF Classic emulation authentication problem #19

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Hi, when I call mifare_classic_authenticate for Classic 1k (sak 0x88) 
everything is fine. But when I do same for Dual interface card i'm getting 
"-1" error code and error:

"error  libnfc.chip.pn53x   Buffer size is too short: 1 available(s), 2 needed"

What can be wrong?

I'm using libnfc 1.7.0 with ACR-122U-A9

Original issue reported on code.google.com by maximch...@gmail.com on 20 Dec 2013 at 11:38

@GoogleCodeExporter
Copy link
Author

Please provide a trace of the execution with:
LIBNFC_LOG_LEVEL=3 mifare_classic_authenticate
I don't have such card so I cannot test myself.

Original comment by yob...@gmail.com on 20 Dec 2013 at 3:58

@GoogleCodeExporter
Copy link
Author

debug   libnfc.chip.pn53x   InDataExchange
debug   libnfc.chip.pn53x   No timeout
debug   libnfc.driver.acr122_usb    TX: 6f 14 00 00 00 00 00 00 00 00 ff 00 00 00 0f 
d4 40 01 60 04 ff ff ff ff ff ff a0 d9 89 78 
debug   libnfc.driver.acr122_usb    RX: 80 07 00 00 00 00 00 00 81 00 d5 41 00 67 00 
90 00 
error   libnfc.chip.pn53x   Buffer size is too short: 1 available(s), 2 needed

Original comment by maximch...@gmail.com on 20 Dec 2013 at 5:11

@GoogleCodeExporter
Copy link
Author

For regular Mifare Classic card it's a little bit different:

debug   libnfc.chip.pn53x   InDataExchange
debug   libnfc.chip.pn53x   No timeout
debug   libnfc.driver.acr122_usb    TX: 6f 14 00 00 00 00 00 00 00 00 ff 00 00 00 0f 
d4 40 01 60 04 ff ff ff ff ff ff e7 38 a1 4a 
debug   libnfc.driver.acr122_usb    RX: 80 05 00 00 00 00 00 00 81 00 d5 41 00 90 00

so I guess second byte of RX is a length of response that probably was 
hardcoded somewhere.

Original comment by maximch...@gmail.com on 20 Dec 2013 at 5:49

@GoogleCodeExporter
Copy link
Author

Ok I figured out that this issue is a duplicate of 
https://code.google.com/p/libnfc/issues/detail?id=229

I added:

nfc_set_property_bool(pnd, NP_AUTO_ISO14443_4, false) 

before calling mifare_classic_connect

and it fixed my problem

Original comment by maximch...@gmail.com on 20 Dec 2013 at 8:26

@GoogleCodeExporter
Copy link
Author

As mifare_classic_connect() implies connecting to MIFARE Classic, which is not 
a ISO14443-4 card, we maybe could disable NP_AUTO_ISO14443_4 feature in 
libfreefare ?

Note: we will need to re-enable it before connection to DESFire.

Original comment by romu...@libnfc.org on 20 Dec 2013 at 10:47

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

This makes sense to me, yes.
Note that at the moment current examples mifare-classic-format etc are also 
buggy.

Original comment by yob...@gmail.com on 20 Dec 2013 at 11:31

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

No branches or pull requests

2 participants