Hello,
On Sep 7, 2010, at 12:45 PM, Viktor TARASOV wrote:
> in r4668 the APDU validity condition
> 'apdu->le > 256' was replaced by 'apdu->le > card->max_recv_size'.
> 
> It's comprehensible but revealed the ambiguity of the 'max_recv_size'.
> The unique card's max_recv_size cannot be used to validate all the APDUs 
> of card.
> 
> For example, not all the cards accept Le = 256 for the 'READ BINARY' 
> command,
> but the same card returns 256 bytes of the signature with RSA key 2048bit.

Do you mean Le encoding of 0x00 == 256 and "If Le=0x00, within the limit of 256 
for a short Le field , all the available bytes should be returned."

> My question is,
> should the test 'apdu->le > card->max_recv_size' be removed from the 
> APDU validity control,
> or in each card driver, that can be sensible to this problem, the (for 
> ex.) 'compute_signature' command have
> to enveloped by change/restore of 'max_recv_size'.


Cards that misbehave are usually exceptions. At the same time, a long time ago 
I used to have a serial reader that could only do 24X something in one go. 

If a card driver limits the maximum receive size, the encoding of 0x00 would 
mean that the card driver author knows that Le coding of "all available bytes" 
(0x00) from the card will not be between 0..256 bytes but between 
0..max_recv_size bytes.


-- 
Martin Paljak
@martinpaljak.net
+3725156495

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

Reply via email to