On Monday, April 23 at 02:11PM, Nguyễn Hồng Quân wrote: > Hello all, > > I'm starting to code for OpenSC (with the focus on OpenPGP card). > I found in opensc-explorer.c, the do_update_binary() and > do_update_record() function use the buffer of 240bytes in size. > I want to know if 240 is just convention or a limit of something? > I want to replace the hardcode with a defined constant. Do you have a > rule about defining constant: name, which file to place...?
looks like these numbers could indeed be replaced with a define. The buffer size is limitation to the application and is only loosely bound to libopensc. Sometimes [1] SC_MAX_APDU_BUFFER_SIZE is chosen as upper limit, but sc_update_binary, for example, sends multiple APDUs if the buffer doesn't fit into a single command. So I would opt to go for a opensc-explorer specific define. Feel free to fork OpenSC on github and send a pull request, when you're done. See http://www.opensc-project.org/opensc/wiki/GetInvolved for further information. [1] Yes, this is somewhat of inconsistent as it is not always done... -- 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
pgpZ27g4V987V.pgp
Description: PGP signature
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel