Hi Martin, thanks for the quick reply.
On Thursday, 7. June 2012, Martin Paljak wrote: > On Thu, Jun 7, 2012 at 10:24 PM, Peter Marschall <pe...@adpm.de> wrote: > > Here they are: > > * What's the exact difference between WRITE BINARY & UPDATE BINARY? > > My understanding of the spec is that WRITE BINARY can extend a file's > > size, while UPDATE BINARY can only update data elements that are already > > within the file (i.e. in the range [0 .. file_size-1]). > > Is my understanding correct or did I misunderstand the specscompletely? > > AFAIU either can change file size (which can be done though 7816-9). > UPDATE will *set* the bits as given in the command, whereas WRITE can > allow some bit-fiddling. > > Why the question? If there would be a card that implements both, I > think you would want to use UPDATE, at least in the context of OpenSC, > unless it is *not* supported and WRITE is supported. > > What exactly is the context? The wish to implement them correctly for the OpenPGP card. > > > * Is it to be considered an error if UPDATE BINARY > > a) uses an idx >= existing_file_size ? > > Probably. '6B00' (offset outside the EF) > > > b) wants to update 0 data elements (i.e. count = 0) ? > > IMHO should not, but implementations might vary, of course. > > > c) idx + count >= existing_file_size? > > Probably. '6B00' (offset outside the EF) > > > * Similar for ERASE BINARY > > a) Can it set data elements to logical erased state beyond the file > > size? i.e. idx + count >= existing_file_size > > b) Is it an error to erase 0 data alements > > i.e. count = 0 > > c) If idx + count >= file_size, does the file get zapped (=shortened) > > to idx data elements? > > Ditto. > > Martin -- Peter Marschall pe...@adpm.de _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel