<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 21:23 GMT+01:00 Marcin Cieslak <span dir="ltr"><<a href="mailto:saper@saper.info" target="_blank">saper@saper.info</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, 13 Nov 2015, Ludovic Rousseau wrote:<br>
<br>
> 2015-11-13 15:35 GMT+01:00 Marcin Cieslak <<a href="mailto:saper@saper.info">saper@saper.info</a>>:<br>
><br>
</span><span class="">> > This happens when passing data to CT API:<br>
> ><br>
> >         char CT_data(unsigned short ctn,        /* Terminal Number */<br>
> >                      unsigned char *dad,        /* Destination */<br>
> >                      unsigned char *sad,        /* Source */<br>
> >                      unsigned short lc, /* Length of command */<br>
> >                      unsigned char *cmd,        /* Command/Data Buffer */<br>
> >                      unsigned short *lr,        /* Length of Response */<br>
> >                      unsigned char *rsp /* Response */<br>
> ><br>
> > The supplied buffer length on my system, 65548 (hex 0x1000c) gets<br>
> > downcast to (unsigned short), which is 12.<br>
> ><br>
> > CT-API will not accept a buffer longer than 64KB. (No wonder given its<br>
> > origins).<br>
> ><br>
><br>
> Maybe you can fix CT-API API to use "unsigned int" for a buffer size<br>
> instead of "unsigned short".<br>
<br>
</span>No, one can't. The CT-API specification says the length of response<br>
is "IU16" - integer, unsigned, 16bit.<br>
<br>
<a href="https://www.tuvit.de/cps/rde/xbcr/tuevit_de/CTAPI11EN.pdf" rel="noreferrer" target="_blank">https://www.tuvit.de/cps/rde/xbcr/tuevit_de/CTAPI11EN.pdf</a><br>
<br>
as far as I know most card readers produced or designed in Germany<br>
use CT-API internally even if they expose PC/SC interface.<br></blockquote><div><br></div><div>Well, maybe not fix CT-API but at least fix the driver you are using.<br></div><div>I guess you do not use CT-API if you use PC/SC.<br></div><div>CT-API is just an internal API.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I seriously doubt such the readers accept larger buffer sizes.<br>
<br>
8eb9ea1b354b050f997d003cf3b0c5b56f29f9f7 is strange because<br>
requested buffer size given by the client application is no<br>
longer used(!), only maximal value is used.<br></blockquote><div><br></div><div>The size given by the client is used to report an error if the buffer is too small.<br clear="all"></div></div>The test is performed _after_ the command has been sent to the cardreader + card.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I do not plan to change pcsc-lite just because CT-API is limited.<br><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- <br><div class="gmail_signature"> Dr. Ludovic Rousseau</div>
</div></div>