Repository navigation
Treat an absent Le as up to 256 bytes like a YubiKey - #34
FlorianFranzen wants to merge 1 commit into
Conversation
|
Thank you for bringing up this issue. The ISO 7816-4 standard explicitly says (§ 5.1):
For the SELECT command specifically, it says (§ 7.1.1):
So I think we implement the specified behavior correctly and I’m reluctant to deviate from the spec just because the Yubikey does so. Or do you see a reason why this behavior would also be covered by the standard? |
|
Wow, you are completely right. Turns out I was debugging this to long, I just convinced myself this must be the issue. Looked at the trace logs again and ykman actually never showed that behavior. Anyhow, sorry for the noise. |
Yubico ecosystem clients (ykman, yubico-piv-tool, yubikey.rs) send case 3 APDUs without an Le byte and never issue GET RESPONSE after a plain SELECT. apdu-dispatch currently treats the absent Le as "no response data expected" and answers
61XXwith the data held back, which loses those clients entirely. A real YubiKey returns up to 256 bytes directly and chunks only what exceeds that over GET RESPONSE.Covered by a new
echo_without_ledispatch test; also validated end to end against ykman and yubikey.rs through piv-authenticator's vpicc virtual card.