JP6182940B2 - IC card, status word output method, and status word output processing program - Google Patents

IC card, status word output method, and status word output processing program Download PDF

Info

Publication number
JP6182940B2
JP6182940B2 JP2013078608A JP2013078608A JP6182940B2 JP 6182940 B2 JP6182940 B2 JP 6182940B2 JP 2013078608 A JP2013078608 A JP 2013078608A JP 2013078608 A JP2013078608 A JP 2013078608A JP 6182940 B2 JP6182940 B2 JP 6182940B2
Authority
JP
Japan
Prior art keywords
status word
command
error
list
external terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2013078608A
Other languages
Japanese (ja)
Other versions
JP2014203248A (en
Inventor
正剛 福永
正剛 福永
康介 奈良
康介 奈良
哲夫 神力
哲夫 神力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2013078608A priority Critical patent/JP6182940B2/en
Publication of JP2014203248A publication Critical patent/JP2014203248A/en
Application granted granted Critical
Publication of JP6182940B2 publication Critical patent/JP6182940B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、コマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードを外部端末へ応答するICカードの技術分野に関する。   The present invention relates to a technical field of an IC card that responds to an external terminal with a status word corresponding to the content of an error when an error occurs during command processing.

国際標準規格であるISO/IEC7816が適用されるICカードは、APDU(Application protocol data unit)と呼ばれるデータ列を有するコマンドを外部機器から受信し、そこに示されている情報を基に、処理するコマンドを切り替える。どのコマンドを実行するかはAPDU内の情報を基に切り替えるが、コマンドの処理中にエラーが発生した場合、ICカードは、エラーに応じたステータスワード(SW)を外部端末へ応答する。このようなステータスワードは、例えば、「PINが一致しない」、「有効期限が切れている」、「アクセス権限がない」、「対象のファイルが存在しない」などの異常終了を示すことが可能になっている(例えば特許文献1参照)。このような異常終了を示すステータスワードによって、外部端末は、どのようなエラーが発生したかを認識することができる。   An IC card to which ISO / IEC7816, which is an international standard, is applied receives a command having a data string called APDU (Application Protocol Data Unit) from an external device and processes it based on the information indicated there. Switch commands. Which command is executed is switched based on information in the APDU, but if an error occurs during command processing, the IC card responds to the external terminal with a status word (SW) corresponding to the error. Such a status word can indicate an abnormal end such as “PIN does not match”, “expiration expired”, “no access authority”, “the target file does not exist”, etc. (For example, refer to Patent Document 1). With such a status word indicating abnormal termination, the external terminal can recognize what kind of error has occurred.

特開2011−216068号公報JP 2011-2160868 A

ところで、異常終了を示すステータスワードは、ICカードに対してランダムアタックを行う不正な攻撃者にも有用な情報として働く場合がある。例えば、攻撃者がICカードへランダムにコマンドを与えた場合において、サポートされている(INSが提供されている)コマンドであるとき、正常終了又は異常終了を示す正規のステータスワードが応答されてしまので、当該コマンドが存在する(サポートされている)ことが攻撃者に把握されてしまうという問題がある。この問題を解決するため、コマンドの処理中にエラーが発生した場合、正規のステータスワードを、コマンドがサポートされていない(INSが提供されていない)ことを示す非正規のステータスワードに一括で変更して(つまり、ステータスワードを選択的に切り替えて)応答する方法が考えられる。しかしながら、ステータスワードを一括で変更した場合、ICカードの正規の使用者はコマンドの処理中のどの箇所で(どのような理由で)エラーとなったのかを把握することができなくなるという問題が生じる。   By the way, the status word indicating abnormal termination may serve as useful information even for an unauthorized attacker who performs a random attack on the IC card. For example, when an attacker gives a command to an IC card at random, if the command is supported (INS is provided), a normal status word indicating normal end or abnormal end is returned. Therefore, there is a problem that the attacker knows that the command exists (is supported). To solve this problem, if an error occurs during command processing, change the legitimate status word to a non-canonical status word indicating that the command is not supported (INS is not provided). Then, a method of responding (that is, selectively switching the status word) can be considered. However, when the status word is changed at once, there is a problem that an authorized user of the IC card cannot grasp where (for what reason) the error occurred during the processing of the command. .

そこで、本発明は、上記問題等に鑑みてなされたものであり、コマンドの存在を攻撃者に把握されることなく、正規の使用者にどの箇所でエラーとなったのかを把握させることが可能なICカード、ステータスワード出力方法、及びステータスワード出力処理プログラムを提供することを目的とする。   Therefore, the present invention has been made in view of the above problems and the like, and it is possible for an authorized user to understand where an error has occurred without the attacker knowing the existence of the command. It is an object to provide a smart card, a status word output method, and a status word output processing program.

上記課題を解決するために、請求項1に記載の発明は、コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶する記憶手段と、外部端末からコマンドを受信する受信手段と、前記受信手段により受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答する応答手段と、を備え、複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信手段により受信されたコマンドが受信された時に一括で切り替えられることを特徴とする。 In order to solve the above-mentioned problem, the invention according to claim 1 supports a normal status word indicating that a command is supported for each of the contents of a plurality of different errors during processing of the command, and the command. Storage means for storing a list that holds in advance either one of the non-regular status words indicating that the command has not been received, receiving means for receiving a command from an external terminal, and during processing of a command received by the receiving means If an error occurs, a status word corresponding to the contents of the error, and a response means for responding the status word held in said list to said external terminal, and the error for a plurality of different commands Each status word for each content of the message is collectively displayed when the command received by the receiving means is received. And wherein the be Toggles.

請求項2に記載の発明は、請求項1に記載のICカードにおいて、前記リストは、複数の異なるコマンドごとに、且つ前記エラーの内容ごとに、前記正規のステータスワードと前記非正規のステータスワードとの何れか一方を予め保持することを特徴とする。   According to a second aspect of the present invention, in the IC card according to the first aspect, the list includes the normal status word and the non-normal status word for each of a plurality of different commands and for each error content. One of the above is held in advance.

求項に記載の発明は、コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶するステップと、外部端末からコマンドを受信する受信ステップと、前記受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答するステップと、を含み、複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信ステップにより受信されたコマンドが受信された時に一括で切り替えられることを特徴とする。 The invention described in Motomeko 3, for each content of a plurality of different errors during processing of the command, the status word of the normal indicating that the command is supported, non-regular indicating that the command is not supported Storing a list that holds one of the status words in advance, a receiving step for receiving a command from an external terminal, and if an error occurs during processing of the received command, a corresponding status word, look including the steps of: responding to said status word held in said list to said external terminal, each said status word for each of the contents of a plurality of different commands each and the error, the When the command received by the receiving step is received, it is switched at once .

請求項に記載の発明は、コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶する記憶手段を備えるICカードに含まれるコンピュータを、外部端末からコマンドを受信する受信手段、及び前記受信手段により受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答する応答手段として機能させ、複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信手段により受信されたコマンドが受信された時に一括で切り替えられることを特徴とする。 The invention according to claim 4 includes, for each of a plurality of different error contents during processing of a command, a normal status word indicating that the command is supported, and a non-genuine indicating that the command is not supported. A computer included in an IC card that includes a storage unit that stores a list that holds either one of the status words in advance, a receiving unit that receives a command from an external terminal, and a command received by the receiving unit during processing When an error occurs, a status word corresponding to the content of the error, the status word held in the list functioning as a response means for responding to the external terminal, and for each of a plurality of different commands and the error Each status word for each content includes a command received by the receiving means. Characterized in that it is switched at once when it is trust.

本発明によれば、コマンドの存在を攻撃者に把握されることなく、正規の使用者にどの箇所でエラーとなったのかを把握させることが可能なICカード、ステータスワード出力方法、及びステータスワード出力処理プログラムを提供する。   According to the present invention, an IC card, a status word output method, and a status word that allow a legitimate user to grasp where an error has occurred without the attacker knowing the presence of the command. An output processing program is provided.

ICカード1の概要構成例を示す図である。1 is a diagram illustrating a schematic configuration example of an IC card 1. FIG. APDUから構成されるコマンドのフォーマットの一例を示す図である。It is a figure which shows an example of the format of the command comprised from APDU. SWリストの内容の一例を示す図である。It is a figure which shows an example of the content of SW list. CPU11におけるコマンドの処理を示すフローチャートである。It is a flowchart which shows the process of the command in CPU11.

以下、図面を参照して本発明の実施形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

先ず、図1を参照して、本実施形態に係るICカードについて説明する。図1は、ICカード1の概要構成例を示す図である。なお、ICカード1は、キャッシュカード、クレージットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等に組み込まれる。   First, an IC card according to the present embodiment will be described with reference to FIG. FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. The IC card 1 is used as a cash card, a credit card, an employee card, or the like. Alternatively, the IC card 1 is incorporated into a smartphone, a mobile phone, or the like.

図1に示すように、ICカード1には、ICチップ1aが搭載されている。ICチップ1aは、CPU(Central Processing Unit)11、RAM(Random Access Memory)12、フラッシュメモリ13、及びI/O回路14を備えて構成される。なお、フラッシュメモリの代わりにEEPROM(Electrically Erasable Programmable Read-Only Memory)であっても構わない。   As shown in FIG. 1, an IC chip 1 a is mounted on the IC card 1. The IC chip 1a includes a CPU (Central Processing Unit) 11, a RAM (Random Access Memory) 12, a flash memory 13, and an I / O circuit 14. Note that an EEPROM (Electrically Erasable Programmable Read-Only Memory) may be used instead of the flash memory.

CPU11は、各種プログラムを実行するコントローラであり、外部端末2からコマンドを受信し、当該受信したコマンドの処理を実行する。CPU11は、本発明における受信手段及び応答手段の一例である。外部端末2は、ICカード1との間で接触または非接触で通信を行うためのリーダーライタを備える。外部端末2の例としてはATM、改札機、認証用ゲート等が挙げられる。なお、外部からの攻撃者の外部端末がICカード1の通信相手となる場合もある。I/O回路14は、外部端末2とのインターフェイスを担う。I/O回路14には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部端末2とのデータ通信を行う端子である。   The CPU 11 is a controller that executes various programs, receives a command from the external terminal 2, and executes processing of the received command. The CPU 11 is an example of a receiving unit and a response unit in the present invention. The external terminal 2 includes a reader / writer for performing communication with or without contact with the IC card 1. Examples of the external terminal 2 include an ATM, a ticket gate, and an authentication gate. Note that an external terminal of an attacker from the outside may be a communication partner of the IC card 1. The I / O circuit 14 serves as an interface with the external terminal 2. The I / O circuit 14 is provided with eight terminals C1 to C8 defined by, for example, ISO / IEC7816. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal that performs data communication with the external terminal 2.

なお、外部端末2から受信されるコマンドは、ヘッダとボディを含むAPDUと呼ばれるデータ列から構成される。図2は、APDUから構成されるコマンドのフォーマットの一例を示す図である。コマンドの構成には、図2(A)〜(D)に示すように、幾つかのバリエーションがあり、何れの場合も、ヘッダは、CLA(命令クラス)、INS(命令コード)、P1(命令パラメータ1)、及びP2(命令パラメータ2)からなる。一方、ボディは、無い場合(図2(A))と、Leフィールドからなる場合(図2(B))と、Lcフィールド及びデータ(Data)フィールドからなる場合(図2(C))と、Lcフィールド、データフィールド、及びLeフィールドからなる場合(図2(D))とがある。   Note that the command received from the external terminal 2 includes a data string called APDU including a header and a body. FIG. 2 is a diagram illustrating an example of a format of a command composed of APDUs. As shown in FIGS. 2A to 2D, there are several variations in the configuration of the command. In any case, the header includes CLA (instruction class), INS (instruction code), P1 (instruction Parameter 1) and P2 (command parameter 2). On the other hand, when there is no body (FIG. 2 (A)), when it consists of a Le field (FIG. 2 (B)), when it consists of a Lc field and a data (Data) field (FIG. 2 (C)), In some cases, the field is composed of an Lc field, a data field, and a Le field (FIG. 2D).

RAM12は、データを一時的に記憶する揮発性メモリである。RAM12の所定の記憶領域は、通信用バッファとして使用される。通信用バッファに格納されたデータは、I/O回路14を介して外部端末2へ出力されることになる。フラッシュメモリ13は、プログラム(本発明のステータスワード出力処理プログラムを含む)やデータを格納する不揮発性メモリである。フラッシュメモリ13(記憶手段の一例)には、複数の異なるコマンドごとに、且つコマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリスト(以下、「SWリスト」という)が記憶される。正規のステータスワードと非正規のステータスワードは、双方とも異常終了を示すステータスワードである。なお、SWリストには、正常終了を示すステータスワードが保持されていてもよい。   The RAM 12 is a volatile memory that temporarily stores data. A predetermined storage area of the RAM 12 is used as a communication buffer. The data stored in the communication buffer is output to the external terminal 2 via the I / O circuit 14. The flash memory 13 is a nonvolatile memory that stores programs (including the status word output processing program of the present invention) and data. The flash memory 13 (an example of a storage unit) includes a normal status word indicating that a command is supported for each of a plurality of different commands and for each of a plurality of different error contents during command processing, and a command A list (hereinafter, referred to as “SW list”) that stores in advance either one of the non-regular status words indicating that is not supported is stored. The regular status word and the non-regular status word are both status words indicating abnormal termination. Note that a status word indicating normal termination may be held in the SW list.

図3は、SWリストの内容の一例を示す図である。図3において、sw_set[0]は、正常終了を示すステータスワードであり、全てのコマンドで共通のステータスワード「9000h」になっている。一方、sw_set[1]〜sw_set[3]は、エラーの内容に対応する異常終了を示すステータスワードであり、コマンドごとに異なる場合もあれば同一である場合もある。   FIG. 3 is a diagram illustrating an example of the contents of the SW list. In FIG. 3, sw_set [0] is a status word indicating normal termination, and is a status word “9000h” common to all commands. On the other hand, sw_set [1] to sw_set [3] are status words indicating abnormal termination corresponding to the content of the error, and may be different or the same for each command.

図3に示す「SELECT FILE」コマンドの場合、sw_set[1]は、対象のファイルの存在有無チェック処理の結果、対象のファイルが存在しない場合に応答されるステータスワードであり、この例では、正規のステータスワード「6A82h」になっている。一方、図3に示す「VERIFY」コマンドの場合、sw_set[1]は、有効期限チェック処理の結果、有効期限が切れている場合に応答されるステータスワードであり、この例では、正規のステータスワード「6982h」になっている。一方、図3に示す「READ RECORD」コマンドの場合も、sw_set[1]は、対象のファイルの存在有無チェック処理の結果、対象のファイルが存在しない場合に応答されるステータスワードであり、この例では、非正規のステータスワード「6D00h」になっている。   In the case of the “SELECT FILE” command shown in FIG. 3, sw_set [1] is a status word that is returned when the target file does not exist as a result of the target file existence check process. Status word “6A82h”. On the other hand, in the case of the “VERIFY” command shown in FIG. 3, sw_set [1] is a status word that is responded when the expiration date has expired as a result of the expiration date check process. It is “6982h”. On the other hand, also in the case of the “READ RECORD” command shown in FIG. 3, sw_set [1] is a status word that is returned when the target file does not exist as a result of the target file existence check process. Then, the non-regular status word is “6D00h”.

また、図3に示す「SELECT FILE」コマンドの場合、sw_set[2]は、アクセス権限チェック処理の結果、アクセス権限がない場合に応答されるステータスワードであり、この例では、正規のステータスワード「6985h」になっている。一方、図3に示す「VERIFY」コマンド及び「READ RECORD」コマンドの場合も、sw_set[2]は、アクセス権限チェック処理の結果、アクセス権限がない場合に応答されるステータスワードであるが、この例では、非正規のステータスワード「6D00h」になっている。   In the case of the “SELECT FILE” command shown in FIG. 3, sw_set [2] is a status word that is returned when there is no access authority as a result of the access authority check process. In this example, the normal status word “ 6985h ". On the other hand, in the case of the “VERIFY” command and the “READ RECORD” command shown in FIG. 3, sw_set [2] is a status word that is returned when there is no access authority as a result of the access authority check process. Then, the non-regular status word is “6D00h”.

また、図3に示す「SELECT FILE」コマンドの場合、sw_set[3]は、P1P2チェック処理の結果、P1P2の値が正しくない場合に応答されるステータスワードであり、この例では、正規のステータスワード「6A86h」になっている。一方、図3に示す「VERIFY」コマンドの場合、sw_set[3]は、PINチェック(照合)処理の結果、PINが一致しない場合に応答されるステータスワードであり、この例では、非正規のステータスワード「6D00h」になっている。なお、「VERIFY」コマンドの場合も、sw_set[3]は、P1P2チェック処理の結果、P1P2の値が正しくない場合に応答されるステータスワードであってもよい。一方、図3に示す「READ RECORD」コマンドの場合も、sw_set[3]は、P1P2チェック処理の結果、P1P2の値が正しくない場合に応答されるステータスワードであり、この例では、非正規のステータスワード「6D00h」になっている。   In the case of the “SELECT FILE” command shown in FIG. 3, sw_set [3] is a status word that is returned when the value of P1P2 is incorrect as a result of the P1P2 check process. In this example, the normal status word It is “6A86h”. On the other hand, in the case of the “VERIFY” command shown in FIG. 3, sw_set [3] is a status word that is returned when the PIN does not match as a result of the PIN check (collation) process. The word is “6D00h”. Also in the case of the “VERIFY” command, sw_set [3] may be a status word that is returned when the value of P1P2 is incorrect as a result of the P1P2 check process. On the other hand, in the case of the “READ RECORD” command shown in FIG. 3, sw_set [3] is a status word that is returned when the value of P1P2 is incorrect as a result of the P1P2 check process. The status word is “6D00h”.

以上のように保持されるステータスワードは、例えば管理者等により決定され、予めSWリストに保持される。そして、CPU11は、外部端末2から受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、SWリストに保持されたステータスワードを外部端末2へ応答するようになっている。図3の例では、「SELECT FILE」コマンドの場合、CPU11は、正常時、エラー時を問わず処理結果に応じたステータスワードを応答する。これは、「SELECT FILE」コマンドは、基本的にほぼ全てのICカードへ搭載されているコマンドであるためであり、ランダム攻撃への対抗策を取る必要がないため、常に処理結果に応じたステータスワードが応答される。一方、図3の例では、「VERIFY」コマンドの場合、CPU11は、PINチェック処理の結果がPINが一致しない、またはアクセス権限チェック処理の結果がアクセス権限がないというエラー発生時には、非正規のステータスワード「6D00h」を応答する。ただし、この場合、PINチェック処理及びアクセス権限チェック処理を通過した後の処理では、処理結果に応じたステータスワード(「9000h」または「6982h」)が応答される。一方、図3の例では、「READ RECORD」コマンドの場合、CPU11は、正常終了以外の全てのエラーを固定のステータスワード「6D00h」で応答する。これは、「READ RECORD」コマンドはコマンドで指定されるデータ形式がある程度決まっているためであり、ランダム攻撃に対する耐性を強くするため、常に固定の非正規のステータスワード「6D00h」が応答される。   The status word held as described above is determined by, for example, an administrator and held in advance in the SW list. When an error occurs during processing of the command received from the external terminal 2, the CPU 11 responds to the external terminal 2 with the status word corresponding to the content of the error and held in the SW list. It is supposed to be. In the example of FIG. 3, in the case of the “SELECT FILE” command, the CPU 11 responds with a status word corresponding to the processing result regardless of whether it is normal or error. This is because the “SELECT FILE” command is basically a command mounted on almost all IC cards, and it is not necessary to take countermeasures against random attacks. The word is answered. On the other hand, in the example of FIG. 3, in the case of the “VERIFY” command, the CPU 11 determines the non-regular status when an error occurs that the PIN check process result does not match the PIN or the access authority check process result does not have the access authority. It responds with the word “6D00h”. However, in this case, in the processing after passing through the PIN check processing and access authority check processing, a status word (“9000h” or “6982h”) corresponding to the processing result is returned. On the other hand, in the example of FIG. 3, in the case of the “READ RECORD” command, the CPU 11 responds to all errors other than normal termination with a fixed status word “6D00h”. This is because the data format specified by the “READ RECORD” command is determined to some extent, and in order to increase resistance against random attacks, a fixed irregular status word “6D00h” is always returned.

なお、異常終了を示すステータスワードは、ケースによっては、全てのコマンドで共通するように構成してもよい。この場合、例えば図3に示すようにコマンドごとにステータスワードを保持させる必要がない(1レコードで済む)ので、メモリ容量を削減することができる。   The status word indicating abnormal termination may be configured to be common to all commands depending on the case. In this case, for example, as shown in FIG. 3, there is no need to hold a status word for each command (only one record is required), so the memory capacity can be reduced.

次に、図4を参照して、CPU11におけるコマンドの処理について説明する。図4は、CPU11におけるコマンドの処理を示すフローチャートである。なお、図4は、PIN照合に利用される「VERIFY」コマンドを例にとった場合を示す。   Next, command processing in the CPU 11 will be described with reference to FIG. FIG. 4 is a flowchart showing command processing in the CPU 11. FIG. 4 shows a case where the “VERIFY” command used for PIN verification is taken as an example.

図4において、CPU11は、コマンドを受信すると、例えば図3に示すSWリストから当該コマンドに対応する各ステータスワード(sw_set[x]:x=0,1,2,3)を取得して設定(RAM12の所定領域に設定)する(例1のステップS1)。つまり、コマンドに応じて(コマンドが受信された時に)各ステータスワード(sw_set[x]:x=0,1,2,3)が予め一括で切り替えられる。また、別の例として、CPU11は、コマンドを受信すると、当該コマンドに対応する各ステータスワードのポインタのアドレスを取得して設定(RAM12の所定領域に設定)する(例2のステップS1’)。この構成によれば、SWリストの値は操作せず、そのリストを保持しているデータのアドレスだけを設定すればよい。   In FIG. 4, when receiving a command, the CPU 11 acquires and sets each status word (sw_set [x]: x = 0, 1, 2, 3) corresponding to the command from the SW list shown in FIG. (Set to a predetermined area of the RAM 12) (step S1 in Example 1). That is, according to the command (when the command is received), the status words (sw_set [x]: x = 0, 1, 2, 3) are switched in a lump in advance. As another example, when receiving a command, the CPU 11 acquires and sets the pointer address of each status word corresponding to the command (sets it in a predetermined area of the RAM 12) (step S1 'in Example 2). According to this configuration, it is only necessary to set the address of the data holding the list without manipulating the value of the SW list.

次いで、CPU11は、PINチェック(照合)処理を実行し、PINが一致するか否かを判定する(ステップS2)。そして、PINが一致しない場合(エラーが発生した場合)(ステップS2:NO)、CPU11は、当該エラーの内容に対応するステータスワード(例えば、sw_set[3]=6D00h)を通信バッファにセットし(ステップS3)、外部端末2へ応答(送信)する(ステップS9)。   Next, the CPU 11 executes a PIN check (collation) process and determines whether or not the PINs match (step S2). If the PINs do not match (when an error occurs) (step S2: NO), the CPU 11 sets a status word (for example, sw_set [3] = 6D00h) corresponding to the content of the error in the communication buffer ( In step S3), a response (transmission) is made to the external terminal 2 (step S9).

一方、PINが一致した場合(ステップS2:YES)、CPU11は、アクセス権限チェック処理を実行し、アクセス権限があるか否かを判定する(ステップS4)。そして、アクセス権限がない場合(エラーが発生した場合)(ステップS4:NO)、CPU11は、当該エラーの内容に対応するステータスワード(例えば、sw_set[2]=6D00h)を通信バッファにセットし(ステップS5)、外部端末2へ応答(送信)する(ステップS9)。   On the other hand, if the PINs match (step S2: YES), the CPU 11 executes an access authority check process and determines whether or not there is an access authority (step S4). When there is no access authority (when an error occurs) (step S4: NO), the CPU 11 sets a status word (for example, sw_set [2] = 6D00h) corresponding to the content of the error in the communication buffer ( Step S5), responds (transmits) to the external terminal 2 (step S9).

一方、アクセス権限がある場合(ステップS4:YES)、CPU11は、有効期限チェック処理を実行し、有効期限が切れているか否かを判定する(ステップS6)。そして、有効期限が切れている場合(エラーが発生した場合)(ステップS6:YES)、CPU11は、当該エラーの内容に対応するステータスワード(例えば、sw_set[1]=6982h)を通信バッファにセットし(ステップS7)、外部端末2へ応答(送信)する(ステップS9)。   On the other hand, when there is an access authority (step S4: YES), the CPU 11 executes an expiration date check process and determines whether or not the expiration date has expired (step S6). When the expiration date has expired (when an error has occurred) (step S6: YES), the CPU 11 sets a status word (for example, sw_set [1] = 6982h) corresponding to the content of the error in the communication buffer. (Step S7) and respond (transmit) to the external terminal 2 (Step S9).

一方、有効期限が切れていない場合(ステップS6:NO)、CPU11は、正常終了を示すステータスワード(例えば、sw_set[0]=9000h)を通信バッファにセットし(ステップS8)、外部端末2へ応答(送信)する(ステップS9)。   On the other hand, if the expiration date has not expired (step S6: NO), the CPU 11 sets a status word indicating normal termination (for example, sw_set [0] = 9000h) in the communication buffer (step S8), and sends it to the external terminal 2. A response (transmission) is made (step S9).

図3で例示したように、PINが一致しない場合は非正規のステータスワード「6D00h」とする一方、有効期限が切れている場合は正規のステータスワード「6982h」とすれば、攻撃者によるランダム攻撃にて適当なコマンドが送信された場合は非正規のステータスワード「6D00h」が応答される一方、正規の使用者によってPINの照合が成功しつつICカード1の有効期限が切れてしまっていた場合は正規のステータスワード「6982h」が応答される。この場合、正規の使用者である例えば管理者等がICカード1の異常を調査することが容易となるため、利便性の向上を期待できる。   As illustrated in FIG. 3, if the PIN does not match, the non-genuine status word “6D00h” is used, while if the valid period is expired, the normal status word “6982h” is used, a random attack by the attacker When an appropriate command is transmitted at, an invalid status word “6D00h” is replied, while the validity of the IC card 1 has expired while the PIN verification is successful by the authorized user Will respond with a legitimate status word "6982h". In this case, since it becomes easy for a regular user, for example, an administrator or the like to investigate the abnormality of the IC card 1, an improvement in convenience can be expected.

以上説明したように、本実施形態によれば、複数の異なるコマンドごとに、且つコマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するSWリストをフラッシュメモリ13に記憶しておき、CPU11は、外部端末2から受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、SWリストに保持されたステータスワードを外部端末2へ応答するように構成したので、コマンドの存在を攻撃者に把握されることなく、正規の使用者にどの箇所でエラーとなったのかを把握させることできる。また、上記実施形態によれば、ステータスワード(sw_set[x]:x=0,1,2,3)をコマンドごとに保持しておき、コマンドが受信された場合に、当該コマンドに対応するステータスワード(sw_set[x]:x=0,1,2,3)が設定されるので、ステータスワードの応答についての細かい制御が可能になる。   As described above, according to the present embodiment, a regular status word indicating that a command is supported for each of a plurality of different commands and for each of a plurality of different errors during processing of the command, An SW list that holds either one of the non-regular status words indicating that the command is not supported is stored in the flash memory 13 in advance, and the CPU 11 is processing the command received from the external terminal 2. When an error occurs, the status word corresponding to the content of the error and the status word held in the SW list is configured to respond to the external terminal 2, so that the attacker can grasp the presence of the command. Therefore, it is possible to make the authorized user know where the error occurred. Further, according to the above embodiment, the status word (sw_set [x]: x = 0, 1, 2, 3) is held for each command, and when a command is received, the status corresponding to the command is received. Since the word (sw_set [x]: x = 0, 1, 2, 3) is set, it is possible to finely control the status word response.

1 ICカード
1a ICチップ
11 CPU
12 RAM
13 フラッシュメモリ
14 I/O回路
1 IC card 1a IC chip 11 CPU
12 RAM
13 Flash memory 14 I / O circuit

Claims (4)

コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶する記憶手段と、
外部端末からコマンドを受信する受信手段と、
前記受信手段により受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答する応答手段と、
を備え
複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信手段により受信されたコマンドが受信された時に一括で切り替えられることを特徴とするICカード。
For each of the different error contents during the processing of the command, either a regular status word indicating that the command is supported or a non-normal status word indicating that the command is not supported Storage means for storing a list to be held;
Receiving means for receiving commands from an external terminal;
A response means for responding to the external terminal with a status word corresponding to the content of the error when an error occurs during processing of the command received by the receiving means, the status word held in the list; ,
Equipped with a,
The IC card , wherein each status word for each of a plurality of different commands and each content of the error is switched at a time when the command received by the receiving means is received .
前記リストは、複数の異なるコマンドごとに、且つ前記エラーの内容ごとに、前記正規のステータスワードと前記非正規のステータスワードとの何れか一方を予め保持することを特徴とする請求項1に記載のICカード。   The list includes the normal status word and the non-normal status word in advance for each of a plurality of different commands and for each error content. IC card. コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶するステップと、
外部端末からコマンドを受信する受信ステップと、
前記受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答するステップと、
を含み、
複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信ステップにより受信されたコマンドが受信された時に一括で切り替えられることを特徴とするステータスワード出力方法。
For each of the different error contents during the processing of the command, either a regular status word indicating that the command is supported or a non-normal status word indicating that the command is not supported Memorizing a list to keep;
A receiving step for receiving a command from an external terminal;
When an error occurs during processing of the received command, a status word corresponding to the content of the error, and responding to the external terminal with the status word held in the list;
Only including,
The status word output method characterized in that each status word for each of a plurality of different commands and for each error content is switched at a time when the command received in the receiving step is received .
コマンドの処理中の複数の異なるエラーの内容ごとに、コマンドがサポートされていることを示す正規のステータスワードと、コマンドがサポートされていないことを示す非正規のステータスワードとの何れか一方を予め保持するリストを記憶する記憶手段を備えるICカードに含まれるコンピュータを、
外部端末からコマンドを受信する受信手段、及び
前記受信手段により受信されたコマンドの処理中にエラーが発生した場合、当該エラーの内容に対応するステータスワードであって、前記リストに保持された前記ステータスワードを前記外部端末へ応答する応答手段として機能させ
複数の異なるコマンドごと且つ前記エラーの内容ごとの各前記ステータスワードは、前記受信手段により受信されたコマンドが受信された時に一括で切り替えられることを特徴とするステータスワード出力処理プログラム。
For each of the different error contents during the processing of the command, either a regular status word indicating that the command is supported or a non-normal status word indicating that the command is not supported A computer included in an IC card having storage means for storing a list to be held;
Receiving means for receiving a command from an external terminal; and when an error occurs during processing of the command received by the receiving means, a status word corresponding to the content of the error, and the status held in the list Function as a response means for responding a word to the external terminal ;
A status word output processing program characterized in that each status word for each of a plurality of different commands and for each error content is switched at a time when a command received by the receiving means is received .
JP2013078608A 2013-04-04 2013-04-04 IC card, status word output method, and status word output processing program Active JP6182940B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013078608A JP6182940B2 (en) 2013-04-04 2013-04-04 IC card, status word output method, and status word output processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013078608A JP6182940B2 (en) 2013-04-04 2013-04-04 IC card, status word output method, and status word output processing program

Publications (2)

Publication Number Publication Date
JP2014203248A JP2014203248A (en) 2014-10-27
JP6182940B2 true JP6182940B2 (en) 2017-08-23

Family

ID=52353644

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013078608A Active JP6182940B2 (en) 2013-04-04 2013-04-04 IC card, status word output method, and status word output processing program

Country Status (1)

Country Link
JP (1) JP6182940B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019101840A (en) * 2017-12-05 2019-06-24 凸版印刷株式会社 Ic card and output method of status word
CN113268369B (en) * 2021-04-26 2022-12-16 上海卫星工程研究所 On-board computer fault diagnosis processing method and system based on working state report

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3641693B2 (en) * 1992-10-01 2005-04-27 大日本印刷株式会社 IC card and method of using the same
JPH0744672A (en) * 1993-07-28 1995-02-14 Oki Electric Ind Co Ltd Ic card and ic card system
JP3480746B2 (en) * 1993-11-11 2003-12-22 株式会社東芝 Portable electronic devices
JP3688971B2 (en) * 2000-04-10 2005-08-31 株式会社東芝 Electronic equipment
JP4445718B2 (en) * 2003-06-20 2010-04-07 大日本印刷株式会社 IC card and IC card program
JP5454933B2 (en) * 2009-09-11 2014-03-26 株式会社東芝 Portable electronic device, IC card, and control method for portable electronic device

Also Published As

Publication number Publication date
JP2014203248A (en) 2014-10-27

Similar Documents

Publication Publication Date Title
US20070136797A1 (en) Secure device and system for issuing ic cards
US9183400B2 (en) IC card and IC card control method
US20170277546A1 (en) Method for loading executable program instructions into a chip card during active operation
KR101824249B1 (en) Method for managing electronic devices, for example, of integrated circuits type, having internal generation of a personal authetication key
US20090184799A1 (en) Information storage medium and information storage medium processing apparatus
JP6182940B2 (en) IC card, status word output method, and status word output processing program
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP4770255B2 (en) IC card and command processing method mounted on IC card
KR102099739B1 (en) How to manage secure elements
EP3365833B1 (en) A method performed by an electronic device capable of communicating with a reader with improved self-testing
US11151338B2 (en) Securing a transaction by means of a smart card and smart card
JP2007141113A (en) Ic card having biometrics authentication function and ic card program
JP2007087120A (en) Ic card mounted with multiple os (operating system) and issue consignment method
JP2005011147A (en) Ic card and ic card program
JP2006293706A (en) Multi-application ic card with application updating function
JP6340935B2 (en) IC chip, abnormality detection processing method, and program
JP6828548B2 (en) Electronic information storage medium, IC card, tampering check method and tampering check program
JP7327349B2 (en) IC card, command management method for IC card, and microcontroller for IC card
JP2004259176A (en) Ic card
JP6326835B2 (en) Information processing apparatus, IC card, command processing method, and command processing program
JP4549731B2 (en) Multi-application IC card with command code that is commonly used by applications
JP7380603B2 (en) Secure device, command execution management method, and IC chip
JP6421662B2 (en) Electronic information storage medium, access restriction method, and access restriction program
JP7444197B2 (en) Electronic information storage medium, cryptographic operation method selection method, and program
JP2006172005A (en) Portable electronic instrument

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160401

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161216

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161227

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20170307

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170530

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20170607

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170627

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170710

R150 Certificate of patent or registration of utility model

Ref document number: 6182940

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150