-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add support for extended length APDUs #4
Comments
I should have handled Lc and Le coded on multiple bytes from the beginning of the project, but I didn't for historical reasons. |
Ok. I'm interested in maintaining compatibility as well. I'm on ARM mac, and there are issues with PCSC.Net on this platform. I'm switching the code I have that uses it over to WSCT-Core, because it "just works". Most of it uses standard length APDUs, but some of it uses extended. I'll implement Nc and Ne to keep consistency with the standard. |
@wsct Is this the kind of thing you were thinking of? https://github.com/mistial-dev/WSCT-Core/commit/d95e9ce5a269e3b4f29622f2acbaedaffab63e0b There is still some work to do, just wanted to make sure I wasn't going to cause conflicts or problems. |
It looks good to me, you successfully grabbed what I was thinking. |
Sounds good. I'll add a bit more testing and exceptions out, then get it out as a Pull Request. |
@wsct XML backwards compatibility requires a minor change. Obviously, if there's a length more than 255, it can be inferred that it must be extended length. When having XML like this, though:
I can't necessarily tell if it's extended or regular length without doing a multi-byte length encoding. I can do Le=XXXX for example (even for a value < 256), but it gets interesting when Le is missing, and UDC is less than 256 bytes. There's no way to encode that "I want an extended APDU, no Le, a couple bytes of UDC" with the current XML setup. |
Spent a bit of time working on the XML serialization, and was able to keep it backwards-compatible and maintain the same XML for non-extended command APDUs. It was necessary to add an extended attribute, but that will not interfere with existing serialized XML. https://github.com/mistial-dev/WSCT-Core/commit/1fc2e7a48ac6b7f60f7526741a4f0ceeb68ffdaf I also implemented equality checking to help with the testing. |
WSCT.Core package updated to 6.3.0 on nuget and github packages. |
At present, APDUs greater than a single byte are not supported:
WSCT-Core/WSCT/ISO7816/CommandAPDU.cs
Line 15 in 4af3dec
I'm going to be adding support here for longer APDUs, and am filing an issue here to reference in commits and pull requests.
The text was updated successfully, but these errors were encountered: