From 70e72f8c147a9be322324fba265e20efd33954d9 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Sun, 17 May 2015 22:36:31 +0200 Subject: [PATCH] Workaround for getting ATR on OS X 10.10 --- virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c b/virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c index 09824e5..c7ecee3 100644 --- a/virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c +++ b/virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c @@ -237,7 +237,13 @@ IFDHGetCapabilities (DWORD Lun, DWORD Tag, PDWORD Length, PUCHAR Value) } Log2(PCSC_LOG_DEBUG, "Got ATR (%d bytes)", size); +#ifndef __APPLE__ if (*Length < size) { +#else + /* Apple's new SmartCardServices on OS X 10.10 doesn't set the + * length correctly so we only check for the maximum */ + if (MAX_ATR_SIZE < size) { +#endif free(atr); Log1(PCSC_LOG_ERROR, "Not enough memory for ATR"); goto err;