Hi!

Currently, sc_check_apdu checks the length of an R-APDU buffer using
SC_MAX_APDU_BUFFER_SIZE, which defines the maximum length for a C-APDU.
https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L415
https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/apdu.c#L392

A quick fix would be to use 0xff+1/0xffff+1 instead. However, in
multiple files I have seen this wrong usage of SC_MAX_APDU_BUFFER_SIZE
(eg, see `grep rbuf *.c | grep SC_MAX_APDU_BUFFER_SIZE`). Unfortunately
I dont have time to check libopensc in depth, so I leave this up to the
community.

-- 
Frank Morgner

Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE                        http://openpace.sourceforge.net
IFD Handler for libnfc Devices  http://sourceforge.net/projects/ifdnfc

Attachment: pgp9fz0CxMiu6.pgp
Description: PGP signature

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to