[Pcsclite-muscle] Fixing PCSCLITE_MAX_READERS_CONTEXTS assumption / incompatibility in PCSC protocol
Ludovic Rousseau
ludovic.rousseau at gmail.com
Wed Nov 22 14:15:20 PST 2023
Le mer. 22 nov. 2023 à 22:18, Nathan Kidd <nathan-ml at spicycrypto.ca> a écrit :
>
> Hi,
Hello Nathan,
> Proposed Solution
> =================
>
> 1. Bump PROTOCOL_VERSION_MINOR to 5
>
> 2. If libpcsclite gets a CMD_VERSION reply from pcscd of >= 4.5 then it
> will immediately send a new CMD_SET_READER_COUNT request that looks like:
>
> typedef struct reader_count_struct {
> uint32_t count;
> uint32_t rv;
> };
>
> 3. If pcscd receives a CMD_SET_READER_COUNT it will then use that
> dynamic value for future CMD_GET_READERS_STATE and
> CMD_WAIT_READER_STATE_CHANGE replies, writing that many struct payloads.
> If given an insane count value the server can reply with an error.
I don't like your solution because it does not really fix the problem.
See also:
- use a list instead of a fixed size array for 16 reader states
https://salsa.debian.org/rousseau/PCSC/-/issues/4
- Support multiple versions of the internal protocol: fix Flatpak issues
https://salsa.debian.org/rousseau/PCSC/-/issues/22
> I don't have time to produce this patch immediately but I wanted to get
> the ball rolling to see if there is an agreed technical approach.
> I have been using this solution with success in a custom product[2] but
> it is better for the industry if we have an agreed common solution.
Your link for [2] was missing.
Bye,
--
Dr. Ludovic Rousseau
More information about the pcsclite-muscle
mailing list