[EMAIL PROTECTED] wrote:
Hi Andreas,

I've found that I can write an EF up to 32K on an eToken Pro 64K. Attempt to write a 32K + 1 byte works but the file
get corrupted.

So, do you think that this is a:
- limitation or bug in CardOS ?
- limitation or bug in OpenSC ?

it's a problem with iso 7816-4 and the current read/write
strategy in opensc. OpenSC writes the 32k+1 bytes in chunks
of <= 256 bytes (as this is the normal maximum data size per APDU
if extended APDUs aren't used). The problem here is that the
maximum offset for READ/UPDATE BINARY is 0x7fff (the highest bit
is reserved for implicit file selection). Our implementation
of READ/UPDATE BINARY apply the mask 0x7fff to the offset =>
when opensc tries to write the 32k+1 byte (offset 0x8000) it
changes the first byte. I will change this so that READ BINARY
etc. return an error in this case.
Theoretically one could read/write up to 64k (the maximum extended
APDU data size) with one read/write operation but that's currently
not supported in opensc.

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

Reply via email to