qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 2/7] Retrieve the correct TD byte when checking a


From: Jeremy White
Subject: [Qemu-devel] [PATCH v3 2/7] Retrieve the correct TD byte when checking an ATR.
Date: Fri, 13 Mar 2015 14:45:19 -0500

A physical smartcard with an ATR of
  3B 95 95 40 FF AE 01 0E 00 00
was parsed incorrectly.

The '40' should have been the second TD; instead
the FF is used, incorrectly.

Signed-off-by: Jeremy White <address@hidden>
---
 hw/usb/ccid-card-passthru.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 10f1d30..2ae3b81 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -168,8 +168,8 @@ static int check_atr(PassthruState *card, uint8_t *data, 
int len)
             opt_bytes++;
         }
         if (td & 0x8) {
-            opt_bytes++;
             td = data[opt_bytes + 2] >> 4;
+            opt_bytes++;
         }
     }
     if (len < 2 + historical_length + opt_bytes) {
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]