Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Max readers limit #8

Closed
jeppech opened this issue Apr 26, 2016 · 26 comments
Closed

[Question] Max readers limit #8

jeppech opened this issue Apr 26, 2016 · 26 comments

Comments

@jeppech
Copy link

jeppech commented Apr 26, 2016

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
Copy link
Owner

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
Copy link
Author

jeppech commented Apr 26, 2016

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
Copy link
Owner

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
Copy link
Author

jeppech commented Apr 26, 2016

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
Copy link
Contributor

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
Copy link
Author

jeppech commented Apr 27, 2016

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

@LudovicRousseau
Copy link
Owner

@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
Copy link
Contributor

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
Copy link

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

tkx

@LudovicRousseau
Copy link
Owner

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

@catafestaxx
Copy link

#define PCSCLITE_MAX_READERS_CONTEXTS 16
change for
#define PCSCLITE_MAX_READERS_CONTEXTS 24
corret??

@catafestaxx
Copy link

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
Copy link
Author

jeppech commented Oct 12, 2016

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

@ppokhriyal
Copy link

Hello LudovicRousseau ,

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

LudovicRousseau added a commit that referenced this issue Aug 25, 2020
With composite USB devices the pcscd daemon does not know which USB
interface correspond to the CCID reader. So all the interfaces are tried
and this generated critical errors in the logs.

Like:
00000005 readerfactory.c:1110:RFInitializeReader() Open Port 0x200000 Failed (usb:096e/080a:libudev:0:/dev/bus/usb/003/013)
00000002 readerfactory.c:375:RFAddReader() FT ePass2003Auto init failed.

When the driver reports IFD_NO_SUCH_DEVICE then the logs now have a
PCSC_LOG_INFO level so are no more displayed in red and no more present
by default.

Fixes Salsa issue #8
https://salsa.debian.org/rousseau/PCSC/-/issues/8
"Do not report an error if the wrong interface is used by the driver"
@cwimberger
Copy link

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
Copy link
Author

jeppech commented Jan 27, 2021

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

@Fredbongers
Copy link

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
Copy link

Az8th commented Mar 21, 2024

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

@jcardus
Copy link

jcardus commented May 17, 2024

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
Copy link
Owner

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

@jcardus
Copy link

jcardus commented May 17, 2024

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
Copy link

frankviana commented Jul 16, 2024

I have same problem here... limit 16

But how to compile using Ubuntu 23?

@LudovicRousseau
Copy link
Owner

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

@frankviana
Copy link

frankviana commented Jul 16, 2024

I sent you a message.

Thanks

@frankviana
Copy link

frankviana commented Jul 16, 2024

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 <[email protected]>
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:~$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants