When card returns OkBytesAvailable(), use the returned number of bytes from sw2 when asking for the next response.

This approach solved problems with "GET RESULT" with a "Feitian Java Card D11CR" running the ykneo applet.
This commit is contained in:
Heiko Schaefer 2021-11-01 21:58:08 +01:00
parent 921e0d22d9
commit 5eea5c861d

View file

@ -45,7 +45,7 @@ pub(crate) fn send_command(
)?)?;
}
while let StatusBytes::OkBytesAvailable(_) = resp.status() {
while let StatusBytes::OkBytesAvailable(bytes) = resp.status() {
// More data is available for this command from the card
log::debug!(" chained response, getting more data");
@ -53,7 +53,7 @@ pub(crate) fn send_command(
let next = RawResponse::try_from(send_command_low_level(
card_client,
commands::get_response(),
Expect::Some,
Expect::Short(bytes),
)?)?;
match next.status() {