JP2016099711A - Ic card and its starting method - Google Patents

Ic card and its starting method Download PDF

Info

Publication number
JP2016099711A
JP2016099711A JP2014234539A JP2014234539A JP2016099711A JP 2016099711 A JP2016099711 A JP 2016099711A JP 2014234539 A JP2014234539 A JP 2014234539A JP 2014234539 A JP2014234539 A JP 2014234539A JP 2016099711 A JP2016099711 A JP 2016099711A
Authority
JP
Japan
Prior art keywords
apdu
response
card
reader
command apdu
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.)
Pending
Application number
JP2014234539A
Other languages
Japanese (ja)
Inventor
尚棋 國重
Shoki Kunishige
尚棋 國重
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.)
Toppan Inc
Original Assignee
Toppan 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 Toppan Printing Co Ltd filed Critical Toppan Printing Co Ltd
Priority to JP2014234539A priority Critical patent/JP2016099711A/en
Publication of JP2016099711A publication Critical patent/JP2016099711A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To enable an IC card to execute complete start processing even if the start processing of the IC card does not complete within an IC card start time requested by an IC card reader or a reader/writer and thereby prevent security related problems.SOLUTION: An IC card comprising means for executing an initial response to a start request signal from a reader/writer within a prescribed time comprises: means for executing start processing after receiving the start request signal and before the initial response; means for receiving a command APDU from the reader/writer after the initial response; means for executing incomplete start processing when the start processing does not complete even after the command APDU is received and executing command APDU processing of generating a response APDU to the command APDU after completing the start processing; and means for transmitting the response APDU generated by the command APDU processing executed after the completion of the initial processing to the reader/writer.SELECTED DRAWING: Figure 3

Description

本発明はICカードおよびその起動方法に関し、詳細には、ICカードリーダ(リーダライタ)との情報通信を開始する際のICカードの起動方法に関する。   The present invention relates to an IC card and an activation method thereof, and more particularly to an activation method of an IC card when starting information communication with an IC card reader (reader / writer).

ICカードは、リーダライタとの情報のやりとりの方式により、接触型と非接触型とに分類される。これらのいずれのタイプのICカードにおいても、リーダライタからの電源投入、リセット信号等のICカード起動要求に対してICカードが初期応答を返すまでの時間範囲(応答時間)が規定されている。   The IC card is classified into a contact type and a non-contact type according to a method of exchanging information with the reader / writer. In any of these types of IC cards, a time range (response time) until the IC card returns an initial response to an IC card activation request such as power-on from a reader / writer and a reset signal is defined.

例えば接触型ICカードの場合、ICカードはリセット信号を受信すると、初期設定として通信関係のパラメータ設定を行い、初期応答としてATR(Answer to reset)をレスポンスする。このATRのレスポンスは、リーダライタからのリセット信号に対して規定時間内にする必要がある。   For example, in the case of a contact type IC card, when the IC card receives a reset signal, it performs communication-related parameter setting as an initial setting, and returns an ATR (Answer to reset) as an initial response. This ATR response needs to be within a specified time with respect to the reset signal from the reader / writer.

この起動処理は実際には例えば400クロックから40000クロック程度の非常に短い応答時間が規定されているため、規定の応答時間内にICカードの起動処理を間に合わせるべく、短い時間で実施可能な起動処理のみを行なっている。すなわち、通常のICカードの起動処理では、ICカードの動作に最低限必要な設定のみを行うだけであって、メモリが壊れていないか等の完全なチェックは行なっていない。   In actuality, this activation process has a very short response time of, for example, 400 to 40,000 clocks. Therefore, the activation process can be performed in a short time in order to keep the activation process of the IC card within the specified response time. Only processing is performed. That is, in the normal IC card activation process, only the minimum setting necessary for the operation of the IC card is performed, and a complete check is not performed such as whether the memory is broken.

しかしながら、上記従来の起動処理方法では、上述したようにICカードからの初期応答を規定時間内に収めるべく必要最低限の設定やチェックしか行なうことができないため、一部に何らかの異常があった場合でもそれを検知することができなかった。リーダライタは、起動したICカードを制御するために、制御内容を格納したコマンドAPDU(Application Protocol Data Unit)を送信している。ICカードはこのコマンドAPDUを受け取ると、受け取ったコマンドAPDUの内容に応じたAPDU処理を行い、応答として所定時間内にレスポンスAPDUを返信し、リーダライタはこのレスポンスを確認することで制御が成功したか否かなどを特定している。よって、従来の起動処理方法では、起動時に検知できなかった異常が原因で、ICカードが引き続くコマンドAPDUの処理動作中にエラーとなったり、不正な動作をしてしまう可能性があった。   However, in the conventional activation processing method, as described above, since only the minimum necessary settings and checks can be performed to keep the initial response from the IC card within the specified time, there is some abnormality. But I couldn't detect it. The reader / writer transmits a command APDU (Application Protocol Data Unit) storing control contents in order to control the activated IC card. When the IC card receives this command APDU, it performs APDU processing according to the content of the received command APDU, returns a response APDU within a predetermined time as a response, and the reader / writer confirms this response, and the control is successful. Whether or not. Therefore, in the conventional activation processing method, there is a possibility that an error or an illegal operation may occur during the processing operation of the command APDU that the IC card continues due to an abnormality that cannot be detected at the time of activation.

上記のようなコマンドAPDUの処理動作中のエラーや、不正な動作は悪意のある攻撃者にとってICカード内の秘密データを取り出す手がかりとなるなど、ICカードにとって致命的な欠陥となり得るという問題がある。また今まではメモリチェックは時間がかかるので実行していなかったが、チェックしていないメモリが悪意のある攻撃にさらされると、例えばフラッシュメモリやEEPROMを書き換えてしまい誤動作することが多いという問題がある。   There is a problem that an error during the processing operation of the command APDU as described above or an illegal operation can be a fatal defect for the IC card, such as a clue to a malicious attacker extracting the secret data in the IC card. . In addition, memory check has not been executed up to now because it takes time. However, when unchecked memory is exposed to a malicious attack, for example, flash memory and EEPROM are often rewritten and malfunctions often occur. is there.

さらに近年、ソフトウェアのセキュリティ基準が厳格になっているので、セキュリティ的に問題とならないように完全チェックをすることが必要である。   Furthermore, since software security standards have become stricter in recent years, it is necessary to perform a complete check so as not to cause a security problem.

そこで本発明は上記従来の問題に鑑みなされたものであって、ICカードリーダやリーダライタが要求するICカード起動時間にICカードの起動処理が間に合わない場合でも、完全な起動処理を実行可能とすることにより、セキュリティ的に問題がないようにしたICカードおよびICカードの起動方法に関する。   Therefore, the present invention has been made in view of the above-described conventional problems, and even when the activation process of the IC card is not in time for the activation time of the IC card requested by the IC card reader or reader / writer, the complete activation process can be executed. The present invention relates to an IC card and an IC card activation method in which there is no problem in terms of security.

上記の課題を解決するために、一実施形態に記載の発明は、リーダライタからの起動要求信号に対して規定時間内に初期応答する手段を有するICカードであって、前記起動要求信号を受信してから初期応答までの間に起動処理を実行する手段と、前記初期応答の後に前記リーダライタからのコマンドAPDUを受信する手段と、前記コマンドAPDUを受信した後でも前記起動処理が完了していない場合に、未完の起動処理の実行をし、該起動処理が完了した後に当該コマンドAPDUを実行処理するコマンドAPDU処理と当該コマンドAPDUに対するレスポンスとして該コマンドAPDU処理の結果であるレスポンスAPDUを生成する処理とを実行する手段と、前記起動処理の完了に続いて実行される前記コマンドAPDU処理の結果として生成されたレスポンスAPDUを前記リーダライタに送信する手段とを備えることを特徴するICカードである。   In order to solve the above problem, the invention described in one embodiment is an IC card having means for initially responding to a start request signal from a reader / writer within a specified time, and receiving the start request signal Means for executing a start-up process between an initial response, a means for receiving a command APDU from the reader / writer after the initial response, and the start-up process is completed even after receiving the command APDU. If there is not, the incomplete startup process is executed, and after the startup process is completed, a command APDU process for executing the command APDU and a response APDU as a result of the command APDU process are generated as a response to the command APDU And a command APDU process executed following completion of the startup process. An IC card comprising: a means for transmitting a response APDU generated as result to the reader writer.

本発明により、ハードウェアの異常を内包したままコマンドAPDU処理を行なうことがなくなるので、ICカードの不正な動作や、コマンドAPDU処理中のエラー発生を防止することができる。またその結果として、ICカード内のデータを悪意のある攻撃者から保護することができる。   According to the present invention, since command APDU processing is not performed while containing a hardware abnormality, it is possible to prevent an illegal operation of the IC card and occurrence of an error during command APDU processing. As a result, data in the IC card can be protected from malicious attackers.

本実施形態にかかるICカードのハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the IC card concerning this embodiment. リーダライタと通信する本実施形態にかかるICカードの機能構成を示す図である。It is a figure which shows the function structure of the IC card concerning this embodiment which communicates with a reader / writer. 本実施形態にかかるICカードの起動処理のタイミングチャートを示す図である。It is a figure which shows the timing chart of the starting process of the IC card concerning this embodiment. 本実施形態にかかるICカードにおける待ち時間管理プログラムのタイミングチャートを示す図である。It is a figure which shows the timing chart of the waiting time management program in the IC card concerning this embodiment.

以下、本実施形態にかかるICカードおよびICカードの起動処理方法について、詳細に説明する。   Hereinafter, the IC card and the IC card activation processing method according to the present embodiment will be described in detail.

本実施形態のICカードでは、ICカードの初期応答の時間制限に依存せずICカードのハードウェアチェックや設定をICカード動作前に行なうことができるようにする。具体的には、初期応答までに必要最低限の設定のみを行い、初期応答を行う。その後、ICカード内で初期応答までにはできなかったハードウェアチェックや設定を行い、R/Wからの最初のコマンドAPDUを受信した後は、受信したAPDUに対するレスポンスAPDUの返信待ち時間を随時延長し、完全チェックの結果異常がなかった場合にコマンドAPDUの処理を開始する。   In the IC card of this embodiment, the hardware check and setting of the IC card can be performed before the IC card operation without depending on the time limit of the initial response of the IC card. Specifically, only the minimum necessary settings are made before the initial response, and the initial response is made. After that, after checking the hardware and setting that could not be made before the initial response in the IC card, and receiving the first command APDU from the R / W, the response APDU reply waiting time for the received APDU is extended as needed. Then, if there is no abnormality as a result of the complete check, processing of the command APDU is started.

図1は本実施形態にかかるICカードのハードウェア構成を示している。本実施形態のICカード1は、CPU11と、コプロセッサ12と、乱数発生器13と、I/O14と、ROM15と、RAM16と、EEPROM17とを備えている。CPU11と、コプロセッサ12と、乱数発生器13と、I/O14と、ROM15と、RAM16と、EEPROM17とはバスを介して相互に接続されている。   FIG. 1 shows the hardware configuration of an IC card according to this embodiment. The IC card 1 of this embodiment includes a CPU 11, a coprocessor 12, a random number generator 13, an I / O 14, a ROM 15, a RAM 16, and an EEPROM 17. The CPU 11, the coprocessor 12, the random number generator 13, the I / O 14, the ROM 15, the RAM 16, and the EEPROM 17 are connected to each other via a bus.

CPU11は、ICカード1全体の制御する制御部として機能する。CPU11は、ROM15やEEPROM17に記憶されている制御プログラムや制御データに基づいて処理を実行する。例えば、CPU11は、リーダライタから受信した信号・コマンドに応じて様々な処理を実行し、処理結果としてのATR、レスポンスなどのデータの生成を行なう。また、CPU11は、リーダライタに実行させるコマンドを生成することができる。   The CPU 11 functions as a control unit that controls the entire IC card 1. The CPU 11 executes processing based on control programs and control data stored in the ROM 15 and the EEPROM 17. For example, the CPU 11 executes various processes according to signals / commands received from the reader / writer, and generates data such as ATRs and responses as processing results. Further, the CPU 11 can generate a command to be executed by the reader / writer.

コプロセッサ12は、暗号演算専用の処理装置として機能する。コプロセッサ12は、リーダライタからの信号・コマンドに基づいてCPU11に制御されて、暗号化、復号などの必要な暗号演算を行い、演算の結果をCPUに送る。   The coprocessor 12 functions as a processing device dedicated to cryptographic operations. The coprocessor 12 is controlled by the CPU 11 based on a signal / command from the reader / writer, performs necessary cryptographic operations such as encryption and decryption, and sends the result of the operation to the CPU.

乱数発生器13は、乱数発生専用の処理装置として機能する。乱数発生器13は、リーダライタからの信号・コマンドに基づいて、CPU11に制御されて乱数の生成処理を行う。例えば、ICカード1が相互認証コマンドを受信した場合、乱数を生成し、生成した乱数をCPU11に送る。   The random number generator 13 functions as a processing device dedicated to random number generation. The random number generator 13 is controlled by the CPU 11 on the basis of a signal / command from the reader / writer and performs random number generation processing. For example, when the IC card 1 receives a mutual authentication command, it generates a random number and sends the generated random number to the CPU 11.

I/O14は、リーダライタに送信するデータに対して符号化、負荷変調などの信号処理を行なったうえで、送受信する。例えば、I/O14は、外部機器に送信するデータの変調(増幅)を行い、信号処理を施したデータをリーダライタに送信する。   The I / O 14 performs signal processing such as encoding and load modulation on the data to be transmitted to the reader / writer, and transmits / receives the data. For example, the I / O 14 modulates (amplifies) data to be transmitted to the external device, and transmits the data subjected to signal processing to the reader / writer.

ROM15は、予め制御用のプログラムや制御データなどを記憶する不揮発性のメモリである。ROM15は、製造段階で制御プログラムや制御データなどを記憶した状態でICカード1内に組み込まれる。すなわち、ROM15に記憶される制御プログラムや制御データは、予めICカード1の仕様に応じて組み込まれる。   The ROM 15 is a non-volatile memory that stores a control program, control data, and the like in advance. The ROM 15 is incorporated in the IC card 1 in a state where a control program, control data, and the like are stored at the manufacturing stage. That is, the control program and control data stored in the ROM 15 are incorporated in advance according to the specifications of the IC card 1.

RAM16は、ワーキングメモリとして機能する揮発性のメモリである。RAM16は、CPU25やコプロセッサ12において処理中のデータなどを一時的に格納する。   The RAM 16 is a volatile memory that functions as a working memory. The RAM 16 temporarily stores data being processed by the CPU 25 and the coprocessor 12.

EEPROM17は、データの書き込み及び書き換えが可能な不揮発性メモリである。EEPROM17は、例えば、制御用のプログラム、制御データ、アプリケーション、個人情報、暗号鍵などのセキュリティ情報、アプリケーションに用いられるデータなどを記憶することができる。   The EEPROM 17 is a nonvolatile memory in which data can be written and rewritten. The EEPROM 17 can store, for example, control programs, control data, applications, personal information, security information such as encryption keys, data used for applications, and the like.

図2はリーダライタと通信する本実施形態にかかるICカードの機能構成を示している。本実施形態のICカード1は、リーダライタ10と接触または非接触で通信が可能である。通信方式は接触、非接触で異なり、非接触型では、信号の乗せ方やコマンドによって異なる方式が規定されている。例えば、typeA方式、typeB方式、フェリカ方式などがある。   FIG. 2 shows a functional configuration of the IC card according to the present embodiment that communicates with the reader / writer. The IC card 1 of the present embodiment can communicate with the reader / writer 10 in contact or non-contact. The communication method differs depending on whether it is contact or non-contact. In the non-contact type, different methods are defined depending on how to put signals and commands. For example, there are a type A method, a type B method, and a Felica method.

ICカード1は、接触、非接触いずれかまたは両方の通信方式に対応した受信部21および送信部22と、リーダライタに対するレスポンス処理を実行するレスポンス処理部23を備えている。レスポンス処理部23は、起動処理を実行する起動処理部24と、APDU処理を実行するAPDU処理部25と、コマンドAPDUに対する応答時間を管理する待ち時間管理部26を備えている。   The IC card 1 includes a receiving unit 21 and a transmitting unit 22 corresponding to either or both of contact and non-contact communication methods, and a response processing unit 23 that executes a response process for the reader / writer. The response processing unit 23 includes an activation processing unit 24 that executes activation processing, an APDU processing unit 25 that executes APDU processing, and a waiting time management unit 26 that manages response time for the command APDU.

起動処理部24は、リーダライタ10からの起動要求にしたがってICカード1を起動する起動処理を実行する。起動処理としては、例えば、前回のICカード動作時にEEPROMへの書き込み中に電源OFFとなった場合のデータ復旧等が実行されメモリが壊れていないかをチェックすることができる。また、ROM及びEEPROMの完全性チェックや、プログラムコードのチェックを実行することによりプログラム自体が改ざんされていないかをチェックすることができる。さらに、サンプルデータで暗号演算を行い、正しい結果が出力されるか確認することによりコプロセッサなどの暗号演算用ハードウェアは正常に動作しているかチェックすることができ、複数乱数を発生させ、乱数性をチェックすることにより乱数発生器は正常に動作しているかをチェックすることができる。   The activation processing unit 24 executes activation processing for activating the IC card 1 in accordance with an activation request from the reader / writer 10. As the start-up process, for example, it is possible to check whether the memory is broken by executing data recovery when the power is turned off during writing to the EEPROM during the previous IC card operation. In addition, it is possible to check whether the program itself has been tampered with by executing integrity check of the ROM and EEPROM and program code check. Furthermore, by performing cryptographic operations on sample data and confirming that correct results are output, it is possible to check whether the cryptographic operation hardware such as a coprocessor is operating normally, generating multiple random numbers, By checking the characteristics, it can be checked whether the random number generator is operating normally.

例えば接触型ICカードにおいては、接続回路の活性化がされコールドリセット待ち状態となっている間に、リーダライタ10からのリセット信号を受信したことをトリガとして、起動処理部24は起動処理である通信パラメータの設定などを行う。電源ONから初期応答までの間に起動処理部24が実行する起動処理は一部の限られた処理のみとなることが多い。コールドリセット待ち状態でクロック信号の供給が開始されてから少なくとも300クロックサイクルの間に受け取るリセット信号の受信から40000クロックサイクル以内の初期応答(ATR)までの間に起動処理を実行する必要があるからである。本実施形態の起動処理部24では、残りの起動処理を、初期応答後に実行することができる。例えば、コマンドAPDUの受信後、コマンドAPDU処理の実行を開始するまでに残りの起動処理を実行することができる。コマンドAPDUの受信後に起動処理を実行する場合、待ち時間管理部26により、待ち時間が制御されるので、起動処理部24は起動処理を完了することができる。   For example, in a contact IC card, the activation processing unit 24 is an activation process triggered by receiving a reset signal from the reader / writer 10 while the connection circuit is activated and is in a cold reset waiting state. Set communication parameters. In many cases, the startup processing executed by the startup processing unit 24 from the power ON to the initial response is limited to some limited processing. Since it is necessary to execute the start-up process between the reception of the reset signal received during at least 300 clock cycles after the start of the clock signal supply in the cold reset waiting state and the initial response (ATR) within 40000 clock cycles. It is. In the activation processing unit 24 of the present embodiment, the remaining activation processing can be executed after the initial response. For example, after the command APDU is received, the remaining activation processing can be executed before the execution of the command APDU processing is started. When executing the activation process after receiving the command APDU, the waiting time is controlled by the waiting time management unit 26, so that the activation processing unit 24 can complete the activation process.

APDU処理部25は、リーダライタ10からのコマンドAPDUを実行処理するコマンドAPDU処理と、コマンドAPDUに対するレスポンスとして該コマンドAPDU処理の結果であるレスポンスAPDUを生成するAPDU処理を実行する。例えば、コマンドAPDUとしてselectコマンドが送信された場合は、select処理を実行し、レスポンスAPDUを生成する。生成されたレスポンスAPDUは送信部22によりリーダライタ10に送信される。   The APDU processing unit 25 executes a command APDU process for executing a command APDU from the reader / writer 10 and an APDU process for generating a response APDU as a result of the command APDU process as a response to the command APDU. For example, when a select command is transmitted as a command APDU, a select process is executed to generate a response APDU. The generated response APDU is transmitted to the reader / writer 10 by the transmission unit 22.

待ち時間管理部26は、リーダライタ10からのコマンドAPDUを受信してからレスポンスAPDUを送信するまでの時間である応答時間を管理し、必要に応じてその時間を延長する処理を行う。起動処理とコマンドAPDU処理を完了するまでは、応答時間を延長する必要がある。   The waiting time management unit 26 manages a response time, which is a time from when the command APDU is received from the reader / writer 10 to when the response APDU is transmitted, and performs a process of extending the time as necessary. It is necessary to extend the response time until the startup process and the command APDU process are completed.

次いで、図2に示す機能構成を備えるICカードの起動時の処理について説明する。図3は本実施形態にかかるICカードの起動処理のタイミングチャートを示す図である。   Next, processing at the time of activation of an IC card having the functional configuration shown in FIG. 2 will be described. FIG. 3 is a diagram showing a timing chart of the activation process of the IC card according to the present embodiment.

まず、ICカード1がリーダライタ(R/W)10と接続されると、リーダライタ10はリセット信号をICカード1に送信する(S1)。ICカード1はリセット信号を受信部21で受信すると(S2)、起動処理部24により必要最低限の起動処理を行う(S3)。例えば、必要最低限の起動処理として、通信速度等の通信パラメータや、動作クロック、割り込み設定等をレジスタに設定することができる。ICカード1は必要最低限の設定を行った後、送信部22により、規定時間内に初期応答であるATR(Answer To Reset)をリーダライタ10に送信する(S4)。   First, when the IC card 1 is connected to the reader / writer (R / W) 10, the reader / writer 10 transmits a reset signal to the IC card 1 (S1). When the IC card 1 receives the reset signal by the receiving unit 21 (S2), the activation processing unit 24 performs a minimum activation process (S3). For example, communication parameters such as communication speed, operation clock, interrupt setting, etc. can be set in the register as the minimum necessary startup processing. After performing the minimum necessary settings, the IC card 1 transmits an ATR (Answer To Reset), which is an initial response, to the reader / writer 10 within a specified time by the transmitting unit 22 (S4).

リーダライタ10は、初期応答(ATR)を受信すると(S5)、例えばSelectコマンドなどの最初のコマンドAPDUを送信する(S6)。   Upon receiving the initial response (ATR) (S5), the reader / writer 10 transmits a first command APDU such as a Select command (S6).

ICカード1は受信部21で最初のコマンドAPDUを受信すると(S7)、待ち時間管理部26により待ち時間管理処理を開始し(S8)、起動処理部24により内部でハードウェアに異常がないかの等の未完の起動処理を行う(S9)。未完の起動処理とは、ICカード1の安全性が担保できるように予め設定された起動処理のうち、未だ完了していない処理のことをいう。例えば、起動処理として、通信パラメータの設定とメモリチェックとプログラムチェックとが設定されており、必要最低限の起動処理として通信パラメータの設定のみが完了している場合は、メモリチェックとプログラムチェックが未完の起動処理としてS9において実行される。   When the IC card 1 receives the first command APDU at the receiving unit 21 (S7), the waiting time management unit 26 starts the waiting time management process (S8), and the activation processing unit 24 checks whether there is an abnormality in hardware internally. Incomplete startup processing such as No. is performed (S9). The incomplete activation process is a process that has not yet been completed among the activation processes set in advance so that the safety of the IC card 1 can be ensured. For example, if the communication parameter setting, memory check, and program check are set as the startup process, and only the communication parameter setting is completed as the minimum required startup process, the memory check and program check are not completed. The activation process is executed in S9.

ここで待ち時間管理部26(図2参照)による待ち時間管理処理について説明する。図4は本実施形態にかかるICカード1における待ち時間管理プログラムのタイミングチャートを示す図である。待ち時間管理プログラムが起動すると、コマンドAPDUの受信からの計時を開始し(S21)、所定時間毎にレスポンスAPDUを返信しなければならない時間である待ち時間に近づいているか否かが確認される(S22)。待ち時間に近づいていると判断されると(S22:Yes)、起動処理およびAPDU処理が完了したか否かが判断される(S23)。ここでS23において完了が確認される起動処理およびAPDU処理とは、上述した起動処理として実行されるメモリチェックやプログラムチェックに加えて、受信したコマンドAPDUを実行処理するコマンドAPDU処理およびレスポンスAPDUの生成が含まれる。   Here, the waiting time management processing by the waiting time management unit 26 (see FIG. 2) will be described. FIG. 4 is a diagram showing a timing chart of the waiting time management program in the IC card 1 according to the present embodiment. When the waiting time management program is activated, time measurement from the reception of the command APDU is started (S21), and it is confirmed whether or not the waiting time, which is a time for which a response APDU should be returned every predetermined time, is approaching ( S22). If it is determined that the waiting time is approaching (S22: Yes), it is determined whether the activation process and the APDU process are completed (S23). Here, the activation process and APDU process whose completion is confirmed in S23 are the command APDU process for executing the received command APDU and the generation of the response APDU in addition to the memory check and program check executed as the activation process described above. Is included.

チェック等が完了したと判断された場合は(S23:Yes)、待ち時間管理プログラムは終了し、送信部22によりレスポンスAPDUを送信する処理(図3のS13)が行なわれる。一方、起動処理およびAPDU処理が完了していないと判断された場合(S23:No)は、待ち時間を延長するための待ち時間延長要求を送信する(S24)。リーダライタは、待ち時間延長要求を受信すると(S25)、待ち時間の延長を受け付けたことを示す待ち時間延長応答を送信する(S26)。ICカード1は、待ち時間延長応答を受信すると(S27)、S21に再び戻って待ち時間延長応答の受信からの計時を開始し(S21)、起動処理およびAPDU処理が完了するまで(S23:Yes)続く処理を実行する。例えば、メモリチェックとプログラムチェックが完了したが、その後に実行されるAPDU処理に時間がかかり、待ち時間内にAPDU処理が終了しないときは待ち時間延長要求がなされる。   When it is determined that the check or the like has been completed (S23: Yes), the waiting time management program is terminated, and a process of transmitting a response APDU by the transmission unit 22 (S13 in FIG. 3) is performed. On the other hand, when it is determined that the activation process and the APDU process are not completed (S23: No), a waiting time extension request for extending the waiting time is transmitted (S24). Upon receiving the waiting time extension request (S25), the reader / writer transmits a waiting time extension response indicating that the waiting time extension has been accepted (S26). When the IC card 1 receives the waiting time extension response (S27), the IC card 1 returns to S21 again and starts measuring time from the reception of the waiting time extension response (S21) until the start-up process and the APDU process are completed (S23: Yes). ) Perform subsequent processing. For example, when the memory check and the program check are completed, but the APDU processing to be executed after that takes time, and the APDU processing does not end within the waiting time, a waiting time extension request is made.

このように待ち時間管理部26は、コマンドAPDUの受信(S7)からレスポンスAPDUの送信(S13)までの間、ICカード1は各プロトコルに規定された任意のタイミングでリーダライタ10に対し、待ち時間延長要求を行うことができる。待ち時間延長要求ができるため、起動処理およびAPDU処理に時間がかかる場合でも、待ち時間延長要求を行うことで、処理を最後まで行うことができる。ちなみに、リセットから初期応答の間は待ち時間延長はできない。   As described above, the waiting time management unit 26 waits for the reader / writer 10 to wait for the reader / writer 10 at an arbitrary timing specified in each protocol from the reception of the command APDU (S7) to the transmission of the response APDU (S13). A time extension request can be made. Since a waiting time extension request can be made, even when the startup process and the APDU process take a long time, the processing can be performed to the end by making a waiting time extension request. Incidentally, the waiting time cannot be extended between the reset and the initial response.

図3に戻って、起動処理部24によるハードウェアチェック(S9)が完了すると、ICカード1の起動処理部24は起動処理における各種のチェック結果についてエラーの有無を判断し(S10)、チェック結果に異常があった場合(S10:Yes)、起動処理部24はエラー処理を行う(S11)。エラー処理としては、例えばエラーレスポンスを送信し、それ以上は動作しないように無応答となる、ICカード1自体を恒久的に使用不可能となるように自己処理を行うことができる。   Returning to FIG. 3, when the hardware check (S9) by the activation processing unit 24 is completed, the activation processing unit 24 of the IC card 1 determines whether there are errors in various check results in the activation processing (S10), and the check result. If there is an abnormality (S10: Yes), the activation processing unit 24 performs error processing (S11). As the error processing, for example, an error response is transmitted, and the self-processing can be performed so that the IC card 1 itself becomes permanently unusable so as not to operate any further.

ICカード1はチェック結果に異常がなかった場合(S10:No)、APDU処理部25により受信したコマンドAPDUに基づいてAPDU処理を行い(S12)、コマンドAPDUに対して生成されたレスポンスAPDUを送信部22により送信する(S13)。リーダライタ10はレスポンスAPDU(S14)を受信することでICカード1の起動時の処理は完了する。   If there is no abnormality in the check result (S10: No), the IC card 1 performs APDU processing based on the command APDU received by the APDU processing unit 25 (S12), and transmits a response APDU generated for the command APDU. Transmitted by the unit 22 (S13). When the reader / writer 10 receives the response APDU (S14), the processing at the time of activation of the IC card 1 is completed.

以上の実施形態では、未完の起動処理を最初のコマンドAPDUの受信の後に開始する態様を例に挙げて説明したが、初期応答の後に未完の起動処理(S9’)を開始する態様であれば、これに限定されない。初期応答からコマンドAPDUの受信までの間に未完の起動処理を実行する場合、予想されるコマンドAPDU受信時間までの間に処理可能なものを実行すればよい。   In the above embodiment, an example of starting the incomplete start-up process after receiving the first command APDU has been described as an example. However, if the incomplete start-up process (S9 ′) is started after the initial response, However, the present invention is not limited to this. When an incomplete activation process is executed between the initial response and the reception of the command APDU, what can be processed within the expected command APDU reception time may be executed.

以上説明した本実施形態のICカードおよびICカードの起動方法によれば、ハードウェアの異常を内包したままコマンドAPDU処理を行なうことがなくなるので、ICカードの不正な動作や、コマンドAPDU処理中のエラー発生を防止することができる。またその結果として、ICカード内のデータを悪意のある攻撃者から保護することができる。   According to the IC card and the IC card activation method of the present embodiment described above, the command APDU processing is not performed while the hardware abnormality is included, so that the illegal operation of the IC card or the command APDU processing is not performed. An error can be prevented. As a result, data in the IC card can be protected from malicious attackers.

1 ICカード
10 リーダライタ
11 CPU
12 コプロセッサ
13 乱数発生器
14 I/O
15 ROM
16 RAM
17 EEPROM
21 受信部
22 送信部
23 レスポンス処理部
24 起動処理部
25 APDU処理部
26 待ち時間管理部
1 IC Card 10 Reader / Writer 11 CPU
12 Coprocessor 13 Random number generator 14 I / O
15 ROM
16 RAM
17 EEPROM
21 reception unit 22 transmission unit 23 response processing unit 24 activation processing unit 25 APDU processing unit 26 waiting time management unit

Claims (6)

リーダライタからの起動要求信号に対して規定時間内に初期応答する手段を有するICカードであって、
前記起動要求信号を受信してから初期応答までの間に起動処理を実行する手段と、
前記初期応答の後に前記リーダライタからのコマンドAPDUを受信する手段と、
前記コマンドAPDUを受信した後でも前記起動処理が完了していない場合に、未完の起動処理の実行をし、該起動処理が完了した後に当該コマンドAPDUを実行処理するコマンドAPDU処理と当該コマンドAPDUに対するレスポンスとして該コマンドAPDU処理の結果であるレスポンスAPDUを生成する処理とを実行する手段と、
前記起動処理の完了に続いて実行される前記コマンドAPDU処理の結果として生成されたレスポンスAPDUを前記リーダライタに送信する手段と
を備えることを特徴するICカード。
An IC card having means for initially responding to a start request signal from a reader / writer within a specified time,
Means for executing an activation process between receiving the activation request signal and an initial response;
Means for receiving a command APDU from the reader / writer after the initial response;
If the activation process is not completed even after receiving the command APDU, an incomplete activation process is executed, and after the activation process is completed, the command APDU is executed, and the command APDU is processed. Means for executing a process for generating a response APDU as a result of the command APDU process as a response;
An IC card comprising: means for transmitting a response APDU generated as a result of the command APDU process executed following completion of the activation process to the reader / writer.
前記起動処理の完了に続いて実行される前記コマンドAPDU処理および前記レスポンスAPDUの生成が完了するまで、前記コマンドAPDUに対するレスポンスAPDUの応答時間の延長を要求する手段をさらに備えることを特徴とする請求項1に記載のICカード。   The apparatus further comprises means for requesting an extension of a response time of the response APDU for the command APDU until the command APDU process executed following completion of the activation process and the generation of the response APDU are completed. Item 1. The IC card according to Item 1. 前記初期応答から前記コマンドAPDUの受信までの間に処理可能な未完のハードウェアチェックが存在する場合に、当該未完のハードウェアチェックを実行する手段をさらに備えることを特徴とする請求項1または2に記載のICカード。   3. The apparatus according to claim 1, further comprising means for executing an incomplete hardware check when there is an incomplete hardware check that can be processed between the initial response and reception of the command APDU. IC card according to. リーダライタからの起動要求信号に対して規定時間内に初期応答する手段を有するICカードの起動処理方法であって、
前記起動要求信号を受信してから初期応答までの間に起動処理を実行するステップと、
前記初期応答の後に前記リーダライタからのコマンドAPDUを受信するステップと、
前記コマンドAPDUを受信した後でも前記起動処理が完了していない場合に、未完の起動処理の実行をし、該起動処理が完了した後に当該コマンドAPDUを実行処理するコマンドAPDU処理と当該コマンドAPDUに対するレスポンスとして該コマンドAPDU処理の結果であるレスポンスAPDUを生成する処理とを実行するステップと、
前記起動処理の完了に続いて実行される前記コマンドAPDU処理の結果として生成されたレスポンスAPDUを前記リーダライタに送信するステップと
を含むことを特徴するICカードの起動処理方法。
An IC card activation processing method comprising means for initially responding within a specified time to an activation request signal from a reader / writer,
Performing a startup process between receiving the startup request signal and an initial response; and
Receiving a command APDU from the reader / writer after the initial response;
If the activation process is not completed even after receiving the command APDU, an incomplete activation process is executed, and after the activation process is completed, the command APDU is executed, and the command APDU is processed. Executing a process of generating a response APDU that is a result of the command APDU process as a response;
And a step of transmitting a response APDU generated as a result of the command APDU process executed following completion of the activation process to the reader / writer.
前記起動処理の完了に続いて実行される前記コマンドAPDU処理および前記レスポンスAPDUの生成が完了するまで、前記コマンドAPDUに対するレスポンスAPDUの応答時間の延長を要求するステップをさらに含むことを特徴とする請求項4に記載のICカードの起動処理方法。   The method further comprises a step of requesting an extension of a response time of the response APDU for the command APDU until the command APDU processing executed following completion of the activation processing and generation of the response APDU are completed. Item 5. An IC card activation processing method according to Item 4. 前記初期応答から前記コマンドAPDUの受信までの間に処理可能な未完のハードウェアチェックが存在する場合に、当該未完のハードウェアチェックを実行するステップをさらに備えることを特徴とする請求項4または5に記載のICカードの起動処理方法。   6. The method according to claim 4, further comprising a step of executing the incomplete hardware check when there is an incomplete hardware check that can be processed between the initial response and reception of the command APDU. 2. An activation process method for an IC card according to 1.
JP2014234539A 2014-11-19 2014-11-19 Ic card and its starting method Pending JP2016099711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014234539A JP2016099711A (en) 2014-11-19 2014-11-19 Ic card and its starting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014234539A JP2016099711A (en) 2014-11-19 2014-11-19 Ic card and its starting method

Publications (1)

Publication Number Publication Date
JP2016099711A true JP2016099711A (en) 2016-05-30

Family

ID=56077115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014234539A Pending JP2016099711A (en) 2014-11-19 2014-11-19 Ic card and its starting method

Country Status (1)

Country Link
JP (1) JP2016099711A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63198119A (en) * 1987-02-13 1988-08-16 Toshiba Corp Processing system
JPH04338823A (en) * 1991-05-16 1992-11-26 N T T Data Tsushin Kk Detecting method for illicit alteration of soft module using ic card
JPH09330273A (en) * 1996-06-10 1997-12-22 Mitsubishi Electric Corp Memory card, and error correcting method therefor
JP2001236483A (en) * 1999-12-13 2001-08-31 Toshiba Corp Portable electronic device
JP2002222402A (en) * 2001-01-24 2002-08-09 Dainippon Printing Co Ltd Ic card
JP2003115038A (en) * 2001-10-09 2003-04-18 Nikon Gijutsu Kobo:Kk Computer of image receiving server
JP2012038297A (en) * 2010-07-13 2012-02-23 Dainippon Printing Co Ltd Ic chip, processing method of ic chip, processing program for ic chip, and portable terminal
JP2014059731A (en) * 2012-09-18 2014-04-03 Toshiba Corp Ic card and mobile electronic device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63198119A (en) * 1987-02-13 1988-08-16 Toshiba Corp Processing system
JPH04338823A (en) * 1991-05-16 1992-11-26 N T T Data Tsushin Kk Detecting method for illicit alteration of soft module using ic card
JPH09330273A (en) * 1996-06-10 1997-12-22 Mitsubishi Electric Corp Memory card, and error correcting method therefor
JP2001236483A (en) * 1999-12-13 2001-08-31 Toshiba Corp Portable electronic device
JP2002222402A (en) * 2001-01-24 2002-08-09 Dainippon Printing Co Ltd Ic card
JP2003115038A (en) * 2001-10-09 2003-04-18 Nikon Gijutsu Kobo:Kk Computer of image receiving server
JP2012038297A (en) * 2010-07-13 2012-02-23 Dainippon Printing Co Ltd Ic chip, processing method of ic chip, processing program for ic chip, and portable terminal
JP2014059731A (en) * 2012-09-18 2014-04-03 Toshiba Corp Ic card and mobile electronic device

Similar Documents

Publication Publication Date Title
JP4896837B2 (en) Portable electronic device and method for controlling portable electronic device
CN113348110B (en) Electronic control device and security verification method for electronic control device
US20140189223A1 (en) Ic card, portable electronic device, and method of controlling ic card
JP2018508063A (en) Secure element
US20060289656A1 (en) Portable electronic apparatus and data output method therefor
JP6354438B2 (en) Information processing apparatus, information processing system, and processing program
CN115454517B (en) Method, system, storage medium, device and chip for multi-medium secure boot
KR102099739B1 (en) How to manage secure elements
JP2016099711A (en) Ic card and its starting method
JP2011022841A (en) Processing system for portable electronic apparatus, portable electronic apparatus, and processing apparatus for portable electronic apparatus
JP5695037B2 (en) Equipment with time-limited auto-start application
JP6182940B2 (en) IC card, status word output method, and status word output processing program
JP5019210B2 (en) Portable electronic device, IC card, and control method for portable electronic device
JP6969114B2 (en) IC card, IC card startup processing method, and IC card startup processing program
JP4899499B2 (en) IC card issuing method, IC card issuing system, and IC card
JP5444143B2 (en) Portable electronic device and IC card
JP2005258968A (en) Validity verification method of data written in ic card, and program for ic card
JP2006293706A (en) Multi-application ic card with application updating function
JP5464053B2 (en) Authentication processing apparatus, authentication processing method, authentication processing program, processing system, and automatic teller machine
JP2011232837A (en) Ic card and computer program for ic card
JP6326835B2 (en) Information processing apparatus, IC card, command processing method, and command processing program
JP6610002B2 (en) Arithmetic apparatus, arithmetic method, and arithmetic processing program
JP2007011591A (en) Portable electronic device and ic card
JP6493672B2 (en) Electronic information storage medium, abnormality detection method, abnormality detection program, and IC card
JP2004102885A (en) Apparatus for reading non-contact ic card

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171019

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180807

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180920

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20181120

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190118

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20190219