While scd/apdu.c assumes a maximum length of 4096 byte for an extended
length APDU, scd/pcsc-wrapper allocates only 1024 byte for the response.

As most certificates are larger than 1024, reading them with extended
length fails.

The attached patch fixes the buffer size.

Andreas
>From 937a7660c83cba6f126415a17dceb9dd054887ef Mon Sep 17 00:00:00 2001
From: Andreas Schwier <andreas.schw...@cardcontact.de>
Date: Fri, 18 Jul 2014 18:22:26 +0200
Subject: [PATCH 2/2] pcsc: Enlarged APDU buffer to 4096, as most certificates
 exceed 1024 byte

---
 scd/pcsc-wrapper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scd/pcsc-wrapper.c b/scd/pcsc-wrapper.c
index e20e111..2e48413 100644
--- a/scd/pcsc-wrapper.c
+++ b/scd/pcsc-wrapper.c
@@ -714,7 +714,7 @@ handle_transmit (unsigned char *argbuf, size_t arglen)
   long err;
   struct pcsc_io_request_s send_pci;
   pcsc_dword_t recv_len;
-  unsigned char buffer[1024];
+  unsigned char buffer[4096];
 
   /* The apdu should at least be one byte. */
   if (!arglen)
-- 
1.7.9.5

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to