From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWVnH-00034F-0O for qemu-devel@nongnu.org; Fri, 13 Mar 2015 16:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWVnD-00005a-NY for qemu-devel@nongnu.org; Fri, 13 Mar 2015 16:02:50 -0400 Received: from mail.codeweavers.com ([216.251.189.131]:48560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWVnD-00005S-HP for qemu-devel@nongnu.org; Fri, 13 Mar 2015 16:02:47 -0400 Received: from jwhite.mn.codeweavers.com ([10.69.137.101] helo=jwhite.mn.codeweavers.com.) by mail.codeweavers.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YWVWX-0001m6-Gn for qemu-devel@nongnu.org; Fri, 13 Mar 2015 14:45:33 -0500 From: Jeremy White Date: Fri, 13 Mar 2015 14:45:19 -0500 Message-Id: <1426275924-1904-3-git-send-email-jwhite@codeweavers.com> In-Reply-To: <1426275924-1904-1-git-send-email-jwhite@codeweavers.com> References: <1426275924-1904-1-git-send-email-jwhite@codeweavers.com> Subject: [Qemu-devel] [PATCH v3 2/7] Retrieve the correct TD byte when checking an ATR. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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