-
Notifications
You must be signed in to change notification settings - Fork 135
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
Bugfix AID length + bugfix reading beyond block 255 + add readClass option #55
Conversation
martijnthe
commented
Nov 29, 2018
- Fixes Malformed SELECT FILE command? #54
- Enables reading beyond block 255 / 0xFF
- Add readClass option to read() method to change the default/hard-coded 0xFF Class
…instead of the hard-coded 0xFF class)
Hi @martijnthe, thank you very much for your PR! 👍 Could you just please explain what your use-case of specifying the read class is? According to the documentation of the Class byte in the section 5.4.1 is can be used to indicate:
If you were able to give some examples, it would be really helpful. 🙂 Eventually, it could be reasonable to allow specifying the class in other commands, too. (e.g. in the WRITE command). Thanks. |
I’m reading the NDEF records from a type 4 tag inside a device (Elsys sensor). I was looking at how another program (https://itunes.apple.com/us/app/nfc-ideas/id1245536234?mt=12) was reading the tag. It involved setting the class to zero. I don’t know why (I know very little about these protocols) but with the default 0xFF it was not working. |
@martijnthe OK Thanks for explanation. I'll add the note about reading from Elsys sensors into the docs. 🙂 |
Hi, I have a big problem, I can't authenticate and it seems that it doesn't receive the correct KeyType, I don't know if it's because it converts it from hex to decimal or I don't know, it's a mifare classic 1k, I can read the UID but I can't authenticate for R / W on the card I would appreciate any help, I've been with this for days |
Hi @alanezze, Thank you for posting your problem here. I think that I know what the cause is (thanks to your screenshot). Let me explain: nfc-pcsc supports mainly ACR122 USB reader but other PC/SC compliant devices normally also work with nfc-pcsc (out-of-the-box). From the screenshot, you posted, it seems that you are using OMNIKEY 5422 NFC reader. In nfc-pcsc, a new instance of Reader class is created upon the reader connection class). If it is a known supported device, a special subclass of Reader is created, for example ACR122Reader (it is done here in NFC. The subclass can modify the behavior / implement special functions in respect with the reader API docs. As I mentioned above, most PC/SC readers will work out-of-the-box via Reader class. However, on OMNIKEY 5422, loading of MIFARE Classic keys into the reader memory (part of the authentication, I looked into the OMNIKEY 5422 Software Developer Guide and in the section 11.1.3, there is a description for the The MIFARE Classic authentication implementation on PC/SC readers requires that a key that is used in The problem is, that current implementation of Possible solutions:
Right now, I am working on PoC for 1. and will soon post instructions on how to install and test a modified version of nfc-pcsc. Hope it helps. 🙂 PS Don't forget to star ⭐️ my library, if you find it useful. 😃 Thanks. |
Hi @alanezze, I rewrote the PC/SC Authentication implementation in You can find an updated MIFARE Classic example here. To test it locally, please run: git clone https://github.com/pokusew/nfc-pcsc.git
cd nfc-pcsc
git checkout universal-pcsc-authentication
yarn # or npm install
yarn run example-mifare-classic # or npm run example-mifare-classic Please let me know, if it works for you. 🙂 |
You are the genius of the Mifare, I read and write perfectly, highly
recommended, although I missed that of the authentication structure,
you are a genius
El jue, 18 feb 2021 a las 17:25, Martin Endler (<notifications@github.com>)
escribió:
… Hi @alanezze <https://github.com/alanezze>,
I rewrote the PC/SC Authentication implementation in Reader class to be
more universal (branch #universal-pcsc-authentication
<https://github.com/pokusew/nfc-pcsc/tree/universal-pcsc-authentication>).
😅 Now it is fully configurable and it should work (not only) on OMNIKEY
5422.
You can find an updated MIFARE Classic example here
<https://github.com/pokusew/nfc-pcsc/blob/universal-pcsc-authentication/examples/mifare-classic.js>.
To test it locally, please run:
git clone https://github.com/pokusew/nfc-pcsc.git
cd nfc-pcsc
git checkout universal-pcsc-authentication
yarn # or npm install
yarn run example-mifare-classic # or npm run example-mifare-classic
Please let me know, if it works for you. 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ5MH6HVVU5727WJDJK23N3S7VZTHANCNFSM4GHHF5EQ>
.
|
@martijnthe Would you remember what your authentication key was for the sensors? I can't seem to get the key correct to try read from them |
@ColinMall94 i don’t recall there being any auth involved. |
@martijnthe Thanks for the response. Having a tough time getting it to return a valid response. Could be my ACR122u though... |
@martijnthe May i ask what reader you used to read the elsys sensors? |