Djole
Djole

Reputation: 142

T=1 smart card protocol

I have question related to T= 1 Smart Card communication protocol. Let's say terminal sends I-block with expected Ne data to be returned from the card (so called case 2S) and card has less data to send. Does it mean that terminal should wait until timeout and then inspect whatever received for last two bytes (which should be SW1 and SW2 statuses) ? Or is there some other scenario related to that issue ? With T= 0 protocol that issue is addressed by procedure byte, however in T= 1 I only see the above way.

Thanks

Upvotes: 2

Views: 3039

Answers (1)

Maarten Bodewes
Maarten Bodewes

Reputation: 94058

guidot maybe claims that he's not an expert, but I would not believe him.

The Ne value (encoded using Le) indeed only indicates a maximum number of bytes to be returned. You might just have a buffer size of a particular maximum or have overhead (secure messaging) that prohibits using higher values. You may however have APDU commands where Ne is used to indicate the amount of bytes that should be sent if available, such as READ BINARY.

The size of the (response) APDU is determined by the underlying datalink layer (the chaining bit and LEN bytes used in the blocks within the frames). T=1 is not a byte oriented protocol such as T=0. For T=1 and indeed T=CL the datalink layer determines the size of the command and response APDU, not the application layer with the Nc and Ne bytes.

Upvotes: 1

Related Questions