From 8d409023bf449430f23c5f2b1cd4df15a676c6c6 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 31 May 2022 00:04:46 +0200 Subject: [PATCH] Fix Ne value for legacy apdu. --- src/ccid/ccid2040.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ccid/ccid2040.c b/src/ccid/ccid2040.c index 1184a0a..2d81d10 100644 --- a/src/ccid/ccid2040.c +++ b/src/ccid/ccid2040.c @@ -255,7 +255,7 @@ static int usb_event_handle() { apdu.nc = apdu.header[4]; apdu.data = apdu.header+5; apdu.ne = 0; - if (apdu.nc+5+2 == ccid_header->dwLength) { + if (apdu.nc+5+1 == ccid_header->dwLength) { apdu.ne = apdu.header[ccid_header->dwLength-1]; if (apdu.ne == 0) apdu.ne = 256;