-
Notifications
You must be signed in to change notification settings - Fork 712
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
sc_get_response() behavior with multiple GET RESPONSE #131
Comments
If card still has data to return, it should return status value 61xx (6100 if more then 256) . |
The problem is that it does not stop right at As long as |
"For me it works." Are you implementing your own get-response() handle ? The standard get-response handle (from iso7816.c) returns the number of bytes that are still to be read. |
Are you sure you tested with the card supporting short APDU only? This problem is not revealed when extended APDU is used.
at https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L496 is not always = 0, so the
at https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L503 is true and the loop continues.
(https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L483)
https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L463.
No, I just use
More than 256 but not multiple of 256. In fact, the total response length is 270, via two GET RESPONSE (inside
and one more GET RESPONSE is sent. |
Sorry, I still do not understand what are you doing.
How can it be possible? If resplen is 14 (<256), It means that:
And so in the last get-response do{}while cycle it has to be:
|
This is the point of problem: My card (Gnuk) always return
always yield 256. |
As for me, it's not standard behavior. |
Thank Viktor, |
Attempt to use standard common routines for the non-standard card. |
Of course I use standard common routine, which is |
Hello,
I have difficulty geting response data from card when the card only
support shorts APDU and have to use multiple GET RESPONSE commands, done
internally by
sc_transmit_apdu
andsc_get_response
functions.Because I don't know how big returned data will be, I set
apdu.resplen
to a maximum number (say 2048), but after getting enough data (actual
length is less than 2048), the
sc_get_response()
still try to acquiremore and fall to "6D 00" error.
If I set
apdu.resplen = 256
,sc_get_response()
stop when 256 bytes datawas got, regardless there is still more data.
How can I make
sc_get_response()
stop right after it receives "90 00"from card?
I'm working with OpenPGP card in Gnuk device.
The text was updated successfully, but these errors were encountered: