STTOOL

STTool, or Smartcard Test Tool, is a piece of software used to test the behavior of test scripts on cards that use SCOSTA, or SCOSTA-CL Smart Card Operating System. STTool uses test scripts which are executed on the smart card with the help of PC/SC interface. It facilitates easy and quick way of performing a sequence of complex related operations on smart cards supporting SCOSTA/SCOSTA-CL OS. This document explains the architectural overview of STTool and elucidates how to use it to actually test the smart cards. This document shall also help future developers of STTool to understand the implementation and architecture of STTool and will enable them to add new components or features. This document shall also help users of STTool, write test scripts to test a smart card.

Introduction

STTool is a tool used for executing test scripts on an ISO7816 smart card. The primary purpose of this tool is to perform tests on a SCOSTA or SCOSTA-CL compliant Smart card Operating System. This tool supports the transport layer in T=0, T=1 and T=CL protocol. The APDUs can be specified in a well understood scripting language which can be interspersed with the C program fragments.

The STTool also supports secure messaging. In this mode, the APDUs can be specified in usual manner but are transported to the smart card using the secure messaging. The script writer has absolute control on the format of the SM on the command and can use it to verify the format on the received response APDUs.

STTool also supports error condition checking. It is possible for the script writer to intentionally provide wrong APDUs or wrong SM specifications and check for the correct behavior of the card (which in this case must be a return SW1 and SW2 to indicate errors).

STTool can also check for the expected values and can report mismatch in case the expected values are not returned by the card.

STTool also handles automatically the warning conditions returned by the card and can handle getting data using GET RESPONSE command if needed.

Features of STTool

The primary purpose of STTool is to execute test scripts that can be written in an easy-to-understand language on an ISO7816 smart card. The script writer shall write ISO commands in a language that is specific to the Tool and can be interpreted by that tool. When built and executed, STTool shall execute these commands on a real smart card one by one. The following list provides a non-exhaustive list of features it provides for user's convenience. The features are mentioned briefly.

  • Status checking - The expected status of the command can be mentioned along with the command specification. This expected status shall be compared against actual status bytes received from the card and a message shall be printed in case of a mismatch.
  • STTool automatically resolves warning conditions. For example, if the status of a command execution is 0x61XX, STTool automatically executes GET RESPONSE command to retrieve the remaining data.
  • STTool supports Secure Messaging
  • Script writes can inter-mix script language with C language constructs. This allows users to be able to perform the necessary calculations to obtain expected values etc. Users can even use the variables defined in these C constructs as part of the script. STTool automatically resolves them.
  • The same code works for both Linux and Windows platforms. On the Linux platform it uses MUSCLE PC/SC Lite APT, while on the Windows platforms it uses PC/SC API.
  • STTool already contains software implementations of various DES based algorithms. These can be used while writing scripts. Adding support for newer algorithms is trivial.
  • Compiler for STTool is written using well established Lex and Yacc infrastructure. This facilitates addition of new language constructs in an easy manner.
Copyright © SmartCard Initiative, IIT Kanpur. All Rights Reserved.