OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: How does Smclib handle T=1 transmission

From: Vladimir Beker (Vladimir.BekerEALADDIN.COM)
Date: Wed Dec 10 2003 - 06:41:29 CST


This is example of code from MSDN.
The idea simple (less or more): you perform SmartcardT1Request. It prepares
T=1 block for you. You send it to the device, get the answer, put it back
into the structure and call SmartcardT1Reply.If the return value is
STATUS_MORE_PROCESSING_REQUIRED you should continue since handling of APDU
is not finished yet. Otherwise you are finished (successfully or not).
I don't remember in which fields of SmartcardExtension you have
incoming/outgoing APDU and in which fields you have T=1 block, but I'm sure
there is sample in DDK.

// Run this loop as long as the protocol requires to send data
do {
    // Copy data to SmartcardExtension->SmartcardRequest.Buffer
    // embedded in a T=1 frame
    status = SmartcardT1Request(SmartcardExtension);
    if (status != STATUS_SUCCESS)
        return status;

    // Send T=1 frame to smart card
    status = DriverSendDataToSmartcard(?);
    if (status != STATUS_SUCCESS)
        return status;

// Now set appropiate timeout (This example calculates the time-out in ms)
// Timeout = SmartcardExtension->CardCapabilities.T1.BWT *
// (SmartcardExtension->T1.Wtx ? SmartcardExtension->T1.Wtx : 1);

    // receive T=1 frame from smart card
    status = DriverReceiveDataFromSmartcard(?);
    if (status != STATUS_SUCCESS)
        return status;

    // Check T=1 protocol status and copy any data back to user buffer
    status = SmartcardT1Reply(SmartcardExtension);

} while (status == STATUS_MORE_PROCESSING_REQUIRED);

return status;

Vladimir Beker

Aladdin. Securing the Global Village.
P.O. Box 11141, Tel Aviv 61110 Israel
Tel: +972 3 636-2222; Fax: +972 3 537-5796
Visit us at our Web site! http://www.eAladdin.com

Aladdin supports Idealist. Visit http://www.idealist.org

On 12/10/2003 05:57:49 PM ZE8 Angela wrote:
>
>Dear all,
>
>I would like to ask, how does smclib handle T=1 transmission? what will it
do?
>Thanks thanks a lot for your kind help in advance.
>
>Rgds,
>Angela
>

******************************* IMPORTANT ! **********************************
The content of this email and any attachments are confidential and intended
for the named recipient(s) only.

If you have received this email in error please notify the sender immediately.
Do not disclose the content of this message or make copies.

This email was scanned by eSafe Mail for viruses, vandals and other
malicious content.
******************************************************************************