-
Notifications
You must be signed in to change notification settings - Fork 918
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
WIP: Adds support for KS X 6924 (T-Money / Snapper+) #811
base: master
Are you sure you want to change the base?
Conversation
Compiling on Windows fails with
|
I'll fix that up Windows problem. What happened with the CI for Windows? I've amended this significantly as it's actually KS X 6924, not KS X 6923. KS X 6923 is for the Purchase SAM (Secure Access Module), not the actual cards issued to end-users: (Note: the picture above comes from one of the docs I've found on this -- it's not mine, and I don't have access to any of these SAMs.) PS: The implementation has been challenging, as I've been unable to get a copy of the standards (the credit card payment gateway used by the Korean Standards Agency is broken), and all of the information is in Korean (which I can't read). So far, this has been the single best public documentation I've found on it: Mobile Deferred Payment Traffic Card - KS X 6924 for SIM card (TTAK.KO-12.0240, Korean, partial English).pdf |
The Windows CI config file is still there in CI/appveyor.yml. I am developing under Windows and therefore use the travis CI tests for Linux and MacOS only. What exactly is the issue with Windows CI? Great work given the sparse information. Google translator does quite a good job even for Korean but the document leaves lot of room for interpretations. Anyone else out there with one of these cards who can test? |
Ah, I was just expecting it to trigger when submitting a PR. Also -- Windows now fixed. I've rebased and squashed the changes, but I had to add an The only problem I see is that the UTF-8 descriptions that are still in Korean (that I have been unable to get a good machine translation of) don't come through properly in the console on Windows 7 -- I think that's a limitation of
Thanks! I forgot to mention -- @phcoder has helped a lot with this, and came up with an implementation for Metrodroid (my transit card reader project). :)
Either T-Money or Snapper+ card work for me (and hopefully, for others). I suspect that there are some other Korean smartcards that would also work with this (eg: Korea Tour Card). For Snapper (Wellington, New Zealand), only cards with a "+" in the top right corner will work with this. As far as I can tell, Korea Smart Card Corporation built much of the infrastructure that supports it, and the on-card data format is very similar. I think there might be a transit card in Peru that uses this as well, but I have no idea which city exactly. |
This card builds on ISO7816-4 application primitives, and "emv" commands can be used for _some_ of the card functionality. However, there is a proprietary "get record" command (in addition to regular "get record"), and a "get balance" command. This only implements support for basic parsing the information in the FCI, and the result of the "get balance" command. No attempt has been made in this code to tell between T-Money and Snapper cards. More info: * https://github.com/micolous/metrodroid/wiki/T-Money * https://github.com/micolous/metrodroid/wiki/Snapper (includes fixups for Windows and naming)
Didn't have a closer look at the code yet. Why do you need arpa/inet.h or winsock2.h at all? Any networking functions?
Afaik only the owner of a github project can arrange that. Not me. |
It is only |
Ah, good to know. On non-Windows platforms, these are pre-processor macros. Over the last few weeks, I've managed to get purchase copies of the standards, and done a bunch of other research. This has more layers of complexity than I first thought, so there is more work needed to support the other Korean cards. However, this doesn't apply to Snapper+... so I still need some of this there. I'm going to get some other code done first before I come back to this. |
Adds support for KS X 6924 application, used by T-Money (South Korea) and Snapper+ (Wellington, New Zealand).
This card builds on ISO7816-4 application primitives, and "emv" commands can be used for some of the card functionality.
However, there is a proprietary "get record" command (in addition to regular "get record"), and a "get balance" command.
This only implements support for basic parsing the information in the FCI, and the result of the "get balance" command.
It currently presumes the constants associated with T-Money, and no attempt has been made in this code to tell between T-Money and Snapper cards -- though I've tested with both.
Commands added:
hf ksx6924 info
: Get info about a KS X 6924 (T-Money, Snapper+) transit cardhf ksx6924 select
: Select application, and leave field uphf ksx6924 balance
: Get current purse balancehf ksx6924 prec
: Send proprietary get record command (CLA=90, INS=4C)Reading a T-Money card:
Reading a Snapper+ card:
Thanks to @phcoder for writing an implementation of T-Money and starting some English-language documentation and reverse engineering of this protocol. :)