LudovicRousseau / PCSC

pcsc-lite: PC/SC implementation
https://pcsclite.apdu.fr/
Other
263 stars 108 forks source link

[Question] Max readers limit #8

Closed jeppech closed 8 years ago

jeppech commented 8 years ago

Hi Ludovic! First, what a great service!

I was wondering, what is the reason behind the limit of 16 card readers, in both pcsc, and libccid?

LudovicRousseau commented 8 years ago

No real reason. It is historical (and easier).

Feel free to propose a patch to use a (dynamic) list instead of an (fixed) array.

jeppech commented 8 years ago

I wish i could, but I'm not that familiar with C. For now, I'm just editing the header files, and re-compiling when needed.

Thanks for the answer.

LudovicRousseau commented 8 years ago

I is a known "limitation". I created a bug (in 2012) at https://alioth.debian.org/tracker/index.php?func=detail&aid=313579&group_id=30105&atid=410088 and will implement it "when I have time".

jeppech commented 8 years ago

Oh okay. Cool, that it's on your to-do list. We're using this software in multiple servers, having 36 cardreaders attached. So making new binaries, with the limit changed in the source, has not been a problem. :)

frankmorgner commented 8 years ago

Maybe it's worth adding that this limit also applies to the maximum number of available slots. Since every slot of a single reader is treated as a new reader, it is not possible to add more readers (or slots) when a reader with 16 slots is attached.

jeppech commented 8 years ago

I've never thought of, that a reader could consist of several slots. But that makes sense.

LudovicRousseau commented 8 years ago

@frankmorgner, do you know a reader with 16 slots?

The maximum I have in my list is 6 slots for the Elatec TWN4 SmartCard NFC https://pcsclite.alioth.debian.org/ccid/shouldwork.html#0x09D80x0427 but that is a NFC reader so I guess it is 6 "virtual" readers to handle 6 NFC cards at the same time.

The Gemplus GemCore POS Pro Smart Card Reader https://pcsclite.alioth.debian.org/ccid/shouldwork.html#0x08E60x3479 should have 5 real (SIM card) slots.

Not so many (21) readers have more than 1 slots https://pcsclite.alioth.debian.org/select_readers/?bMaxSlotIndex%E2%89%A51

frankmorgner commented 8 years ago

Sure, I have a virtual reader that supports many many slots: https://github.com/frankmorgner/vsmartcard/blob/master/virtualsmartcard/src/ifd-vpcd/ifd-vpcd.c#L36. However, I've choses two slots as default which is enough for most use cases and doesn't block too much space in pcscd.

catafestaxx commented 8 years ago

Olla you help me have 28 cardreaders attached pcscd max reader limit 16 help me for 24 cardreader in pcscd PLIS!!!

tkx

LudovicRousseau commented 8 years ago

@catafestaxx change PCSCLITE_MAX_READERS_CONTEXTS in pcsc-lite src/PCSC/pcsclite.h.in configuration file.

catafestaxx commented 8 years ago

define PCSCLITE_MAX_READERS_CONTEXTS 16

change for

define PCSCLITE_MAX_READERS_CONTEXTS 24

corret??

catafestaxx commented 8 years ago

Scanning present readers... 0: OmniKey CardMan 3121 00 00 1: OmniKey CardMan 3121 01 00 2: OmniKey CardMan 3121 02 00 3: OmniKey CardMan 3121 03 00 4: OmniKey CardMan 3121 04 00 5: OmniKey CardMan 3121 05 00 6: OmniKey CardMan 3121 06 00 7: Gemplus GemPC Twin 07 00 8: OmniKey CardMan 3121 08 00 9: OmniKey CardMan 3121 09 00 10: OmniKey CardMan 3121 0A 00 11: OmniKey CardMan 3121 0B 00 12: OmniKey CardMan 3121 0C 00 13: OmniKey CardMan 3121 0D 00 14: OmniKey CardMan 3121 0E 00 15: OmniKey CardMan 3121 0F 00 SCardGetStatusChange: Invalid parameter given.

jeppech commented 8 years ago

That is correct, also change CCID_DRIVER_MAX_READERS in libccid src/ccid_ifdhandler.h

ppokhriyal commented 5 years ago

Hello LudovicRousseau ,

Can you please help me with Lenovo USB Keyboard SmartCard 17ef:6055 authentication for RDP,FREERDP.

cwimberger commented 3 years ago

Hi,

I'm having trouble to understand the relationship between pcsc-lite and libccid. libccid doesn't seem to be a dependency of pcsc-lite. I've downloaded the source of pcsc-lite from the website can build it without libccid (on debian).

If I want to increase the reader limit do I also have to install libccid from source and patch CCID_DRIVER_MAX_READERS?

jeppech commented 3 years ago

@cwimberger Yes, libccid needs to patched and installed as well.

Fredbongers commented 2 years ago

Hi,

I have 24 cardreaders in pcscd on Ubuntu server 20.04. Changed the following line in /usr/include/PCSC/pcsclite.h to:

define PCSCLITE_MAX_READERS_CONTEXTS 24

Do i need to change some other files before it's working?

Az8th commented 7 months ago

Hello, I would like to know if there is a theorical limit ? (Other than max 255 USB devices including hubs) Thanks !

LudovicRousseau commented 6 months ago

Yes, 255 is the theoretical limit. In practice you are more limited. See:

jcardus commented 5 months ago

I'm using ubuntu 22, when I change PCSCLITE_MAX_READERS_CONTEXTS to something other than 16 everything stops working. I put 16 again and it starts working again. I'm also changing CCID. Am I missing something?

LudovicRousseau commented 5 months ago

@jcardus yes, you are missing something. I suggest you to generate a new .deb package.

jcardus commented 5 months ago

Hello @LudovicRousseau, thanks for you response.

The problem was that meson install apparently doesn't replace /usr/sbin/pcscd. I realized that invoking manually it would work but from the system deamon it wouldn't because it was still referencing the old version.

I ended up copying /usr/local/sbin/pcscd to /usr/sbin/pcscd and it started working.

frankviana commented 3 months ago

I have same problem here... limit 16

But how to compile using Ubuntu 23?

LudovicRousseau commented 3 months ago

@frankviana I can provide a custom Ubuntu package. Contact me by email.

frankviana commented 3 months ago

I sent you a message.

Thanks

frankviana commented 3 months ago

I'm using Lubuntu 23, then I need more 24 card readers. After 15, I have message error ( SCardGetStatusChange: Invalid parameter given.)

lsusb show all connected and recognized.

frankviana@frank-aspirev5123:~$ pcsc_scan
PC/SC device scanner
V 1.6.2 (c) 2001-2022, Ludovic Rousseau <ludovic.rousseau@free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: Gemalto PC Twin Reader 00 00
1: Gemalto PC Twin Reader (BBA3977F) 01 00
2: Gemalto PC Twin Reader 02 00
3: CCID SC Reader (076B:A022) 00 00
4: Gemalto PC Twin Reader 03 00
5: Gemalto PC Twin Reader (DE45C3D3) 04 00
6: Gemalto PC Twin Reader 05 00
7: Gemalto PC Twin Reader (8BC6D1A2) 06 00
8: Gemalto PC Twin Reader (EFBED442) 07 00
9: Gemalto PC Twin Reader 08 00
10: CCID SC Reader (076B:A022) 01 00
11: CCID SC Reader (076B:A022) 02 00
12: CCID SC Reader (076B:A022) 03 00
13: Gemalto PC Twin Reader 09 00
14: Gemalto PC Twin Reader (0A37C1D3) 0A 00
15: Gemalto PC Twin Reader (D655C3F3) 0B 00
 SCardGetStatusChange: Invalid parameter given.
frankviana@frank-aspirev5123:~$ 
frankviana@frank-aspirev5123:~$ uname -a
Linux frank-aspirev5123 6.5.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar  5 21:19:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

frankviana@frank-aspirev5123:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 23.10"
NAME="Ubuntu"
VERSION_ID="23.10"
VERSION="23.10 (Mantic Minotaur)"
VERSION_CODENAME=mantic
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=mantic
LOGO=ubuntu-logo
frankviana@frank-aspirev5123:~$