JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
how to solve this question?
-
- Posts: 35
- Joined: Wed Jun 20, 2018 4:06 am
- Points :218
- Contact:
how to solve this question?
hello, every boy, who can help me to resolve this question?
Now, I use my tool to test my java cos. there is a test case failure in T0 protocol and success in T1 or TCL.
the command is as followed:
send: 80050000
the right response: 256 bytes data +SW.
the real response: The tool cannot receive anything.
If I modify the commad as followed:
send:80500000
the right response: 255 bytes data +SW
the real response: ==the right response
Now, I use my tool to test my java cos. there is a test case failure in T0 protocol and success in T1 or TCL.
the command is as followed:
send: 80050000
the right response: 256 bytes data +SW.
the real response: The tool cannot receive anything.
If I modify the commad as followed:
send:80500000
the right response: 255 bytes data +SW
the real response: ==the right response
-
- Posts: 11
- Joined: Tue May 22, 2018 9:43 pm
- Points :130
- Contact:
Re: how to solve this question?
hello, you can provide your code here which can help me to parse this question.
-
- Posts: 35
- Joined: Wed Jun 20, 2018 4:06 am
- Points :218
- Contact:
Re: how to solve this question?
public void process(APDU apdu)
{
if (selectingApplet())
{
return;
}
byte[] buf = apdu.getBuffer();
switch (buf[ISO7816.OFFSET_INS])
{
case (byte)0x01:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xaa);
apdu.setOutgoingAndSend((short)0, (short)256);
break;
case (byte)0x02:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xbb);
apdu.setOutgoingAndSend((short)0, (short)255);
break;
default:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
{
if (selectingApplet())
{
return;
}
byte[] buf = apdu.getBuffer();
switch (buf[ISO7816.OFFSET_INS])
{
case (byte)0x01:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xaa);
apdu.setOutgoingAndSend((short)0, (short)256);
break;
case (byte)0x02:
Util.arrayFillNonAtomic(buf, (short)0, (short)256, (byte)0xbb);
apdu.setOutgoingAndSend((short)0, (short)255);
break;
default:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
-
- Posts: 11
- Joined: Tue May 22, 2018 9:43 pm
- Points :130
- Contact:
Re: how to solve this question?
I test the code and the command with JCOP card and the question is still exist.
But the command is ok:
the command( 8005000000) can return 256 bytest data.
so you can modify the command.
But the command is ok:
the command( 8005000000) can return 256 bytest data.
so you can modify the command.
-
- Posts: 35
- Joined: Wed Jun 20, 2018 4:06 am
- Points :218
- Contact:
Re: how to solve this question?
hello boy. I modify my command to be 8005000000 and I can get the right response.
but why?
but why?
-
- Posts: 11
- Joined: Tue May 22, 2018 9:43 pm
- Points :130
- Contact:
Re: how to solve this question?
I guess the reason : the reader handle the command as case 1 and refuse the response data from the card.
-
- Posts: 35
- Joined: Wed Jun 20, 2018 4:06 am
- Points :218
- Contact:
Re: how to solve this question?
i see and thanks very much!
Re: how to solve this question?
T0 is an imperfect protocol. It claims the applet and host on pc knows how many bytes will be translated. You may add setIncomingAndReceive() and try this apdu again.
Who is online
Users browsing this forum: No registered users and 66 guests