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

No SW2 filtering at protocolTransmit mehtod which is in Terminal.java #46

Closed
GoogleCodeExporter opened this issue May 3, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What's the problem?
at protocolTransmit method which is in Terminal.java, there is no filtering 
options on sw2

according to "ETSI_TS_102_221v070200p_Smart cards_UICC Terminal 
Interface_Physical and logical characteristics" and
"info_isoiec7816-4{ed2.0}en" documentation, SW2 is distinctly decleared as below

SW1  SW2       Description
'63' 'F1' - More data expected
'63' 'F2' - More data expected and proactive command pending
'63' '00' - No information given
'63' '81' - File filled up by the last write
'63' 'CX' - Counter from 0 to 15 encoded by 'X' (exact meaning depending on the 
command)

when rsp is 63XX, it always retransmitting for getResponse. even if SW2 is not 
in above table
when SW1 == 63 && SW2(not in above table), I think it must be send rsp to 
application directly 

What is the expected output? What do you see instead?
Code likely to be fixed.
====================================
protected synchronized byte[] protocolTransmit(byte[] cmd) throws CardException 
{
...
    int sw1 = rsp[rsp.length - 2] & 0xFF;
+    int sw2 = rsp[rsp.length - 1] & 0xFF;
...
-    } else if (rsp.length == 2 && sw1 == 0x63) {
+    } else if (rsp.length == 2 && sw1 == 0x63 && (sw2 == 0xF1 || sw2 == 0xF2 
|| sw2 == 0x00 || sw2 == 0x81 || sw2 == 0xCX)) {
...
}

Original issue reported on code.google.com by dreamy...@gmail.com on 5 Feb 2013 at 6:28

@GoogleCodeExporter
Copy link
Author

updated in SCAPI-3.0.0

ETSI spec would not apply on eSE or MSC as they are not SIM cards. GetResponse 
is now only performed after a 63 10 response code: GP 2.x - more data

Original comment by Daniel.A...@gi-de.com on 15 Apr 2013 at 3:33

  • Changed state: Done

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

1 participant