Open JohnMcLear opened 5 years ago
I'm working on some node.js stuff for this uploading challenge. In the meantime, get a copy of the GlobalPlatform spec. It'll explain a lot of the APDUs above.
e.g. see page 209 for an explanation of the secure channel handshake
https://www.win.tue.nl/pinpasjc/docs/Card%20Spec%20v2.1.1%20v0303.pdf
Javascript APDU Parser :: https://github.com/mclear/javascript_apdu_parser/
Working example with node-gp: https://github.com/PaddeK/omni-ring-example
And now https://github.com/PaddeK/omni-ring-example has a CAP to APDU convert example.
Simply run npx -q github:PaddeK/omni-ring-example convert
When I get time I should use nfc-pcsc/cordova nfc to throw these APDUs at a ring and see what I get back
Don't give up on 6A82/6985/error.. It is expected while it tries to auth to various security domains (see below).. The line beginning with
80 E8 00
is where the stack-overflow errored so really we're looking to see if we can get to that point and ideally a 9000 response..Source: https://stackoverflow.com/questions/23670367/upload-a-cap-file-on-smart-card
Thinking: Can I use APDUs to upload a simple Hello world.
If anyone gets to this before me then feel free to action on my behalf =)
Should the APDU above succeed we can progress onto exploring how .jar's are converted to APDUs by the GP tool and hopefully doing that in JS instead of C/Py/Java
nfc-pcsc snippit (hand written w/ no syntax/sanity checking)
For examples of nfc-pcsc usage w/ APDUs see https://gist.github.com/JohnMcLear/5cef778b3582ee6ebac7db4bb91a5fc8
For example of an application that appears to take .cap files in and spit out an APDU script see https://askra.de/software/jcdocs/kit-user-2.2.2/cJDKinstaller.html
It is possible that we host an API that exposes various "scripts" for each .cap/.jar we want to support on the rings and/or make that public/open source for others to contribute their projects. It really depends on how the ecosystem wants to look.
Output