JP2005182774A - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
JP2005182774A
JP2005182774A JP2004342650A JP2004342650A JP2005182774A JP 2005182774 A JP2005182774 A JP 2005182774A JP 2004342650 A JP2004342650 A JP 2004342650A JP 2004342650 A JP2004342650 A JP 2004342650A JP 2005182774 A JP2005182774 A JP 2005182774A
Authority
JP
Japan
Prior art keywords
program
secure
normal
data processing
unit
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.)
Granted
Application number
JP2004342650A
Other languages
Japanese (ja)
Other versions
JP4629416B2 (en
JP2005182774A5 (en
Inventor
Takayuki Ito
孝幸 伊藤
Teruto Hirota
照人 廣田
Koichi Kanemura
孝一 金村
Tomoyuki Haga
智之 芳賀
Yoshikatsu Ito
好克 井藤
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004342650A priority Critical patent/JP4629416B2/en
Publication of JP2005182774A publication Critical patent/JP2005182774A/en
Publication of JP2005182774A5 publication Critical patent/JP2005182774A5/ja
Application granted granted Critical
Publication of JP4629416B2 publication Critical patent/JP4629416B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data processor capable of reducing secure resource since a load on a protection mechanism for protecting the resource is increased when the secure resource is increased in a secure mode in the data processor executing a process while switching between the secure mode for accessing the secure resource to be protected and a normal mode disabled to access the secure resource. <P>SOLUTION: This date processor stores at least one processing procedure utilizing the secure resource and a secure program including a call instruction for calling a normal program executed in the normal mode, calls the normal program by the call instruction during execution of the secure program and operates according to the normal program called. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、セキュアリソースにアクセス可能なセキュアモードと、セキュアリソース以外の通常リソースにのみアクセス可能な通常モードとを切り替えて、プログラムを実行する装置において、セキュアモードで実行されるプログラムと通常モードで実行されるプログラムとを対応して動作させる技術に関する。   The present invention switches between a secure mode in which a secure resource can be accessed and a normal mode in which only a normal resource other than the secure resource can be accessed to execute a program in a program executed in the secure mode and in the normal mode. The present invention relates to a technique for operating a program to be executed correspondingly.

近年、様々な機器において、音楽及び映像を含むデジタルコンテンツが取り扱われるようになっている。これらの機器は、デジタルコンテンツを劣化させることなく複製、編集することが可能である。しかし、著作権の観点から、これらのデジタルコンテンツは、保護されて扱われる必要がある。
従来技術によると、保護される必要のあるセキュアデータ及び保護される必要のあるセキュアアプリケーションへのアクセスが可能なセキュアモードと、これらのセキュアデータ及びセキュアアプリケーションにアクセスすることができない通常モードとをモニタによって切り替えて実行するデータ処理装置が開示されている。この技術よると、通常モードにおいて動作するアプリケーションは、通常モードで動作するオペレーティングシステムを介して、セキュアアプリケーションへ処理を依頼する。オペレーティングシステムは、モニタへ実行モードの切替を依頼し、モニタは、実行モードを切り替える。セキュアアプリケーションは、依頼された処理を行い、処理結果をセキュア実行モードで動作するセキュアオペレーティングシステムを介して、アプリケーションへ返却する。セキュアオペレーティングシステムは、モニタに実行モードの切替を依頼し、モニタは実行モードを切り替える。このような構成により、セキュアモードと通常モードとを切り替えて実行することで、通常モードで動作するアプリケーションから、直接セキュアデータやセキュアアプリケーションへアクセスすることはできない。従って、セキュアデータ及びセキュアアプリケーションを保護することができる。
A New Foundation for CPU Systems Security(平成15年11月20日検索、URL:http://www.arm.com/armtech.nsf/htmlall/FC4C07580E29428080256D1A004A2345/$File/TrustZone_WP.pdf?OpenElement)
In recent years, digital contents including music and video have been handled in various devices. These devices can copy and edit digital contents without degrading them. However, from the viewpoint of copyright, these digital contents need to be handled protected.
According to the prior art, a secure mode that allows access to secure data that needs to be protected and a secure application that needs to be protected, and a normal mode that cannot access these secure data and secure applications are monitored. Discloses a data processing apparatus that performs switching. According to this technique, an application that operates in the normal mode requests a process to the secure application via an operating system that operates in the normal mode. The operating system requests the monitor to switch the execution mode, and the monitor switches the execution mode. The secure application performs the requested processing, and returns the processing result to the application via the secure operating system that operates in the secure execution mode. The secure operating system requests the monitor to switch the execution mode, and the monitor switches the execution mode. With such a configuration, the secure mode and the secure application cannot be directly accessed from the application operating in the normal mode by switching between the secure mode and the normal mode. Therefore, secure data and secure applications can be protected.
A New Foundation for CPU Systems Security (searched on November 20, 2003, URL: http://www.arm.com/armtech.nsf/htmlall/FC4C07580E29428080256D1A004A2345/$File/TrustZone_WP.pdf?OpenElement)

しかしながら、従来技術の示す方法では、セキュアモードで使用するデータ及びプログラムなどを記憶するメモリを、通常モードで使用するメモリとは別個に確保する必要がある。セキュアモードで使用されるメモリは、不正なアクセスから当該メモリを保護する保護機構を必要とする。従って、セキュアモードで使用されるメモリが増加すると、保護機構に係る負荷が大きくなり、保護機構の規模を大きくする必要が生じる。ゆえに、セキュアモードで使用されるメモリを削減することができるデータ処理装置に対する要望がある。   However, in the method shown by the prior art, it is necessary to secure a memory for storing data and programs used in the secure mode separately from the memory used in the normal mode. Memory used in secure mode requires a protection mechanism that protects the memory from unauthorized access. Therefore, when the memory used in the secure mode increases, the load related to the protection mechanism increases, and it is necessary to increase the scale of the protection mechanism. Therefore, there is a need for a data processing apparatus that can reduce the memory used in the secure mode.

そこで本発明はかかる問題点に鑑みてなされたものであり、セキュアモードで使用される、メモリを削減することができるデータ処理装置、データ処理方法、データ処理プログラム及び記録媒体を提供することを目的とする。   Therefore, the present invention has been made in view of such problems, and an object thereof is to provide a data processing device, a data processing method, a data processing program, and a recording medium that can be used in the secure mode and can reduce the memory. And

上記目的を達成するために本発明は、保護対象のセキュアリソースの利用が許可されるセキュアモードと、保護対象外の通常リソースの利用のみが許可される通常モードとを切り替えて、プログラムを実行するデータ処理装置であって、前記通常リソースを利用する1つ以上の処理手順から構成される通常プログラムを記憶している通常記憶手段と、前記セキュアリソースを利用する1つ以上の処理手順から構成され、少なくとも前記通常プログラムを呼び出す呼出命令を含むセキュアプログラムを記憶しているセキュア記憶手段と、セキュアモードにおいて、次に実行すべき命令が、前記呼出命令であるか否かを判断する判断手段と、セキュアモードにおいて、前記呼出命令であると判断される場合に、当該呼出命令により呼び出される前記通常プログラムを示す識別情報を出力する出力手段と、前記呼出命令であると判断される場合に、セキュアリソースを保護して、セキュアモードから通常モードに切り替える切替手段と、通常モードにおいて、前記識別情報を受け取る受取手段と、通常モードにおいて、受け取った前記識別情報により示される前記通常プログラムを前記通常記憶手段から読み出す読出手段と、通常モードにおいて、読み出した通常プログラムに従って動作する処理手段とを備えることを特徴とする。   To achieve the above object, the present invention executes a program by switching between a secure mode in which use of a secure resource to be protected is permitted and a normal mode in which only use of a normal resource that is not protected is permitted. A data processing apparatus, comprising a normal storage means for storing a normal program composed of one or more processing procedures using the normal resource, and one or more processing procedures using the secure resource. A secure storage unit storing a secure program including at least a call instruction for calling the normal program; a determination unit for determining whether an instruction to be executed next in the secure mode is the call instruction; In the secure mode, when it is determined that it is the call instruction, before being called by the call instruction An output unit that outputs identification information indicating a normal program; a switching unit that protects a secure resource and switches from a secure mode to a normal mode when the call instruction is determined; and the identification information in the normal mode. Receiving means, reading means for reading out the normal program indicated by the received identification information from the normal storage means in the normal mode, and processing means operating in accordance with the read normal program in the normal mode. Features.

上記の構成によると、前記セキュアプログラムは、前記呼出命令を含み、次に実行すべき命令が、前記呼出し命令である場合、切替手段は、セキュアモードから通常モードに切り替え、通常モードにおいて、受取手段は、前記識別情報を受け取り、読出手段は、受け取った前記識別情報により示される前記通常プログラムを前記通常記憶手段から読み出し、処理手段は、読み出した通常プログラムに従って動作する。従って、前記呼出し命令を実行することで、前記セキュアプログラムは、通常モードで動作する通常プログラムへ、処理を依頼することができる。つまり、セキュアリソースを利用しない処理を通常プログラムに実行させることにより、セキュアプログラム自体のプログラムサイズが減少する。さらに、セキュアモードにおいて、セキュアプログラムが使用するメモリを減少させることができる。   According to the above configuration, when the secure program includes the call instruction, and the instruction to be executed next is the call instruction, the switching unit switches from the secure mode to the normal mode, and in the normal mode, the reception unit Receives the identification information, the reading means reads the normal program indicated by the received identification information from the normal storage means, and the processing means operates according to the read normal program. Therefore, by executing the call instruction, the secure program can request the normal program operating in the normal mode for processing. That is, by causing a normal program to execute processing that does not use secure resources, the program size of the secure program itself is reduced. Furthermore, the memory used by the secure program can be reduced in the secure mode.

前記データ処理装置において、前記切替手段は、前記セキュアプログラムを制御するセキュアオペレーティングシステムを中断させ、前記通常プログラムを制御する通常オペレーティングシステムを起動することにより、セキュアモードから通常モードに切り替える。
この構成によると、前記切替手段は、前記セキュアオペレーティングシステムを中断させた後、通常オペレーティングシステムを起動する。このため、当該データ処理装置は、通常モードで動作中には、前記セキュアリソースへのアクセスルートを完全に切断し、セキュアモードと通常モードとを排他的に実現することができる。
In the data processing device, the switching means switches from the secure mode to the normal mode by interrupting the secure operating system that controls the secure program and starting the normal operating system that controls the normal program.
According to this configuration, the switching unit starts the normal operating system after interrupting the secure operating system. For this reason, the data processing apparatus can completely realize the secure mode and the normal mode by completely disconnecting the access route to the secure resource while operating in the normal mode.

また、前記データ処理装置は、セキュアモード及び通常モードの両方において、アクセスが許可される共有記憶領域を備え、前記出力手段は、セキュアモードにおいて、前記識別情報を前記共有記憶領域に書き込むことにより、前記識別情報を出力し、前記受取手段は、通常モードにおいて、前記共有記憶領域から前記識別情報を読み出すことにより、前記識別情報を受け取ることを特徴とする。   The data processing apparatus includes a shared storage area that is allowed to be accessed in both the secure mode and the normal mode, and the output unit writes the identification information in the shared storage area in the secure mode, The identification information is output, and the receiving means receives the identification information by reading the identification information from the shared storage area in a normal mode.

この構成によると、前記共有記憶領域は、通常モード及びセキュアモードにおいてアクセス可能である。従って、本発明のデータ処理装置は、セキュアモードと通常モードとを排他的に実現して、セキュアリソースを保護しながら、セキュアモードと通常モードとの間で確実に情報の授受を行うことができる。
また、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出すことを特徴とする。
According to this configuration, the shared storage area can be accessed in the normal mode and the secure mode. Therefore, the data processing apparatus of the present invention can implement the secure mode and the normal mode exclusively, and can securely exchange information between the secure mode and the normal mode while protecting the secure resources. .
The reading means stores the identification information and position information indicating the position of the normal program in the normal storage means in association with each other, and the presence indicated by the position information corresponding to the received identification information. The normal program is read from the position.

この構成によると、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しているため、受け取った識別情報対応する位置情報を用いて、確実かつ迅速に、前記通常プログラムを読み出すことができる。
前記データ処理装置において、前記通常プログラムを構成する1の処理手順は、ライブラリを構成する複数の関数を含み、他の処理手順は、前記複数の関数のうちのいずれかを呼び出し、前記処理手段は、前記他の処理手順に従って動作する場合に、当該他の処理手順により呼び出される関数に従って動作することを特徴とする。
According to this configuration, since the reading unit stores the identification information and the position information indicating the location of the normal program in the normal storage unit in association with each other, the position information corresponding to the received identification information is used. Thus, the normal program can be read reliably and quickly.
In the data processing apparatus, one processing procedure constituting the normal program includes a plurality of functions constituting a library, and the other processing procedure calls one of the plurality of functions. When operating according to the other processing procedure, the operation is performed according to a function called by the other processing procedure.

この構成によると、前記通常プログラムを構成する1つの処理手順は、ライブラリを構成する複数の関数を含み、他の処理手順は、前記複数の関数のうちのいずれかを呼び出す。従って、前記セキュアプログラムは、ライブラリを構成する関数を使用する処理を前記通常プログラムへ依頼することができる。このため、セキュアモードにおいて、メモリ上にライブラリを保持する必要がなくなる。   According to this configuration, one processing procedure constituting the normal program includes a plurality of functions constituting the library, and the other processing procedure calls one of the plurality of functions. Accordingly, the secure program can request the normal program to use a function that constitutes the library. For this reason, it is not necessary to hold the library on the memory in the secure mode.

前記データ処理装置は、さらに、セキュアモードにおいて、前記セキュアプログラムの前記セキュア記憶手段への書き込みを示す書込指示を受け取る指示取得手段と、セキュアモードにおいて、前記書込指示を取得した場合に、前記セキュア記憶手段に前記セキュアプログラムを書き込み、前記書込みが終了したことを示す書込終了情報を出力するセキュアロード手段とを含み、前記切替手段は、さらに、前記書込終了情報が出力された場合、セキュアモードから通常モードへ切り替え、前記データ処理装置は、さらに、通常モードにおいて、前記書込終了情報を受け取り、前記通常記憶手段に前記通常プログラムを書き込む通常ロード手段とを含むことを特徴とする。   The data processing apparatus further includes: an instruction acquisition unit that receives a write instruction indicating writing of the secure program to the secure storage unit in the secure mode; and the data processing apparatus, when the write instruction is acquired in the secure mode, A secure load unit that writes the secure program to a secure storage unit and outputs write end information indicating that the write is completed, and the switching unit further outputs the write end information, Switching from the secure mode to the normal mode, the data processing device further includes normal load means for receiving the write end information and writing the normal program in the normal storage means in the normal mode.

この構成によると、指示取得手段が、書込指示を取得した場合に、前記セキュアロード手段がセキュアモードにおいて、前記セキュアプログラムの前記セキュア記憶手段への書き込みを示す書込指示を受け取ると、前記セキュア記憶手段に前記セキュアプログラムを書き込み、前記通常ロード手段が前記通常記憶手段に前記通常プログラムを書き込む。このようにすることで、前記セキュアプログラムの実行中には、常に、前記通常記憶手段に前記通常プログラムが記憶されており、セキュアプログラム含まれる呼出し命令が実行される際には、速やかに前記通常プログラムの実行に移ることができる。   According to this configuration, when the instruction acquisition unit acquires the write instruction, the secure load unit receives the write instruction indicating the writing of the secure program to the secure storage unit in the secure mode. The secure program is written in the storage means, and the normal load means writes the normal program in the normal storage means. By doing so, the normal program is always stored in the normal storage means during execution of the secure program, and when the call instruction included in the secure program is executed, the normal program is promptly stored. You can move on to program execution.

前記データ処理装置を構成する前記読出手段は、さらに、通常モードにおいて、前記通常ロード手段により前記通常プログラムが前記通常記憶手段に書き込まれた場合に、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶することを特徴とする。
この構成では、前記読出手段は、前記通常プログラムが前記通常記憶手段に書き込まれた場合に、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶する。このようにすることで、前記セキュアプログラムのロード直後から、前記読出手段は前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶している。従って、セキュアプログラム含まれる呼出し命令が実行される際には、速やかに前記通常プログラムを読み出すことができる。
In the normal mode, the reading means constituting the data processing apparatus further includes the identification information and the normal program in the normal storage means when the normal load means writes the normal program in the normal storage means. The position information indicating the existence position of each is stored in association with each other.
In this configuration, when the normal program is written in the normal storage unit, the reading unit stores the identification information and position information indicating the location of the normal program in the normal storage unit in association with each other. . In this way, immediately after loading the secure program, the reading unit stores the identification information and the location information indicating the location of the normal program in the normal storage unit in association with each other. Therefore, when the call instruction included in the secure program is executed, the normal program can be read quickly.

前記データ処理装置は、さらに、セキュアモードにおいて、前記セキュアプログラムの削除を指示する削除指示を取得する削除指示取得手段と、前記削除指示を取得した場合に、セキュアモードにおいて、前記セキュアプログラムを前記セキュア記憶手段から削除し、前記削除が終了したことを示す削除終了情報を出力するセキュア削除手段とを含み、前記切替手段は、さらに、前記削除終了情報が出力された場合、セキュアモードから通常モードへ切り替え、前記データ処理装置は、さらに、通常モードにおいて、前記削除終了情報を取得し、前記通常記憶手段から前記通常プログラムを削除する通常削除手段を含むことを特徴とする。   In the secure mode, the data processing device further includes a deletion instruction acquisition means for acquiring a deletion instruction for instructing deletion of the secure program, and when the deletion instruction is acquired, the data processing apparatus executes the secure program in the secure mode. And a secure deletion unit that outputs deletion end information indicating that the deletion is completed, and the switching unit further switches from the secure mode to the normal mode when the deletion end information is output. In the normal mode, the data processing device further includes normal deletion means for acquiring the deletion end information and deleting the normal program from the normal storage means.

この構成によると、削除指示取得手段が前記セキュアプログラムの削除を指示する削除指示を取得すると、セキュア削除手段が、前記セキュアプログラムを前記セキュア記憶手段から削除し、通常削除手段が、前記通常記憶手段から前記通常プログラムを削除する。
従って、前記セキュアプログラムがロードされていない間は、前記通常プログラムもロードする必要がないため、このようにすることで、前記通常プログラムによって、通常モードで使用するメモリ領域を無駄にすることを防ぐことができる。
According to this configuration, when the deletion instruction acquisition unit acquires a deletion instruction for instructing deletion of the secure program, the secure deletion unit deletes the secure program from the secure storage unit, and the normal deletion unit performs the normal storage unit. The normal program is deleted from
Therefore, since the normal program does not need to be loaded while the secure program is not loaded, this prevents the normal program from wasting a memory area used in the normal mode. be able to.

前記データ処理装置において、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出すことを特徴とする。
この構成によると、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しているため、受け取った識別情報対応する位置情報を用いて、確実かつ迅速に、前記通常プログラムを読み出すことができる。
In the data processing apparatus, the reading means stores the identification information and position information indicating the location of the normal program in the normal storage means in association with each other, and the position information corresponding to the received identification information The normal program is read from the existing position indicated by.
According to this configuration, since the reading unit stores the identification information and the position information indicating the location of the normal program in the normal storage unit in association with each other, the position information corresponding to the received identification information is used. Thus, the normal program can be read reliably and quickly.

前記データ処理装置は、さらに、前記処理手段を含む当該データ処理装置の備える1以上のデバイスを初期化する初期化手順及び前記セキュアオペレーティングシステムを起動する起動手順を含むブートプログラムを記憶しているブートプログラム記憶手段と、前記ブートプログラム記憶手段から、前記ブートプログラムを読み出し、読み出した前記ブートプログラムに従って、前記デバイスを初期化し、初期化の完了後に、セキュアオペレーティングシステムを起動する初期化手段とを備えることを特徴とする。   The data processing device further stores a boot program including an initialization procedure for initializing one or more devices included in the data processing device including the processing means and a startup procedure for starting the secure operating system. Program storage means and initialization means for reading the boot program from the boot program storage means, initializing the device according to the read boot program, and starting a secure operating system after the initialization is completed It is characterized by.

この構成によると、前記初期化手は、段電源投入時に前記ブートプログラムに従って、前記デバイスを初期化し、初期化の完了後に、セキュアオペレーティングシステムを起動する。このように、本発明のデータ処理装置は、通常モードで実行されるプログラムを起動する前に、セキュアオペレーティングシステムを起動することで、起動時に、通常モードで実行されるプログラムの不正な動作により、セキュアモードで実行されるプログラムやセキュアリソースの不正な利用を防ぐことができる。   According to this configuration, the initialization unit initializes the device in accordance with the boot program when power is turned on, and starts the secure operating system after the initialization is completed. As described above, the data processing device of the present invention starts the secure operating system before starting the program executed in the normal mode. Unauthorized use of programs and secure resources executed in secure mode can be prevented.

前記データ処理装置は、さらに、通常モードにおいて、前記処理手段による処理結果と前記セキュアプログラムを示すセキュア識別情報とを出力する通常出力手段を含み、前記切替手段は、さらに、前記処理結果が出力された場合、通常モードからセキュアモードへ切り替え、前記データ処理装置は、さらに、セキュアモードにおいて、前記処理結果と前記セキュア識別情報とを受け取るセキュア受取手段と、受け取った前記セキュア識別情報に対応する前記セキュアプログラムを前記通常記憶手段から読み出すセキュア読出手段とを含み、前記処理手段は、さらに、セキュアモードにおいて、前記処理結果を用いて、前記セキュアプログラムに従って動作することを特徴とする。   The data processing device further includes normal output means for outputting a processing result by the processing means and secure identification information indicating the secure program in the normal mode, and the switching means further outputs the processing result. In the secure mode, the data processing device further switches, in the secure mode, secure receiving means for receiving the processing result and the secure identification information, and the secure processing corresponding to the received secure identification information. Secure reading means for reading the program from the normal storage means, and the processing means further operates in accordance with the secure program using the processing result in a secure mode.

この構成では、通常出力手段は、通常モードにおいて、前記処理手段による処理結果と前記セキュアプログラムを示すセキュア識別情報とを出力し、セキュア受取手段は、セキュアモードにおいて、前記処理結果と前記セキュア識別情報とを受け取り、セキュア読出手段は、受け取った前記セキュア識別情報に対応する前記セキュアプログラムを前記通常記憶手段から読み出し、前記処理手段は、さらに、セキュアモードにおいて、前記処理結果を用いて、前記セキュアプログラムに従って動作する。従って、本発明のデータ処理装置では、セキュアモードで実行される前記セキュアプログラムにより依頼された処理を、通常モードにおいて前記処理手段が前記通常プログラムに従って実行し、処理結果を正確に、前記セキュアプログラムへ返すことができる。   In this configuration, the normal output means outputs the processing result by the processing means and secure identification information indicating the secure program in the normal mode, and the secure receiving means outputs the processing result and the secure identification information in the secure mode. The secure reading means reads the secure program corresponding to the received secure identification information from the normal storage means, and the processing means further uses the processing result in the secure mode to Works according to. Therefore, in the data processing apparatus of the present invention, the processing unit executes the processing requested by the secure program executed in the secure mode according to the normal program in the normal mode, and the processing result is accurately transferred to the secure program. Can return.

また、前記データ処理装置において、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースと前記処理手段とを切断することを特徴とする。
この構成によると、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースと前記処理手段とを切断するため、通常モードにおいて、前記処理手段は、前記セキュアリソースにアクセスすることができない。従って、前記セキュアリソースの安全を確保することができる。
In the data processing device, the switching unit disconnects the secure resource and the processing unit when switching from the secure mode to the normal mode.
According to this configuration, the switching unit disconnects the secure resource and the processing unit when switching from the secure mode to the normal mode. Therefore, in the normal mode, the processing unit can access the secure resource. Can not. Therefore, safety of the secure resource can be ensured.

前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースに保持されているセキュア情報を暗号化することを特徴とする。
この構成では、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースに保持されているセキュア情報を暗号化するため、通常モードにおいて、前記処理手段は、前記セキュアデータを利用することができない。従って、通常モードにおいて、前記セキュアリソースの保持するセキュアデータの安全を確保することができる。
The switching means encrypts secure information held in the secure resource when switching from the secure mode to the normal mode.
In this configuration, when the switching unit switches from the secure mode to the normal mode, the processing unit uses the secure data in the normal mode in order to encrypt the secure information held in the secure resource. I can't. Therefore, in the normal mode, it is possible to ensure the safety of the secure data held by the secure resource.

前記データ処理装置において、前記セキュアリソースに保持されている前記セキュア情報は、セキュアモードにおいて実行され、命令コード部分とデータ部分とスタック部分から構成されるプログラムを含んでおり、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記命令コード部分を暗号化することを特徴とする。
また、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記データ部分を暗号化するとてもよい。
In the data processing device, the secure information held in the secure resource includes a program that is executed in a secure mode and includes an instruction code portion, a data portion, and a stack portion. When switching from the mode to the normal mode, the instruction code portion is encrypted.
The switching means encrypts the data portion when switching from the secure mode to the normal mode.

また、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記スタック部分を暗号化するとしてもよい。
この構成によると、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記命令コード部分を暗号化する。又は、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記データ部分を暗号化する。又は、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記スタック部分を暗号化する。
The switching means may encrypt the stack portion when switching from the secure mode to the normal mode.
According to this configuration, the switching unit encrypts the instruction code portion when switching from the secure mode to the normal mode. Alternatively, the switching unit encrypts the data portion when switching from the secure mode to the normal mode. Alternatively, the switching unit encrypts the stack portion when switching from the secure mode to the normal mode.

このように、前記プログラムのうち、保護する必要のある部分だけを暗号化することで、暗号化に係る処理負荷を軽くすることができる。
前記データ処理装置は、さらに、前記処理手段の動作を監視し、操作するデバッグ装置からデバッグ操作信号を受け付けるデバッグ受付手段を含み、前記切替手段は、セキュアモードから通常モードに切り替える際に、前記処理手段と前記デバッグ受付手段とを接続し、通常モードからセキュアモードに切り替える際に、前記処理手段と前記デバッグ受付手段とを切断することを特徴とする。
Thus, by encrypting only the part of the program that needs to be protected, the processing load related to encryption can be reduced.
The data processing device further includes a debug accepting unit that receives a debug operation signal from a debug device that monitors and operates an operation of the processing unit, and the switching unit performs the processing when switching from the secure mode to the normal mode. The processing means and the debug accepting means are disconnected when the means is connected to the debug accepting means and the mode is switched from the normal mode to the secure mode.

この構成によると、前記切替手段は、通常モードからセキュアモードに切り替える際に、前記処理手段と前記デバッグ受付手段とを切断するため、本発明のデータ処理装置は、セキュアモードで動作中には、外部のデバッグ装置に動作の監視及び操作されることがないため、前記デバッグ装置から、前記セキュアリソースを保護することができる。
本発明のデータ処理装置において、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出す構成であっても良い。
According to this configuration, the switching unit disconnects the processing unit and the debug receiving unit when switching from the normal mode to the secure mode. Therefore, the data processing apparatus of the present invention operates during the secure mode, Since the operation is not monitored and operated by an external debugging device, the secure resource can be protected from the debugging device.
In the data processing device of the present invention, the reading unit stores the identification information and position information indicating the location of the normal program in the normal storage unit in association with each other, and corresponds to the received identification information. The normal program may be read from the existing position indicated by the position information.

この構成によると、前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しているため、受け取った識別情報対応する位置情報を用いて、確実かつ迅速に、前記通常プログラムを読み出すことができる。
本発明は、第1オペレーティングシステムと第2オペレーティングシステムとを切り替え、各オペレーティングシステムにおいて生成されるプロセスを実行状態、実行待ち状態、休止状態のいずれかに遷移させてプロセスを実行し管理する前記データ処理装置であって、前記第1オペレーティングシステムにおいて、第1プロセスを生成する第1生成手段と、前記第2オペレーティングシステムにおいて、前記第1プロセスと対応する第2プロセスを生成する第2生成手段と、前記第1オペレーティングシステムにおいて、前記第1プロセスの状態遷移を検出する第1検出手段と、前記第1オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第1出力手段と、前記第1オペレーティングシステムを前記第2オペレーティングシステムに切り替えるOS切替手段と、前記第2オペレーティングシステムにおいて、前記遷移情報を取得する第2取得手段と、取得した前記遷移情報に従って、前記第2プロセスの状態を遷移させる第2遷移手段とを備えることを特徴とするデータ処理装置でもある。
According to this configuration, since the reading unit stores the identification information and the position information indicating the location of the normal program in the normal storage unit in association with each other, the position information corresponding to the received identification information is used. Thus, the normal program can be read reliably and quickly.
The present invention relates to the data for executing and managing a process by switching between a first operating system and a second operating system, and transitioning a process generated in each operating system to an execution state, an execution wait state, or a sleep state. A processing apparatus, wherein the first operating system generates a first process in the first operating system, and the second operating system generates a second process corresponding to the first process in the second operating system; In the first operating system, first detection means for detecting a state transition of the first process; in the first operating system, first output means for outputting transition information indicating the detected state transition; The first operating system is changed to the second OS switching means for switching to a rating system, second acquisition means for acquiring the transition information in the second operating system, and second transition means for transitioning the state of the second process according to the acquired transition information. It is also a data processing device characterized by comprising.

この構成によると、前記第1オペレーティングシステムにおいて、前記第1出力手段は、前記遷移情報を出力し、OS切替手段は、前記第1オペレーティングシステムを前記第2オペレーティングシステムに切り替える第2オペレーティングシステムへ切り替え、第2オペレーティングシステムにおいて、第2遷移手段は、前記遷移情報に従って、前記第2プロセスの状態を遷移させる。従って、排他的に実行される2つのオペレーティングシステムが動作する前記データ処理装置において、前記第1オペレーティングシステムにより制御される前記第1プロセスの動作状態を、前記第2プロセスを介して前記第2オペレーティングシステムにおいても監視することができる。   According to this configuration, in the first operating system, the first output unit outputs the transition information, and the OS switching unit switches to the second operating system that switches the first operating system to the second operating system. In the second operating system, the second transition means transitions the state of the second process according to the transition information. Therefore, in the data processing apparatus in which two operating systems executed exclusively are operating, the operating state of the first process controlled by the first operating system is changed to the second operating system via the second process. It can also be monitored in the system.

前記データ処理装置は、さらに、前記第2オペレーティングシステムにおいて、前記第2プロセスの状態遷移を検出する第2検出手段と、前記第2オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第2出力手段とを含み、前記OS切替手段は、さらに、前記第2オペレーティングシステムを前記第1オペレーティングシステムに切り替え、前記データ処理装置は、さらに、前記第1オペレーティングシステムにおいて、前記遷移情報を取得する第1取得手段と、取得した前記遷移情報に従って、前記第1プロセスの状態を遷移させる第1遷移手段とを含むことを特徴とする。   The data processing apparatus further outputs second detection means for detecting a state transition of the second process in the second operating system and transition information indicating the detected state transition in the second operating system. A second output unit, wherein the OS switching unit further switches the second operating system to the first operating system, and the data processing device further acquires the transition information in the first operating system. And first transition means for transitioning the state of the first process according to the acquired transition information.

この構成によると、前記第2出力手段は、前記第2オペレーティングシステムにおいて、前記遷移情報を出力し、前記第1遷移手段は、前記遷移情報に従って、前記第1プロセスの状態を遷移させる。これにより、前記第2オペレーティングシステムにより制御される前記第2プロセスの動作状態を、前記第1プロセスを介して、前記第1オペレーティングシステムにおいても監視することができる。従って、前記第1オペレーティングシステム及び前記第2オペレーティングシステムは、それぞれの制御する第1プロセス及び第2プロセスの動作状態を相互に監視することができる。   According to this configuration, the second output unit outputs the transition information in the second operating system, and the first transition unit transitions the state of the first process according to the transition information. As a result, the operating state of the second process controlled by the second operating system can also be monitored in the first operating system via the first process. Accordingly, the first operating system and the second operating system can mutually monitor the operating states of the first process and the second process controlled by the first operating system and the second operating system, respectively.

さらに、前記データ処理装置は、第1オペレーティングシステム及び第2オペレーティングシステムの両方において、アクセス可能な共有記憶領域を備え、前記第1出力手段は、前記共有記憶領域に前記遷移情報を書き込むことにより、前記遷移情報を出力し、前記第2取得手段は、前記共有記憶領域から前記遷移情報を読み出すことによって、前記遷移情報を取得することを特徴とする。   Further, the data processing device includes a shared storage area accessible in both the first operating system and the second operating system, and the first output means writes the transition information in the shared storage area, The transition information is output, and the second acquisition unit acquires the transition information by reading the transition information from the shared storage area.

この構成によると、前記第1出力手段及び前記第2取得手段は、第1オペレーティングシステム及び第2オペレーティングシステムの両方において、アクセス可能な前記共有記憶領域を介して前記遷移情報受け渡す。前記共有記憶領域は、第1オペレーティングシステム及び第2オペレーティングシステムの両方において、アクセス可能であるので、本発明のデータ処理装置は、第1オペレーティングシステムと第2オペレーティングシステムとを排他的に実行しながら、第1オペレーティングシステムから第2オペレーティングシステムへ情報を受け渡すことができる。   According to this configuration, the first output unit and the second acquisition unit pass the transition information via the accessible shared storage area in both the first operating system and the second operating system. Since the shared storage area is accessible in both the first operating system and the second operating system, the data processing apparatus of the present invention executes the first operating system and the second operating system exclusively. , Information can be passed from the first operating system to the second operating system.

前記データ処理装置を構成する前記第2出力手段は、前記共有記憶領域に前記遷移情報を書き込むことにより、前記遷移情報を出力し、前記第1取得手段は、前記共有記憶領域から前記遷移情報を読み出すことによって、前記遷移情報を取得することを特徴とする。
従って、第2オペレーティングシステムと第1オペレーティングシステムとを排他的に実行しながら、第2オペレーティングシステムから第1オペレーティングシステムへ情報を受け渡すことができる。
The second output means constituting the data processing device outputs the transition information by writing the transition information to the shared storage area, and the first acquisition means outputs the transition information from the shared storage area. The transition information is acquired by reading.
Accordingly, information can be transferred from the second operating system to the first operating system while exclusively executing the second operating system and the first operating system.

また、前記データ処理装置は、前記第2オペレーティングシステムにおいて管理されて動作するデバイスを含み、前記第2プロセスは、前記デバイスの駆動を制御するデバイス駆動プログラムであり、前記第2検出手段は、前記デバイスの動作に伴う前記第2プロセスの状態遷移を検出することを特徴とする。
この構成によると、前記第2プロセスは、前記デバイスの駆動を制御するデバイス駆動プログラムであり、前記第2検出手段は、前記デバイスの動作に伴う前記第2プロセスの状態遷移を検出する。従って、前記第1プロセスも、前記デバイス駆動プログラムの状態遷移に伴って招待遷移し、前記第1オペレーティングシステムにおいても、前記デバイスの駆動状態を監視することができる。
The data processing apparatus includes a device that is managed and operated in the second operating system, the second process is a device driving program that controls driving of the device, and the second detection unit includes the device A state transition of the second process accompanying the operation of the device is detected.
According to this configuration, the second process is a device driving program that controls driving of the device, and the second detection unit detects a state transition of the second process accompanying the operation of the device. Therefore, the first process also invites and changes with the state transition of the device driving program, and the driving state of the device can be monitored also in the first operating system.

前記第1オペレーティングシステムにおいて、前記第1プロセスが、休止状態から実行状態に遷移した場合、前記データ処理装置は、前記デバイスへの処理依頼の重複を回避する排他処理を行う前記第1プロセスに従って動作し、前記第1オペレーティングシステムにおいて、前記第1出力手段は、前記排他処理が終了した後に前記遷移情報を出力することを特徴とする。   In the first operating system, when the first process transitions from a dormant state to an execution state, the data processing apparatus operates according to the first process that performs exclusive processing to avoid duplication of processing requests to the device. In the first operating system, the first output means outputs the transition information after the exclusion process is completed.

通常、このような排他処理は、前記デバイスの駆動を制御するデバイス駆動プログラムにより実行されるが、この構成によると、前記データ処理装置において、前記第1プロセスが、前記デバイスへの処理依頼の重複を回避する排他処理を行ったあと前記第1オペレーティングシステムにおいて、前記第1出力手段は、前記遷移情報を出力する。出力された前記遷移情報により、前記第2プロセスは実行状態に遷移し、前記デバイスの駆動の制御を開始する。第1オペレーティングシステムと第2オペレーティングシステムにより使用されるメモリ空間が個別に必要であり、特に、第2オペレーティングシステムにより使用されるメモリを外部のアクセスから保護する必要がある場合を想定すると、排他処理を前記第1プロセスが行うため、前記第2プロセスは、排他処理を行う必要がなくなる。従って、排他処理のために、前記第2プロセスが使用するメモリ領域が減少する。このため、保護する必要のあるメモリを削減することになり、これらのメモリを外部から保護する保護機構の負荷を軽減することができる。   Normally, such exclusive processing is executed by a device driving program that controls the driving of the device. According to this configuration, in the data processing apparatus, the first process performs duplication of processing requests to the device. In the first operating system, the first output means outputs the transition information after performing an exclusion process that avoids the above. Based on the output transition information, the second process transitions to an execution state and starts controlling the driving of the device. Exclusive processing is assumed assuming that the memory space used by the first operating system and the second operating system is separately required, and particularly when the memory used by the second operating system needs to be protected from external access. Therefore, the second process does not need to perform exclusive processing. Therefore, the memory area used by the second process is reduced due to the exclusive process. For this reason, the memory which needs to be protected is reduced, and the load of the protection mechanism for protecting these memories from the outside can be reduced.

前記データ処理装置は、さらに、第1オペレーティングシステム及び第2オペレーティングシステムにおいて、割込の発生を検出する割込検出手段と、前記第1オペレーティングシステムにおいて、割込が検出された場合、割込発生要因を調査する割込調査手段と、前記第1オペレーティングシステムにおいて、割込調査手段により、前記デバイスによる割込であると判断された場合、前記第1プロセスを休止状態から実行状態に遷移させる割込遷移手段とを含むことを特徴とする。   The data processing apparatus further includes an interrupt detection means for detecting occurrence of an interrupt in the first operating system and the second operating system, and an interrupt is generated when an interrupt is detected in the first operating system. In the interrupt investigating means for investigating the factor and the first operating system, when the interrupt investigating means determines that the interrupt is caused by the device, the interrupt that causes the first process to transition from the sleep state to the execution state. And a transition means.

さらに、前記データ処理装置は、前記第2オペレーティングシステムにおいて、割込が検出された場合、割込の検出を示す割込通知情報を出力する通知手段を含み、前記OS切替手段は、前記第2オペレーティングシステムを前記第1オペレーティングシステムに切り替え、前記第1取得手段は、さらに、前記第1オペレーティングシステムにおいて、前記割込通知情報を取得し、前記割込調査手段は、さらに、第1オペレーティングシステムにおいて、前記割込通知情報を取得した場合、割込発生要因を調査する構成である。   Furthermore, the data processing device includes a notification unit that outputs interrupt notification information indicating detection of an interrupt when an interrupt is detected in the second operating system, and the OS switching unit includes the second switching unit. The operating system is switched to the first operating system, the first acquisition means further acquires the interrupt notification information in the first operating system, and the interrupt investigation means further in the first operating system When the interrupt notification information is acquired, an interrupt generation factor is investigated.

この構成によると、前記第1オペレーティングシステムにおいて、割込が検出された場合、割込調査手段が、割込発生要因を調査する。また、前記第2オペレーティングシステムにおいて、割込が検出された場合、前記通知手段が割込の検出を示す割込通知情報を出力し、第1オペレーティングシステムにおいて、割込調査手段が、割込発生要因を調査する。   According to this configuration, when an interrupt is detected in the first operating system, the interrupt investigating unit investigates an interrupt occurrence factor. Further, when an interrupt is detected in the second operating system, the notification means outputs interrupt notification information indicating the detection of the interrupt. In the first operating system, the interrupt investigation means generates an interrupt. Investigate the factors.

このようにすることで、第2オペレーティングシステムの管理下に割込調査手段を供える必要がなくなる。従って、本発明のデータ処理装置において、一つだけ、割込調査手段を備えればよい。
前記データ処理装置において、前記通知手段は、割込が検出された場合、前記割込検出手段に対して、割込の検出を停止させ、前記第1取得手段は、前記割込通知情報を取得した場合、前記割込検出手段に対して、前記停止を解除することを特徴とする。
In this way, it is not necessary to provide an interrupt investigation means under the management of the second operating system. Therefore, the data processing apparatus of the present invention only needs to have one interrupt investigation means.
In the data processing device, when an interrupt is detected, the notification unit causes the interrupt detection unit to stop detecting the interrupt, and the first acquisition unit acquires the interrupt notification information. In this case, the stop is canceled with respect to the interrupt detection means.

この構成によると、前記通知手段は、割込が検出された場合、前記割込検出手段に対して、割込の検出を停止させ、前記第1取得手段は、前記割込通知情報を取得した場合、前記割込検出手段に対して、前記停止を解除する。従って、前記通知手段から出力された割込通知情報を前記第1取得手段が取得するまでの間、前記割込検出手段によって、前記第2オペレーティングシステムから前記第1オペレーティングシステムへの切り替えの動作が妨害されることがない。また、第2オペレーティングシステムから第1オペレーティングシステムへ切り替わるまでの間に、前記割込検出手段が、同一の割り込みを重複して検出することを、防ぐことができる。   According to this configuration, when the interrupt is detected, the notification unit causes the interrupt detection unit to stop detecting the interrupt, and the first acquisition unit acquires the interrupt notification information. In the case, the stop is released to the interrupt detection means. Therefore, until the first acquisition unit acquires the interrupt notification information output from the notification unit, the interrupt detection unit performs the switching operation from the second operating system to the first operating system. It will not be disturbed. In addition, it is possible to prevent the interrupt detection unit from detecting the same interrupt repeatedly until switching from the second operating system to the first operating system.

本発明は、プログラムに従って動作する前記データ処理装置であって、複数の処理手順から構成されるプログラムを記憶している記憶手段と、前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する正当性判断手段と、不正なものであると判断される場合に、前記プログラムを無効化する無効化手段とを備えることを特徴とするデータ処理装置でもある。   The present invention is the data processing apparatus that operates according to a program, wherein the storage unit stores a program composed of a plurality of processing procedures, and the program stored in the storage unit is illegal. It is also a data processing apparatus comprising: a validity determining unit that determines whether or not the program is invalid; and an invalidating unit that invalidates the program when it is determined to be illegal.

この構成によると、前記正当性判断手段は、前記プログラムが不正なものであるか否かを判断し、前記無効化手段不正なものであると判断される場合に、前記プログラムを無効化するため、本発明のデータ処理装置において、不正なプログラムの実行を防止することができる。
前記データ処理装置において、前記正当性判断手段は、前記記憶手段に記憶されている前記プログラムを示すプログラム識別情報を取得するプログラム情報取得部と、無効化されたプログラムを示す無効化識別情報を取得する無効化情報取得部と、取得した前記プログラム識別情報と取得した前記無効化識別情報とが一致するか否かを判断する判断部とを含み、一致すると判断される場合に、前記プログラムが不正であると決定することを特徴とする。
According to this configuration, the validity determination unit determines whether or not the program is illegal, and invalidates the program when it is determined that the invalidation unit is illegal. In the data processing apparatus of the present invention, it is possible to prevent an unauthorized program from being executed.
In the data processing device, the validity judgment unit acquires a program information acquisition unit that acquires program identification information indicating the program stored in the storage unit, and invalidation identification information that indicates a disabled program An invalidation information acquisition unit for determining whether or not the acquired program identification information matches the acquired invalidation identification information. It is determined that it is.

上記の構成では、前記情報取得部取得した前記プログラム識別情報と前記無効化情報取得部取得した前記無効化識別情報とが一致するか否かによって、容易に当該プログラムが不正であるか否かを決定することができる。
本発明のデータ処理装置に含まれる前記プログラム情報取得部は、前記プログラムを示すプログラム識別情報を記憶している識別情報記憶部と、前記識別情報記憶部から前記プログラム識別情報を読み出すことにより取得する読出部とを含み、前記無効化情報取得部は、無効化されたプログラムを示す無効化識別情報を記憶している無効化情報記憶部と、前記無効化情報記憶部から前記無効化識別情報を読み出すことにより取得する読出部とを含むことを特徴とする。
In the above configuration, whether or not the program is illegal is easily determined based on whether or not the program identification information acquired by the information acquisition unit matches the invalidation identification information acquired by the invalidation information acquisition unit. Can be determined.
The program information acquisition unit included in the data processing device of the present invention acquires an identification information storage unit that stores program identification information indicating the program, and reads the program identification information from the identification information storage unit. And the invalidation information acquisition unit includes an invalidation information storage unit storing invalidation identification information indicating the invalidated program, and the invalidation identification information from the invalidation information storage unit. And a reading unit that is acquired by reading.

この構成によると、前記プログラム情報取得部は、予め前記プログラムを示すプログラム識別情報を記憶している前記識別情報記憶部から、迅速に、前記プログラム識別情報を取得することができる。また、前記無効化情報取得部は、予め、無効化されたプログラムを示す無効化識別情報を記憶している前記無効化情報記憶部から、迅速に前記無効化識別情報を取得することができる。   According to this configuration, the program information acquisition unit can quickly acquire the program identification information from the identification information storage unit that stores program identification information indicating the program in advance. Further, the invalidation information acquisition unit can quickly acquire the invalidation identification information from the invalidation information storage unit that stores invalidation identification information indicating the invalidated program in advance.

前記データ処理装置は、前記正当性判断手段が、前記プログラムに割り当てられた公開鍵の正当性を証明する公開鍵証明書に基づいて、前記プログラムが不正なものであるか否かを判断することを特徴とする。
この構成によると、前記正当性判断手段は、前記プログラムに割り当てられた公開鍵の正当性を証明する前記公開鍵証明書に基づいて、前記判断を行う。公的な第三者機関により発行された公開鍵証明書を用いることで、前記プログラムの正当性をより確実に判定することができる。
In the data processing device, the validity judgment unit judges whether or not the program is illegal based on a public key certificate that proves the validity of the public key assigned to the program. It is characterized by.
According to this configuration, the validity judgment unit performs the judgment based on the public key certificate that proves the validity of the public key assigned to the program. By using a public key certificate issued by a public third party, the validity of the program can be determined more reliably.

前記データ処理装置において、前記正当性判断手段は、前記公開鍵を識別する公開鍵識別情報を含む前記公開鍵証明書を記憶している証明書記憶部と、前記公開鍵証明書から前記公開鍵識別情報を取得する公開鍵情報取得部と、無効化された公開鍵を示す無効化識別情報を記憶している無効化情報記憶部と、前記無効化情報記憶部から無効化識別情報を読み出す無効化情報読出部と、取得した前記公開鍵識別情報と読み出した前記無効化識別情報とが一致するか否かを判断する判断部とを含み、一致すると判断される場合に、前記プログラムが不正であると決定することを特徴とする。   In the data processing device, the validity judgment unit includes a certificate storage unit storing the public key certificate including public key identification information for identifying the public key, and the public key certificate to the public key Public key information acquisition unit that acquires identification information, invalidation information storage unit that stores invalidation identification information indicating a revoked public key, and invalidation that reads invalidation identification information from the invalidation information storage unit And a determination unit that determines whether or not the acquired public key identification information and the read invalidation identification information match, and the program is invalid if it is determined to match. It is characterized by determining that there exists.

上記の構成によると、前記判断部は、前記証明書記憶部の記憶している前記公開鍵証明書に含まれる前記公開鍵識別情報と前記無効化情報記憶部の記憶している前記無効化識別情報とを比較することで、容易に、前記プログラムが不正であると決定することができる。
前記データ処理装置において、前記正当性判断手段は、さらに、外部から最新の無効化識別情報を取得し、取得した無効化識別情報を前記無効化情報記憶部に書き込む更新部を含むことを特徴とする。
According to the above configuration, the determination unit includes the public key identification information included in the public key certificate stored in the certificate storage unit and the invalidation identification stored in the invalidation information storage unit. By comparing with the information, it is possible to easily determine that the program is illegal.
In the data processing apparatus, the validity judgment unit further includes an update unit that obtains the latest invalidation identification information from the outside and writes the obtained invalidation identification information in the invalidation information storage unit. To do.

この構成によると、前記更新部が、外部から最新の無効化識別情報を取得し、取得した無効化識別情報を前記無効化情報記憶部に書き込む。一般に、公開鍵証明書の発行機関は、後発的に無効化された公開鍵を示す情報を追加して前記無効化識別情報を定期的に更新している。この発行機関から最新の無効化識別情報を取得して用いることで、前記データ処理装置の販売後に不正であることが判明したプログラムにも対応することができる。   According to this configuration, the update unit acquires the latest invalidation identification information from the outside, and writes the acquired invalidation identification information in the invalidation information storage unit. In general, a public key certificate issuing organization periodically updates the revocation identification information by adding information indicating a public key revoked later. By acquiring and using the latest invalidation identification information from this issuing organization, it is possible to deal with a program that has been found to be illegal after the data processing device is sold.

また、前記更新部は、前記記憶手段へのアクセス要求を検出する度に、最新の無効化識別情報を取得することを特徴とする。
上記の構成では、前記更新部は、前記記憶手段へのアクセス要求を検出する度に、最新の無効化識別情報を取得するため、前記判定部は常に最新の無効化識別情報を用いて前記プログラムの正当性を判断することができる。
Further, the update unit acquires the latest invalidation identification information each time an access request to the storage unit is detected.
In the above configuration, each time the update unit detects an access request to the storage unit, the update unit acquires the latest invalidation identification information. Therefore, the determination unit always uses the latest invalidation identification information. Can be judged.

前記データ処理装置において、前記更新部は、CRL(Certificate Revocation List)発行装置から、ネットワークを介して、前記無効化識別情報を受信し、CRL発行装置から、ネットワーク及びサーバ装置を介して、前記無効化識別情報を受信し、又は記録媒体から前記無効化識別情報を読み出すことにより、取得することを特徴とする。
上記の構成では、前記更新部は、CRL発行装置から、ネットワークを介して、前記無効化識別情報を受信するため、最新の無効化識別情報を取得することができる。
In the data processing device, the updating unit receives the invalidation identification information from a CRL (Certificate Revocation List) issuing device via a network, and receives the invalidation information from the CRL issuing device via the network and a server device. The information is acquired by receiving the invalidation identification information or reading the invalidation identification information from the recording medium.
In the above configuration, the update unit receives the invalidation identification information from the CRL issuing device via the network, and thus can obtain the latest invalidation identification information.

また、CRL発行装置から、ネットワーク及びサーバ装置を介して、前記無効化識別情報を受信するため、前記データ処理装置自身に外部のネットワークとの通信機能がない場合であっても、サーバ装置によって、前記無効化識別情報を更新することができる。
また、記録媒体から前記無効化識別情報を読み出すことにより、前記CRL発行装置と通信する環境がない場合でも、当該データ処理装置は、前記無効化識別情報を更新することもできる。
In addition, since the invalidation identification information is received from the CRL issuing device via the network and the server device, even if the data processing device itself does not have a communication function with an external network, The invalidation identification information can be updated.
In addition, by reading the invalidation identification information from the recording medium, the data processing apparatus can update the invalidation identification information even when there is no environment for communication with the CRL issuing apparatus.

前記更新部は、さらに、外部から、前記最新の無効化識別情報に対してデジタル署名を施して生成された署名データを取得し、取得した署名データに署名検証を施し、署名検証が成功した場合に、取得した前記無効化識別情報を前記無効化情報記憶部に書き込むことを特徴とする。
この構成では、前記更新部は、前記署名データを取得し、取得した署名データに署名検証を施し、署名検証が成功した場合に、取得した前記無効化識別情報を前記無効化情報記憶部に書き込むため、前記無効化識別情報の正当な発行者から発行された無効化識別情報を取得することができる。
The update unit further obtains signature data generated by applying a digital signature to the latest invalidation identification information from the outside, performs signature verification on the acquired signature data, and the signature verification is successful In addition, the acquired invalidation identification information is written in the invalidation information storage unit.
In this configuration, the update unit acquires the signature data, performs signature verification on the acquired signature data, and writes the acquired invalidation identification information in the invalidation information storage unit when the signature verification is successful. Therefore, invalidation identification information issued from a valid issuer of the invalidation identification information can be acquired.

前記データ処理装置を構成する前記正当性判断手段は、少なくとも当該公開鍵に対してデジタル署名を施して生成された署名データを含む前記公開鍵証明書を記憶している証明書記憶部と、前記証明書記憶部から前記公開鍵証明書を取得する公開鍵証明書取得部と、取得した前記公開鍵証明書に含まれる署名データに、署名検証を施すことにより、取得した前記公開鍵証明書が正しいものであるか否かを検証する検証部とを含み、前記公開鍵証明書が正しいものでないと判断される場合に、前記プログラムが不正であると決定することを特徴とする。   The validity judgment means constituting the data processing device includes a certificate storage unit storing at least the public key certificate including signature data generated by applying a digital signature to the public key; A public key certificate acquisition unit that acquires the public key certificate from a certificate storage unit, and signature verification is performed on signature data included in the acquired public key certificate so that the acquired public key certificate is A verification unit that verifies whether the program is correct, and determines that the program is invalid when it is determined that the public key certificate is not correct.

この構成では、前記正当性判断手段は、前記署名データに、署名検証を施すことにより、取得した前記公開鍵証明書が正しいものであるか否かを検証し、前記公開鍵証明書が正しいものでないと判断される場合に、前記プログラムが不正であると決定する。従って、前記データ処理装置は、前記プログラムに割り当てられた公開鍵証明書が不正な第三者により不正に生成ものであるか否かを判断することが可能であり、正当な公開鍵証明書を有するプログラムだけを実行することができる。   In this configuration, the validity judgment unit verifies whether or not the acquired public key certificate is correct by performing signature verification on the signature data, and the public key certificate is correct. If it is determined that the program is not, the program is determined to be illegal. Therefore, the data processing apparatus can determine whether or not the public key certificate assigned to the program is illegally generated by an unauthorized third party. Only the programs that you have can be executed.

また、前記データ処理装置において、前記正当性判断手段は、少なくとも2個の公開鍵の正当性をそれぞれ証明する少なくとも2個の公開鍵証明書を用いて、前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断してもよい。
この構成では、前記正当性判断手段は、少なくとも2個の公開鍵証明書を用いて、前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する。複数の公開鍵証明書を用いて前記判断を行うことで、より正確に、前記プログラムが不正であるか否かを判断できる。
Further, in the data processing device, the validity judgment means uses the program stored in the storage means by using at least two public key certificates that respectively prove the validity of at least two public keys. It may be determined whether or not is illegal.
In this configuration, the validity judgment unit judges whether or not the program stored in the storage unit is illegal using at least two public key certificates. By making the determination using a plurality of public key certificates, it is possible to more accurately determine whether the program is illegal.

前記2個の公開鍵は、前記プログラムに割り当てられた第1公開鍵及び前記データ処理装置又は前記プログラムの動作を制御するオペレーティングシステムに割り当てられた第2公開鍵であり、前記データ処理装置を構成する前記正当性判断手段は、権威のある認証機関の秘密鍵を用いて、少なくとも前記第2公開鍵に対してデジタル署名を施して生成された第2署名データと、前記第2公開鍵とを含む第2公開鍵証明書と、前記データ処理装置又は前記オペーティングシステムの秘密鍵を用いて、少なくとも前記第1公開鍵に対してデジタル署名を施して生成された第1署名データと、前記第1公開鍵とを含む第1公開鍵証明書とを記憶している証明書記憶部と、前記証明書記憶部から前記第1公開鍵証明書及び前記第2公開鍵証明書を取得する公開鍵証明書取得部と、取得した前記第2公開鍵証明書に含まれる第2署名データに、前記認証機関の公開鍵を用いて、署名検証を施すことにより、取得した前記第2公開鍵証明書が正しいものであるか否かを検証し、正しいと判定された場合に、前記第2公開鍵証明書から前記第2公開鍵を取得し、取得した前記第1公開鍵証明書に含まれる第1署名データに、取得した前記第2公開鍵を用いて、署名検証を施すことにより、取得した前記第1公開鍵証明書が正しいものであるか否かを検証する検証部とを含み、前記第2公開鍵証明書が正しいものでないと判断される場合及び前記第1公開鍵証明書が正しいものでないと判断される場合に、前記プログラムが不正であると決定することを特徴とする。   The two public keys are a first public key assigned to the program and a second public key assigned to the data processing apparatus or an operating system that controls the operation of the program, and constitutes the data processing apparatus The legitimacy judging means, which uses a secret key of an authoritative certificate authority, and at least second signature data generated by applying a digital signature to the second public key, and the second public key Including a second public key certificate, a first signature data generated by applying a digital signature to at least the first public key using a secret key of the data processing device or the operating system, A certificate storage unit storing a first public key certificate including a first public key; and the first public key certificate and the second public key certificate are extracted from the certificate storage unit. The public key certificate acquisition unit to perform the signature verification on the second signature data included in the acquired second public key certificate using the public key of the certification authority, thereby acquiring the second public data It is verified whether or not the key certificate is correct. When it is determined that the key certificate is correct, the second public key is acquired from the second public key certificate, and the acquired first public key certificate is included in the acquired first public key certificate. A verification unit that verifies whether or not the acquired first public key certificate is correct by performing signature verification on the included first signature data using the acquired second public key; And determining that the program is invalid when it is determined that the second public key certificate is not correct and when it is determined that the first public key certificate is not correct. To do.

この構成によると、前記正当性判断手段は、取得した前記第2公開鍵証明書に含まれる第2署名データに、前記認証機関の公開鍵を用いて、署名検証を施すことにより、取得した前記第2公開鍵証明書が正しいものであるか否かを検証し、正しいと判定された場合に、前記第2公開鍵証明書から前記第2公開鍵を取得し、取得した前記第1公開鍵証明書に含まれる第1署名データに、取得した前記第2公開鍵を用いて、署名検証を施すことにより、取得した前記第1公開鍵証明書が正しいものであるか否かを検証する。このように、階層構造を形成する複数の公開鍵証明書を用いて検証することで、上位の公開鍵証明書が無効な場合、つまり、前記プログラムを制御するオペレーティングシステムが不正である場合にも前記プログラムを無効化し、不正なオペレーティングシステムのもとで、前記プログラムが実行されることを防ぐ。   According to this configuration, the validity judgment unit obtains the obtained signature by performing signature verification on the second signature data included in the obtained second public key certificate using the public key of the certification authority. It is verified whether the second public key certificate is correct, and when it is determined to be correct, the second public key is acquired from the second public key certificate, and the acquired first public key The first signature data included in the certificate is subjected to signature verification using the acquired second public key, thereby verifying whether the acquired first public key certificate is correct. In this way, by verifying using a plurality of public key certificates that form a hierarchical structure, even when the higher-level public key certificate is invalid, that is, when the operating system that controls the program is illegal The program is invalidated to prevent the program from being executed under an unauthorized operating system.

又は、当該データ処理装置が不正である場合にも、前記プログラムの実行を防止することができる。
前記データ処理装置を構成する前記正当性判断手段は、前記記憶手段へのアクセス要求を検出する度に、前記判断をすることを特徴とする。
また、前記正当性判断手段は、前記記憶手段に記憶されているプログラムへのアクセス要求を検出する度に、前記判断してもよい。
Or even when the data processing device is illegal, the execution of the program can be prevented.
The validity judgment means constituting the data processing apparatus makes the judgment every time an access request to the storage means is detected.
Further, the validity judgment means may make the judgment each time an access request to the program stored in the storage means is detected.

また、前記正当性判断手段は、当該データ処理装置へ電力供給が開始された直後に、前記判断をするとしてもよい。
上記の構成によると、前記正当性判断手段は、前記記憶手段へのアクセス要求を検出する度に、前記判断をする。又は、前記記憶手段に記憶されているプログラムへのアクセス要求を検出する度に、前記判断をする。又は、当該データ処理装置へ電力供給が開始された直後に、前記判断をする。従って、前記プログラムを実行する前に、前記プログラムが不正であるか否かを判断することができる。
Further, the validity judgment unit may make the judgment immediately after power supply to the data processing apparatus is started.
According to the above configuration, the validity determination unit makes the determination every time an access request to the storage unit is detected. Alternatively, the determination is made each time an access request to the program stored in the storage unit is detected. Alternatively, the determination is made immediately after power supply to the data processing apparatus is started. Therefore, before executing the program, it can be determined whether or not the program is illegal.

また、本発明は、暗号化されたプログラムを復号して実行する前記データ処理装置であって、前記記憶手段は、前記プログラムに代えて、プログラム鍵を用いて、前記プログラムに暗号化アルゴリズムが施されて生成された暗号化プログラムを記憶しており、前記正当性判断手段は、p個の暗号鍵から選択されたm個の暗号鍵を記憶している暗号鍵記憶部と、前記m個の暗号鍵のそれぞれを用いて、前記プログラム鍵及び所定の検知情報のいずれかが暗号化されて生成されたm個の暗号化情報を、m個の前記暗号鍵に対応づけて記憶している暗号化情報記憶部と、前記m個の暗号鍵のそれぞれを用いて、対応する暗号化情報に復号アルゴリズムを施して、m個の復号情報を生成する復号部と、生成されたm個の復号情報の全てが、前記検知情報であるか否かを判断する判断部とを含み、生成されたm個の復号情報の全てが、前記検知情報であると判断される場合に、前記プログラムが不正なものであると決定することを特徴とする。   The present invention is also the data processing apparatus for decrypting and executing an encrypted program, wherein the storage means uses a program key instead of the program to apply an encryption algorithm to the program. The validity determination means includes an encryption key storage unit storing m encryption keys selected from p encryption keys, and the m number of encryption programs. A cipher that stores m pieces of encryption information generated by encrypting either the program key or the predetermined detection information using each of the encryption keys in association with the m pieces of encryption keys. A decryption unit that generates a decryption information by applying a decryption algorithm to the corresponding encryption information using each of the encrypted information storage unit, the m encryption keys, and the generated m decryption information Are all detected information A determination unit that determines whether or not the information is generated, and when all of the generated m pieces of decoding information are determined to be the detection information, the program is determined to be invalid. It is characterized by.

さらに、前記p個の暗号鍵は、n行m列(p=n×m)の第1行列の各要素位置に配されており、前記第1行列の各列から1個の暗号鍵が選択されることにより、前記第1行列からm個の暗号鍵が選択され、前記データ処理装置を構成する前記暗号鍵記憶部は、前記第1行列において、各暗号鍵が配された要素位置を、各暗号鍵に対応付けて記憶しており、前記暗号化情報記憶部は、n行m列の第2行列において、各暗号化情報に対応する暗号鍵が配されている要素位置と同じ要素位置において、当該暗号化情報を記憶しており、復号部は、前記暗号鍵記憶部から、暗号鍵と対応する要素位置を読み出し、前記暗号化情報記憶部の第2行列において、前記読み出した要素位置と同じ要素位置に配されている暗号化情報を読み出し、読み出した前記暗号鍵を用いて、読み出した前記暗号化情報に復号アルゴリズムを施すことを特徴とする。   Furthermore, the p encryption keys are arranged at each element position of the first matrix of n rows and m columns (p = n × m), and one encryption key is selected from each column of the first matrix. By doing so, m encryption keys are selected from the first matrix, and the encryption key storage unit constituting the data processing device, in the first matrix, the element position where each encryption key is arranged, Each encryption key is stored in association with each other, and the encryption information storage unit has the same element position as the element position where the encryption key corresponding to each encryption information is arranged in the second matrix of n rows and m columns. The decryption unit reads out the element position corresponding to the encryption key from the encryption key storage unit, and the read element position in the second matrix of the encryption information storage unit Read the encryption information arranged at the same element position as Using serial encryption key, and characterized by applying a decryption algorithm to the encrypted information read.

上記の構成によると、前記正当性判断手段は、前記m個の暗号鍵のそれぞれを用いて、対応する暗号化情報に復号アルゴリズムを施して、m個の復号情報をし、生成されたm個の復号情報の全てが、前記検知情報であると判断される場合に、前記プログラムが不正なものであると決定する。前記プログラムが正当である場合、当該データ処理装置は、暗号化された前記暗号鍵から暗号鍵を生成し、生成した暗号鍵により、前記暗号化プログラムを復号してプログラムを生成し、生成したプログラムを実行する。このように、2重の暗号化を施すことにより、前記プログラムを不正な利用から保護することができる。   According to the above configuration, the legitimacy determining unit performs decryption algorithm on the corresponding encryption information using each of the m encryption keys, generates m decryption information, and generates m pieces of decryption information. When it is determined that all of the decryption information is the detection information, the program is determined to be illegal. When the program is valid, the data processing apparatus generates an encryption key from the encrypted encryption key, decrypts the encrypted program with the generated encryption key, generates a program, and generates the program Execute. In this way, by applying double encryption, the program can be protected from unauthorized use.

また、前記第1行列の各列から1個の暗号鍵が選択されることにより、前記p個の暗号鍵が、選択されている。ここで、同一のプログラム鍵により暗号化された複数の暗号化プログラムが存在する場合を想定する。いずれかのプログラムが不正であり、この不正なプログラムに割り当てられたm個暗号鍵を用いて生成されるm個の復号情報は全て前記検知情報である。他の正当なプログラムに割り当てられたm個の暗号鍵のうち、いずれかが、前記不正なプログラムのm個の暗号鍵と一致していても、その他の暗号鍵により、前記プログラム鍵を生成することができる。プログラムごとに異なる組み合わせで、m個の暗号鍵を割り当てることで、不正なプログラムのみを無効化し、正当なプログラムは、利用することができる。   In addition, the p encryption keys are selected by selecting one encryption key from each column of the first matrix. Here, it is assumed that there are a plurality of encrypted programs encrypted with the same program key. Any one of the programs is illegal, and all the m pieces of decryption information generated using the m encryption keys assigned to the illegal program are the detection information. Even if any one of the m cryptographic keys assigned to another legitimate program matches the m cryptographic keys of the unauthorized program, the program key is generated using the other cryptographic key. be able to. By assigning m encryption keys in different combinations for each program, only an illegal program can be invalidated and a legitimate program can be used.

また、本発明は、前記データ処理装置であって、データを記憶するためのメモリ手段と、複数の処理手順から構成されるプログラムに従って動作するプロセッサと、前記メモリ手段と前記プロセッサとの間に配置され、前記プロセッサから出力される前記メモリ手段宛の転送データが転送制限条件を満たしているか否かを判断し、転送制限条件を満たしていると判断する場合に、前記メモリ手段への転送データの転送を抑制し、転送制限条件を満たしていないと判断する場合に、前記メモリ手段への転送データの転送を行う監視手段とを備えることを特徴とする。   Further, the present invention provides the data processing apparatus, comprising a memory means for storing data, a processor that operates according to a program composed of a plurality of processing procedures, and is arranged between the memory means and the processor. And determining whether or not the transfer data addressed to the memory means output from the processor satisfies a transfer restriction condition, and if it is determined that the transfer restriction condition is satisfied, the transfer data to the memory means And a monitoring unit that transfers the transfer data to the memory unit when it is determined that the transfer is suppressed and the transfer restriction condition is not satisfied.

この構成によると、前記監視手段は、前記メモリ手段と前記プロセッサとの間に配置され、前記プロセッサから出力される前記メモリ手段宛の転送データが転送制限条件を満たしているか否かを判断し、転送制限条件を満たしていると判断する場合に、前記メモリ手段への転送データの転送を抑制する。このようにすることで、前記プログラムの動作中に発生する前記メモリへの不正なアクセスを防止することができる。   According to this configuration, the monitoring unit is arranged between the memory unit and the processor, and determines whether or not the transfer data addressed to the memory unit output from the processor satisfies a transfer restriction condition, When it is determined that the transfer restriction condition is satisfied, transfer of transfer data to the memory means is suppressed. In this way, unauthorized access to the memory that occurs during the operation of the program can be prevented.

前記データ処理装置において、前記監視手段は、複数のアプリケーションプログラム毎に、転送制限条件を記憶しており、前記プロセッサにより実行されるアプリケーションプログラム毎に、転送制限条件を選択し、選択した転送制限条件を用いることを特徴とする。
この構成では、前記監視手段は、前記プロセッサにより実行されるアプリケーションプログラム毎に、転送制限条件を選択し、選択した転送制限条件を用いる。前記データ処理装置において、複数のアプリケーションプログラムが実行される場合、アプリケーションごとに利用するデータやデバイスが異なることは十分考えられる。従って、アプリケーションプログラムごとに異なる転送制限条件を用いることで、当該データ処理装置は、複数のアプリケーションプログラムを安全に実行することができる。
In the data processing apparatus, the monitoring unit stores transfer restriction conditions for each of a plurality of application programs, selects a transfer restriction condition for each application program executed by the processor, and selects the selected transfer restriction condition. It is characterized by using.
In this configuration, the monitoring unit selects a transfer restriction condition for each application program executed by the processor, and uses the selected transfer restriction condition. In the data processing apparatus, when a plurality of application programs are executed, it is sufficiently conceivable that data and devices used for each application are different. Therefore, by using different transfer restriction conditions for each application program, the data processing apparatus can safely execute a plurality of application programs.

また、前記転送制限条件は、前記メモリ手段内の所定の記憶空間を示すアドレス範囲情報であり、前記データ処理装置は、前記監視手段が、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、前記転送データの転送を抑制することを特徴とする。
上記に構成によると、前記監視手段は、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、前記転送データの転送を抑制する。従って、前記プロセッサが前記所定の記憶空間にアクセスすることを阻止することができる。
Further, the transfer restriction condition is address range information indicating a predetermined storage space in the memory means, and the data processing device extracts the address information extracted from the transfer data by the monitoring means. Is included in the address range information, the transfer of the transfer data is suppressed.
According to the above configuration, the monitoring unit suppresses transfer of the transfer data when the extracted address information is included in the address range information. Therefore, the processor can be prevented from accessing the predetermined storage space.

前記転送制限条件は、前記メモリ手段内の所定の記憶空間へのアクセス回数の上限を示す制限回数であり、前記データ処理装置を構成する前記監視手段は、過去における前記記憶空間へのアクセスの累積回数を記憶しており、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、前記累積回数に1を加算し、加算して得られた加算後回数が、前記制限回数を超える場合に、前記転送データの転送を抑制することを特徴とする。   The transfer restriction condition is a restriction number indicating an upper limit of the number of accesses to a predetermined storage space in the memory means, and the monitoring means constituting the data processing device is configured to accumulate the access to the storage space in the past. The number of times is stored, the address information is extracted from the transfer data, and when the extracted address information is included in the address range information, 1 is added to the cumulative number, and after the addition obtained by addition When the number of times exceeds the limit number, transfer of the transfer data is suppressed.

この構成によると、前記監視手段は、加算後回数が、前記制限回数を超える場合に、前記転送データの転送を抑制する。このようにすることで、前記プログラムの実行中に、何らかの原因で偶発的に起こった不正アクセスについては、見逃し、例えば、前記プログラムの不正な改ざんによって、定常的に前記所定の記憶空間へ不正なアクセスが起こる場合のみ前記プログラムの実行に伴う転送データの転送を抑制する。   According to this configuration, the monitoring unit suppresses transfer of the transfer data when the number of times after the addition exceeds the limit number. In this way, an unauthorized access that occurs accidentally for some reason during the execution of the program is overlooked. For example, unauthorized access to the predetermined storage space by unauthorized alteration of the program is illegal. Only when access occurs, transfer of transfer data accompanying execution of the program is suppressed.

本発明において、前記監視手段は、前記プロセッサに接続されるバス上において転送される前記転送データが転送制限条件を満たしているか否かを判断することを特徴とする。
この構成によると、前記監視手段は、前記プロセッサに接続されるバス上において転送される前記転送データが転送制限条件を満たしているか否かを判断するため、前記プロセッサから伝送データが出力される度に、確実に、前記判定を行うことができる。
In the present invention, the monitoring means determines whether or not the transfer data transferred on a bus connected to the processor satisfies a transfer restriction condition.
According to this configuration, the monitoring means determines whether or not the transfer data transferred on the bus connected to the processor satisfies a transfer restriction condition, so that each time transmission data is output from the processor. In addition, the determination can be performed reliably.

本発明のデータ処理装置を構成する前記メモリ手段は、暗号鍵を用いて、前記プロセッサにより実行されている現プログラムとは異なるアプリケーションプログラムのコード部分とデータ部分とがそれぞれ暗号化されて生成された暗号化コード及び暗号化データを記憶しており、前記転送制限条件は、前記メモリ手段内において前記暗号化データが格納されている記憶空間を示すアドレス範囲情報であり、前記監視手段は、前記暗号化コード及び暗号化データを復号するための復号鍵を記憶しており、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記暗号化コードが格納されている記憶空間を示すアドレス範囲内にある場合に、前記復号鍵を用いて、前記転送データにより示される記憶空間に存在する暗号化コードを復号して復号コードを生成し、生成した復号コードを前記プロセッサへ転送し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、転送データの転送を抑制することを特徴とする。   The memory means constituting the data processing apparatus of the present invention is generated by encrypting a code part and a data part of an application program different from the current program being executed by the processor, using an encryption key. An encryption code and encrypted data are stored, and the transfer restriction condition is address range information indicating a storage space in which the encrypted data is stored in the memory means, and the monitoring means A decryption key for decrypting the encrypted code and the encrypted data, extracting address information from the transfer data, and the extracted address information indicating an address range indicating a storage space in which the encrypted code is stored An encryption code that exists in the storage space indicated by the transfer data using the decryption key. Decoded to generate a decoded code, the generated decrypted code is transferred to the processor, extracted address information, if included in the address range information, which comprises suppressing the transmission of the transfer data.

この構成によると、前記監視手段は、前記暗号化コード及び暗号化データを復号するための復号鍵を記憶しており、前記アドレス情報が、前記暗号化コードが格納されている記憶空間を示すアドレス範囲内にある場合に、前記復号鍵を用いて、前記転送データにより示される記憶空間に存在する暗号化コードを復号して復号コードを生成し、生成した復号コードを前記プロセッサへ転送し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、転送データの転送を抑制する。これにより、前記アプリケーションプログラムのデータ部分の使用を当該アプリケーションプログラムのみに限定することができる。   According to this configuration, the monitoring unit stores a decryption key for decrypting the encrypted code and encrypted data, and the address information indicates an address indicating a storage space in which the encrypted code is stored. If it is within the range, the decryption key is used to decrypt the encrypted code present in the storage space indicated by the transfer data to generate a decrypted code, and the generated decrypted code is transferred to the processor for extraction. When the address information is included in the address range information, transfer of transfer data is suppressed. Thereby, the use of the data part of the application program can be limited to the application program.

前記監視手段は、さらに、転送制限条件を満たしていると判断する場合に、前記プロセッサにより実行中の前記プログラムを識別する識別情報をプログラム無効化リストに追加することを特徴とする。
この構成では、前記監視手段は、転送制限条件を満たしていると判断する場合に、前記プロセッサにより実行中の前記プログラムを識別する識別情報をプログラム無効化リストに追加ため、前記プロセッサにより、このプログラムが再度実行されることを防ぐことができる。
The monitoring means further adds identification information for identifying the program being executed by the processor to the program invalidation list when determining that the transfer restriction condition is satisfied.
In this configuration, when the monitoring unit determines that the transfer restriction condition is satisfied, the processor adds the identification information for identifying the program being executed by the processor to the program invalidation list. Can be prevented from being executed again.

本発明の前記データ処理装置は、データを記憶するためのメモリ手段と、複数の処理手順から構成されるプログラムに従って動作し、次に実行対象となる命令のアドレスが格納されているプログラムカウンタを備えるプロセッサと、前記プログラムカウンタに格納されているアドレスが、所定のアドレス範囲内に含まれるか否かを判断し、所定のアドレス範囲内に含まれると判断する場合に、前記プロセッサに対して、プログラムカウンタに所定の値を格納するように指示する監視手段とを備え、前記プロセッサが、前記指示を受け取ると、プログラムカウンタに前記所定の値を格納することを特徴とする。   The data processing apparatus according to the present invention includes a memory means for storing data, and a program counter that operates according to a program composed of a plurality of processing procedures and stores the address of an instruction to be executed next. It is determined whether or not an address stored in the processor and the program counter is included in a predetermined address range, and when it is determined that the address is included in a predetermined address range, a program is sent to the processor. Monitoring means for instructing the counter to store a predetermined value, and the processor stores the predetermined value in the program counter when receiving the instruction.

この構成によると、前記監視手段は、前記プログラムカウンタに格納されているアドレスが、所定のアドレス範囲内に含まれるか否かを判断し、所定のアドレス範囲内に含まれると判断する場合に、前記プロセッサに対して、プログラムカウンタに所定の値を格納するように指示する。このようにすることで、前記プロセッサが前記所定のアドレス範囲と対応する記憶領域にアクセスすることを事前に防止し、例えば、オペレーティングシステムなどの他のプログラムへ前記プロセッサの実行権を移すことで、前記プログラムの実行を中断させることができる。   According to this configuration, the monitoring unit determines whether the address stored in the program counter is included in a predetermined address range, and determines that the address is included in a predetermined address range. Instructs the processor to store a predetermined value in the program counter. In this way, the processor prevents the access to the storage area corresponding to the predetermined address range in advance, for example, by transferring the execution right of the processor to another program such as an operating system, The execution of the program can be interrupted.

以下、本発明の実施の形態について図面を用いて詳細に説明する。
1. 実施の形態1
本発明の実施の形態について、以下に説明する。
図1は、本発明の携帯電話100の使用例を示している。携帯電話100は、メモリカード300を装着される。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
1. Embodiment 1
Embodiments of the present invention will be described below.
FIG. 1 shows an example of use of the mobile phone 100 of the present invention. The mobile phone 100 is loaded with a memory card 300.

メモリカード300は、暗号化された音楽データが記録されており、携帯電話100は、メモリカード300から音楽データを読み出して再生する。
また、携帯電話100は、基地局15、携帯電話網10、インターネット20を介してコンテンツ配信装置と接続されている。携帯電話100は、コンテンツ配信装置の記憶している音楽、映像などから構成される各種のコンテンツをインターネット、携帯電話網を介して取得する。
The memory card 300 stores encrypted music data, and the mobile phone 100 reads the music data from the memory card 300 and plays it back.
The mobile phone 100 is connected to a content distribution apparatus via the base station 15, the mobile phone network 10, and the Internet 20. The mobile phone 100 acquires various contents composed of music, video, and the like stored in the content distribution apparatus via the Internet and a mobile phone network.

1.1 メモリカード300
メモリカード300は、図2に示すように、入出力部301、セキュア処理部302、一般領域303及びセキュア領域306から構成される。
一般領域303は、外部機器により自由にアクセスすることができる記憶領域であり、暗号化音楽データ304を記憶している。セキュア領域306は、許可された外部機器のみがアクセスできる記憶領域であり、コンテンツ鍵307が記憶されている。
1.1 Memory card 300
As illustrated in FIG. 2, the memory card 300 includes an input / output unit 301, a secure processing unit 302, a general area 303, and a secure area 306.
The general area 303 is a storage area that can be freely accessed by an external device, and stores encrypted music data 304. The secure area 306 is a storage area that can be accessed only by authorized external devices, and stores a content key 307.

暗号化音楽データ304・・・は、1曲分の音楽データに、コンテンツ鍵307を用いて、暗号化アルゴリズムE1を施して生成されたものである。各暗号化音楽データは、楽曲IDにより識別される。
暗号化アルゴリズムE1は、一例としてDES(Data Encryption Standard)などを用いる。
The encrypted music data 304... Is generated by applying the encryption algorithm E1 to the music data for one song using the content key 307. Each encrypted music data is identified by a music ID.
As an example, the encryption algorithm E1 uses DES (Data Encryption Standard).

入出力部301は、外部機器と一般領域303及びセキュア処理部302との間で各種のデータを入出力する。
セキュア処理部302は、外部機器との間で、CPRM(Content Protection for Recordable Media)の仕組みに基づいて相互認証を行い、認証に成功した場合に、認証した機器と鍵を共有する。共有した鍵を用いて、外部機器との間で、安全にデータの入出力を行う。
The input / output unit 301 inputs / outputs various data between the external device and the general area 303 and the secure processing unit 302.
The secure processing unit 302 performs mutual authentication with an external device based on a CPRM (Content Protection for Recordable Media) mechanism, and shares the key with the authenticated device when the authentication is successful. Use the shared key to safely input and output data with external devices.

なお、CPRMについては、公知であるので説明を省略する。また、他の認証方法により認証を行ってもよい。
1.2 携帯電話100の構成
携帯電話100は、図2に示すように、デバッガIF101、CPU102、MMU103、二次記憶部104、切替制御部106、割込コントローラ107、入力部108、表示部109、通常メモリ111、共有メモリ112、セキュアメモリ113、メモリ保護部114、入出力部116、暗号処理デバイス117、無線通信制御部118、マイク119、スピーカ120、通信部121、アンテナ122、バッファ123、符号処理部124及びD/A変換部126から構成され、各回路はバス130に接続されている。
Since CPRM is publicly known, description thereof is omitted. Moreover, you may authenticate with another authentication method.
1.2 Configuration of Mobile Phone 100 As shown in FIG. 2, the mobile phone 100 includes a debugger IF 101, a CPU 102, an MMU 103, a secondary storage unit 104, a switching control unit 106, an interrupt controller 107, an input unit 108, and a display unit 109. , Normal memory 111, shared memory 112, secure memory 113, memory protection unit 114, input / output unit 116, cryptographic processing device 117, wireless communication control unit 118, microphone 119, speaker 120, communication unit 121, antenna 122, buffer 123, The circuit includes a code processing unit 124 and a D / A conversion unit 126, and each circuit is connected to the bus 130.

携帯電話100は、具体的にはコンピュータシステムであり、通常メモリ111、共有メモリ112、セキュアメモリ113、二次記憶部104には各種のコンピュータプログラム記憶されており、CPU102がこれらのコンピュータプログラムに従って動作することにより、携帯電話100はその機能の一部を実現する。
(1)二次記憶部104、共有メモリ112
二次記憶部104は、ROMから構成され、一例として、図3に示すように、暗号化音楽復号プログラム141及び音楽復号デーモン142などを記憶している。
The cellular phone 100 is specifically a computer system. Various computer programs are stored in the normal memory 111, the shared memory 112, the secure memory 113, and the secondary storage unit 104, and the CPU 102 operates according to these computer programs. As a result, the mobile phone 100 realizes a part of its functions.
(1) Secondary storage unit 104 and shared memory 112
The secondary storage unit 104 includes a ROM, and stores an encrypted music decryption program 141, a music decryption daemon 142, and the like as shown in FIG. 3 as an example.

暗号化音楽復号プログラム141は、セキュアメモリ113上にロードされて実行される音楽復号プログラムを暗号化して生成されたものである。音楽復号プログラムは、メモリカード300に記憶されている暗号化音楽データ304を復号するプログラムである。これについては、後に、詳細に説明する。
音楽復号デーモン142は、通常メモリ111上にロードされて実行されるプログラムであり、音楽復号プログラムと1対1に対応する。
The encrypted music decryption program 141 is generated by encrypting a music decryption program that is loaded onto the secure memory 113 and executed. The music decryption program is a program for decrypting the encrypted music data 304 stored in the memory card 300. This will be described in detail later.
The music decryption daemon 142 is a program that is loaded on the normal memory 111 and executed, and has a one-to-one correspondence with the music decryption program.

音楽復号の処理のうちで、高いセキュリティを要する処理及び保護されるべきデータを扱う処理を音楽復号プログラムが実行し、高いセキュリティを必要としない処理を音楽復号デーモンが実行する。詳細については、後に述べる。
共有メモリ112は、RAMから構成され、通常メモリ111上のプログラム及びセキュア記憶上のプログラムいずれのプログラムからも使用可能なメモリである。
Of the music decryption processes, the music decryption program executes a process that requires high security and a process that handles data to be protected, and the music decryption daemon executes a process that does not require high security. Details will be described later.
The shared memory 112 is composed of a RAM, and is a memory that can be used by both the program on the normal memory 111 and the program on the secure storage.

なお、ここでは、二次記憶部104はROMから構成されるとしているが、ハードディスクユニットから構成されるとしても良い。
(2)通常メモリ111及びセキュアメモリ113
通常メモリ111は、RAM及びROMから構成され、CPU102により実行される各種のプログラムを記憶している。一例として、図4に示すように、通常OS151、ライブラリ152、音楽再生プログラム153、音楽復号デーモン156、通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158、暗号エントリデバイスドライバ159、通常切替デバイスドライバ160及び通常割込ハンドラ161を記憶している。
Here, the secondary storage unit 104 is configured by a ROM, but may be configured by a hard disk unit.
(2) Normal memory 111 and secure memory 113
The normal memory 111 includes a RAM and a ROM, and stores various programs executed by the CPU 102. As an example, as shown in FIG. 4, a normal OS 151, a library 152, a music playback program 153, a music decryption daemon 156, a normal input / output device driver 157, a secure input / output entry device driver 158, a cryptographic entry device driver 159, a normal switching device The driver 160 and the normal interrupt handler 161 are stored.

セキュアメモリ113は、RAMから構成され、CPU102によって、実行される各種のプログラムを記憶している。セキュアメモリ113は、メモリ保護部114を介してバス130と接続されている。
セキュアメモリ113は、一例として、図6に示すように、セキュアOS171、音楽復号プログラム176、セキュア入出力デバイスドライバ178、暗号デバイスドライバ179、セキュア切替デバイスドライバ180、セキュア割込ハンドラ181を記憶している。
The secure memory 113 is composed of a RAM, and stores various programs executed by the CPU 102. The secure memory 113 is connected to the bus 130 via the memory protection unit 114.
As an example, the secure memory 113 stores a secure OS 171, a music decryption program 176, a secure input / output device driver 178, an encryption device driver 179, a secure switching device driver 180, and a secure interrupt handler 181 as shown in FIG. Yes.

図8は、通常メモリ111及びセキュアメモリ113に記憶されている各プログラム間の関係を機能的に示したブロック図である。実際には、同一メモリ上の各プログラム間の通信は、通常OS151及びセキュアOS171へシステムコールを出力することにより実現される。また、通常切替デバイスドライバ160、セキュア切替デバイスドライバ180及び切替制御部106が動作することにより、通常OS151とセキュアOS171とを切り替えているが、図8においては、オペレーティングシステムによる仲介及び通常OS151とセキュアOS171との切り替えに係るプログラムを省略している。   FIG. 8 is a block diagram functionally showing the relationship between the programs stored in the normal memory 111 and the secure memory 113. Actually, communication between programs on the same memory is realized by outputting a system call to the normal OS 151 and the secure OS 171. Further, the normal switching device driver 160, the secure switching device driver 180, and the switching control unit 106 operate to switch between the normal OS 151 and the secure OS 171, but in FIG. 8, the mediation by the operating system and the normal OS 151 and the secure OS 171 are secured. A program for switching to the OS 171 is omitted.

また、図8において、共有メモリ112は、通常入出力デバイス132及び暗号処理デバイス117と接続されているが、これは、共有メモリ112の果たす役割の一部を示しており、共有メモリ112は、その他のプログラムによっても使用される。
<通常OS151>
通常OS151は、通常メモリ111上にロードされて実行される各種のプログラムを制御する基本ソフトウェアであり、制御プログラムと制御データから構成される。
In FIG. 8, the shared memory 112 is connected to the normal input / output device 132 and the cryptographic processing device 117, which shows a part of the role played by the shared memory 112. Also used by other programs.
<Normal OS 151>
The normal OS 151 is basic software that controls various programs that are loaded on the normal memory 111 and executed, and includes a control program and control data.

制御データには、図4に示すように、アプリ管理表166が含まれる。アプリ管理表166は、図5に示すように複数のエントリ167、168・・・を含む。各エントリは、ハンドル値、デーモンアドレス、アプリコンテキストアドレスから構成される。
ハンドル値は、セキュアメモリ113上にロードされるセキュアアプリケーションに割り当てられる識別子である。
The control data includes an application management table 166 as shown in FIG. The application management table 166 includes a plurality of entries 167, 168... As shown in FIG. Each entry includes a handle value, a daemon address, and an application context address.
The handle value is an identifier assigned to a secure application loaded on the secure memory 113.

以下の説明において、セキュアメモリ113上にロードされて、セキュアな処理を実行するアプリケーションをセキュアアプリケーションと呼ぶ。ここで、セキュアな処理とは、保護されるべきデータを扱う処理及びアルゴリズム自体を保護する必要のある処理である。
デーモンアドレスは、セキュアアプリケーションと対応して動作するプログラムの通常メモリ111上のロードアドレスである。
In the following description, an application loaded on the secure memory 113 and executing secure processing is referred to as a secure application. Here, the secure processing is processing that handles data to be protected and processing that needs to protect the algorithm itself.
The daemon address is a load address on the normal memory 111 of a program that operates corresponding to the secure application.

アプリコンテキストアドレスは、ハンドル値と対応するセキュアアプリケーションにセキュアな処理を依頼するアプリケーションのコンテキストを保存している通常メモリ111上のアドレスである。コンテキストには、CPU102のレジスタ値、スタックポインタ、MMU103の内容などが含まれる。
具体的にエントリ167について説明すると、ハンドル値「1」は、音楽再生プログラム153がセキュアな処理を依頼する音楽復号プログラム176(後述する)に割り当てられる識別子である。デーモンアドレス「0000BBBB」は、音楽復号プログラム176と対応して動作する音楽復号デーモン156の通常メモリ111上のロードアドレスである。アプリコンテキストアドレス「0000AAEE」は、音楽再生プログラム153のコンテキストを保存している通常メモリ111上のアドレスである。
The application context address is an address on the normal memory 111 that stores the context of the application that requests secure processing to the secure application corresponding to the handle value. The context includes a register value of the CPU 102, a stack pointer, the contents of the MMU 103, and the like.
Specifically, the entry 167 is described. The handle value “1” is an identifier assigned to a music decryption program 176 (described later) requested by the music playback program 153 to perform secure processing. The daemon address “0000BBBB” is a load address on the normal memory 111 of the music decryption daemon 156 that operates corresponding to the music decryption program 176. The application context address “0000AAEE” is an address on the normal memory 111 that stores the context of the music playback program 153.

また、制御データには、通常入出力デバイスドライバ157を示す識別情報デバイスあるデバイスID_A、セキュア入出力エントリデバイスドライバ158を識別する識別情報であるデバイスID_B及び暗号エントリデバイスドライバ159を示す識別情報であるデバイスID_Cとが含まれる。これらは、それぞれ、通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158及び暗号エントリデバイスドライバ159の通常メモリ111上のロードアドレスと対応付けて記憶されている。デバイスID_Bは、セキュア入出力デバイスドライバ178(後述する)を示す識別情報と同一であり、デバイスID_Cは、暗号デバイスドライバ179を示す識別情報と同一である。  The control data includes device ID_A, which is an identification information device indicating the normal input / output device driver 157, device ID_B, which is identification information identifying the secure input / output entry device driver 158, and identification information indicating the encryption entry device driver 159. Device ID_C is included. These are stored in association with the load addresses on the normal memory 111 of the normal input / output device driver 157, the secure input / output entry device driver 158, and the encryption entry device driver 159, respectively. The device ID_B is the same as the identification information indicating the secure input / output device driver 178 (described later), and the device ID_C is the same as the identification information indicating the encryption device driver 179.

通常OS151は、共有メモリ112内の所定の領域(コマンド領域と呼ぶ)を介して、セキュアOS171との間で各種のコマンドの送受信を行う。また、通常メモリ111上のプログラムとの間でも各種のコマンドの送受信を行う。通常メモリ111上のプログラムとの間のプログラムの送受信には、共有メモリ112を用いても良いし、通常メモリ111を用いても良い。   The normal OS 151 transmits and receives various commands to and from the secure OS 171 via a predetermined area (referred to as a command area) in the shared memory 112. Various commands are also transmitted to and received from the program on the normal memory 111. The shared memory 112 may be used for the transmission / reception of the program with the program on the normal memory 111, or the normal memory 111 may be used.

図9(a)は、通常OS151が扱うコマンドのデータ構造の一例を示している。コマンド1000は、コマンド部1011とデータ格納部1012から構成される。
コマンド部1011に格納されるコマンドには、セキュアアプリ登録要求、登録完了通知、アプリ復帰要求、セキュアアプリ削除命令、削除完了通知、システムコール、応答通知、セキュア処理要求、外部処理要求、休眠要求、割込発生通知などがある。
FIG. 9A shows an example of the data structure of a command handled by the normal OS 151. The command 1000 includes a command part 1011 and a data storage part 1012.
Commands stored in the command unit 1011 include a secure application registration request, a registration completion notification, an application return request, a secure application deletion command, a deletion completion notification, a system call, a response notification, a secure processing request, an external processing request, a sleep request, There is an interrupt notification.

データ格納部1012には、各種データ及びコマンド1016、データ及びコマンド1016の受け取り先となるプログラムを示す識別情報1013などが、コマンド部1011に格納されるコマンドに応じて格納される。
セキュアアプリ登録要求は、通常メモリ111上で動作するアプリケーションが、セキュアな処理を依頼するセキュアアプリケーションをセキュアメモリ113上にロードし使用可能な状態にすることを要求するコマンドである。このとき、図9(b)の示すようにデータ格納部1012には、セキュアアプリケーションを示すセキュアアプリ情報とセキュアアプリケーションと対応して動作するプログラムを示すデーモン情報とが格納される。音楽再生プログラム153から出力されるセキュアアプリ登録要求を例にすると、セキュアアプリ情報は、二次記憶部104上の暗号化音楽復号プログラム141の記憶されているアドレスであり、デーモン情報は、音楽復号デーモン142の記憶されているアドレスである。なお、セキュアアプリ情報及びデーモン情報は、暗号化音楽復号プログラム141及び音楽復号デーモン142と対応する識別子などでも良い。
In the data storage unit 1012, various data and commands 1016, identification information 1013 indicating programs to receive the data and commands 1016, and the like are stored according to the commands stored in the command unit 1011.
The secure application registration request is a command for requesting that an application operating on the normal memory 111 loads the secure application for which secure processing is requested onto the secure memory 113 and makes it usable. At this time, as shown in FIG. 9B, the data storage unit 1012 stores secure application information indicating a secure application and daemon information indicating a program operating in correspondence with the secure application. Taking the secure application registration request output from the music playback program 153 as an example, the secure application information is the address stored in the encrypted music decryption program 141 on the secondary storage unit 104, and the daemon information is the music decryption This is a stored address of the daemon 142. The secure application information and the daemon information may be identifiers corresponding to the encrypted music decryption program 141 and the music decryption daemon 142.

登録完了通知は、セキュアメモリ113上に、セキュアアプリケーションがロードされ、セキュアアプリ管理表(後述する)への登録が完了したことを通知する。このとき、データ格納部1012には、登録されたセキュアアプリケーションと対応するハンドル値が格納されている。
アプリ復帰要求は、依頼されていた処理を終えたセキュアアプリケーションが、依頼元であるアプリケーションの復帰を要求するコマンドである。このとき、データ格納部には、セキュアアプリケーションを示す識別情報が格納されている。
The registration completion notification notifies that a secure application is loaded on the secure memory 113 and registration in a secure application management table (described later) is completed. At this time, the data storage unit 1012 stores a handle value corresponding to the registered secure application.
The application return request is a command for requesting the return of the requesting application by the secure application that has completed the requested processing. At this time, identification information indicating a secure application is stored in the data storage unit.

セキュアアプリ削除命令は、セキュアメモリ113上のセキュアアプリケーションの削除を指示するものである。このとき、データ格納部1012には、削除するセキュアアプリケーションを一意に識別するハンドル値が格納されている。
削除完了通知は、セキュアメモリ113上のセキュアアプリケーションが削除されたことを通知するものである。このとき、データ格納部1012には、削除されたセキュアアプリケーションを一意に識別するハンドル値が格納されている。
The secure application deletion instruction is for instructing deletion of the secure application on the secure memory 113. At this time, the data storage unit 1012 stores a handle value that uniquely identifies the secure application to be deleted.
The deletion completion notification notifies that the secure application on the secure memory 113 has been deleted. At this time, the data storage unit 1012 stores a handle value that uniquely identifies the deleted secure application.

システムコールは、通常メモリ111上のアプリケーションが、通常OS151へ、通常メモリ111上の他のプログラムへコマンド又はデータの仲介を依頼するコマンドである。このとき、データ格納部1012には、仲介を依頼したアプリケーションを示す識別情報と仲介先のプログラムを示す識別情報と、仲介するデータ及びコマンドが書き込まれている。   The system call is a command in which an application on the normal memory 111 requests the normal OS 151 to send another command or data mediation to another program on the normal memory 111. At this time, in the data storage unit 1012, identification information indicating the application that requested the mediation, identification information indicating the program of the mediation destination, data and commands to mediate are written.

一例として、図9(c)は、音楽復号デーモン156が出力したシステムコールのデータ構造を示している。コマンド部1011には、システムコールが格納されており、データ格納部1012には、システムコールの発信元である音楽復号デーモン156を示すハンドル値「1」と、データの受け取り先である暗号エントリデバイスドライバ159を示すデバイスID_Cと、仲介されるデータ「処理結果」が格納されている。   As an example, FIG. 9C shows a data structure of a system call output by the music decryption daemon 156. The command unit 1011 stores a system call, and the data storage unit 1012 stores a handle value “1” indicating the music decryption daemon 156 that is the transmission source of the system call, and the encryption entry device that is the data reception destination. A device ID_C indicating the driver 159 and data “process result” to be mediated are stored.

応答通知は、システムコールによりアプリケーションからコマンド又はデータを受け取ったプログラムが、受け取ったコマンド及びデータに従って処理を行い、システムコールの出力元のアプリケーションへの処理結果の通知を、通常OS151へ依頼するものである。データ格納部1012には、通知依頼したプログラムを示す識別情報と通知先のアプリケーションを示す識別情報と、処理結果などが格納されている。   In response notification, a program that has received a command or data from an application through a system call performs processing according to the received command and data, and requests the normal OS 151 to notify the processing result to the application that has output the system call. is there. The data storage unit 1012 stores identification information indicating a program for which a notification is requested, identification information indicating a notification destination application, processing results, and the like.

一例として、図9(c)に示すシステムコールにより、ハンドル値「1」、デバイスID_C及び処理結果を受け取った暗号エントリデバイスドライバ159は、排他制御を解除し(詳細は後述する)、ハンドル値「1」、デバイスID_C及び処理結果を含む応答通知を通常OS151へ出力することにより、通常OS151を介して、ハンドル値「1」、デバイスID_C及び処理結果を音楽復号デーモン156へ通知する(詳細は後述する)。   As an example, the cryptographic entry device driver 159 that has received the handle value “1”, the device ID_C, and the processing result by the system call shown in FIG. 9C cancels the exclusive control (details will be described later). 1 ”, the response notification including the device ID_C and the processing result is output to the normal OS 151, and the handle value“ 1 ”, the device ID_C, and the processing result are notified to the music decryption daemon 156 via the normal OS 151 (details will be described later). To do).

セキュア処理要求は、通常メモリ111上のプログラムからセキュアメモリ113上のプログラムへのコマンド又はデータの仲介を依頼するコマンドである。このとき、データ格納部1012には、セキュア処理要求の出力元であるプログラムを示す識別情報と、仲介先のプログラムを示す情報及び仲介するデータ及びコマンドが格納されている。図9の(d)は、一例として、音楽復号デーモン156から出力されるセキュア処理要求のデータ構造を示している。データ格納部1012には、セキュア処理要求の出力元である音楽復号デーモン156を示すハンドル値「1」、受け取り先である暗号デバイスドライバ179を示すデバイスID_Cと、仲介されるコマンド「割込通知」とが格納されている。   The secure processing request is a command for requesting a command or data mediation from a program on the normal memory 111 to a program on the secure memory 113. At this time, the data storage unit 1012 stores identification information indicating the program that is the output source of the secure processing request, information indicating the program of the mediation destination, and data and commands to mediate. FIG. 9D shows the data structure of the secure processing request output from the music decryption daemon 156 as an example. In the data storage unit 1012, the handle value “1” indicating the music decryption daemon 156 that is the output source of the secure processing request, the device ID_C indicating the encryption device driver 179 that is the reception destination, and the intervening command “interrupt notification” And are stored.

外部処理要求は、セキュアメモリ113上のプログラムから通常メモリ111上のプログラムへのコマンド及びデータの仲介を依頼するものである。このとき、データ格納部1012には、セキュア処理要求の出力元であるプログラムを示す識別情報と、仲介先のプログラムを示す識別情報と、仲介されるデータ及びコマンドが格納されている。図9(e)は、一例として、暗号デバイスドライバ179から出力される外部処理要求のデータ構成を示している。コマンド部には、外部処理要求が格納されており、データ格納部には、外部処理要求の出力元である暗号デバイスドライバ179と対応するデバイスID_Cと受け取り先である音楽復号デーモン156と対応するハンドル値「1」と、仲介されるコマンド「休眠要求」が格納されている。   The external processing request is a request for mediation of a command and data from the program on the secure memory 113 to the program on the normal memory 111. At this time, the data storage unit 1012 stores identification information indicating the program that is the output source of the secure processing request, identification information indicating the broker program, and data and commands to be mediated. FIG. 9E shows the data structure of an external processing request output from the cryptographic device driver 179 as an example. The command unit stores an external processing request, and the data storage unit has a device ID_C corresponding to the encryption device driver 179 that is the output source of the external processing request and a handle corresponding to the music decryption daemon 156 that is the reception destination. The value “1” and the intervening command “sleep request” are stored.

休眠要求は、携帯電話100の備える、デバイスのデバイスドライバ及びデバイスへ処理を依頼したプログラムを休眠状態に遷移させることを依頼するコマンドである。このとき、データ格納部1012には、休眠要求を依頼するデバイスドライバを示す識別情報と、デバイスへ処理を依頼するプログラムと対応する識別情報とが格納されている。
割込発生通知は、割込の発生を通知するものである。
The sleep request is a command for requesting the device driver of the device included in the mobile phone 100 and a program requested to process the device to transition to the sleep state. At this time, the data storage unit 1012 stores identification information indicating a device driver that requests a sleep request, and identification information corresponding to a program that requests the device to perform processing.
The interrupt occurrence notification notifies the occurrence of an interrupt.

以下に、図10のフローチャートを用いて、通常OS151の動作について説明する。なお、通常OS151は、このフローチャートにおいて説明する処理以外にも、各種の処理を実行する。
ここで、セキュアアプリ登録要求、登録完了通知、アプリ復帰要求、セキュアアプリ削除命令及び削除完了通知については、具体的に、通常メモリ111上のアプリケーションを音楽再生プログラム153、セキュアアプリケーションを音楽復号プログラム176、セキュアアプリケーションと対になって動作するプログラムを音楽復号デーモン156として説明する。
The operation of the normal OS 151 will be described below using the flowchart of FIG. Note that the normal OS 151 executes various processes in addition to the processes described in this flowchart.
Here, regarding the secure application registration request, registration completion notification, application return request, secure application deletion command, and deletion completion notification, specifically, the application on the normal memory 111 is the music playback program 153, and the secure application is the music decryption program 176. A program that operates in a pair with the secure application will be described as a music decryption daemon 156.

通常OS151は、切替処理によってCPU102に復帰すると、共有メモリ112のコマンド領域からコマンドを読み出す(ステップS1001)。なお、切替処理については、以下の通常切替デバイスドライバ160及びセキュア切替デバイスドライバ180の説明において、詳細に説明する。
読み出したコマンドを解読し(ステップS1002)、解読したコマンドが登録完了通知であれば、音楽復号デーモン156を通常メモリ111上にロードし(ステップS1004)、ロードしたアドレスと、登録完了通知のデータ格納部に含んで受け取ったハンドル値「1」をアプリ管理表166のエントリ167に書き込み(ステップS1005)、ハンドル値「1」を音楽再生プログラム153へ出力する。
When the normal OS 151 returns to the CPU 102 by the switching process, it reads the command from the command area of the shared memory 112 (step S1001). The switching process will be described in detail in the description of the normal switching device driver 160 and the secure switching device driver 180 below.
The read command is decoded (step S1002), and if the decoded command is a registration completion notification, the music decoding daemon 156 is loaded onto the normal memory 111 (step S1004), and the loaded address and registration completion notification data are stored. The handle value “1” received in the section is written in the entry 167 of the application management table 166 (step S1005), and the handle value “1” is output to the music playback program 153.

読み出したコマンドが外部処理要求であれば(ステップS1002)、データ格納部に含まれる仲介先を示す識別情報と対応するプログラムを呼び出し、呼び出したプログラムへ外部処理要求のデータ格納部に含んで受け取った情報を出力する(ステップS1006)。
読み出したコマンドが割込発生通知であれば(ステップS1002)、CPU102の割込レジスタに書き込まれているダミーデータを消去することで割込マスクを解除する(ステップS1007)。割込マスクについては、後のセキュア割込ハンドラ181に関する説明において述べる。
If the read command is an external processing request (step S1002), the program corresponding to the identification information indicating the mediation destination included in the data storage unit is called and received in the data storage unit of the external processing request to the called program. Information is output (step S1006).
If the read command is an interrupt generation notification (step S1002), the interrupt mask is canceled by deleting the dummy data written in the interrupt register of the CPU 102 (step S1007). The interrupt mask will be described later in the description of the secure interrupt handler 181.

読み出したコマンドが、アプリ復帰要求である場合(ステップS1002)、データ格納部に含まれるハンドル値「1」と、アプリ管理表166とを基に、音楽再生プログラム153のコンテキストを復帰させる(ステップS1009)。
読み出したコマンドが、削除完了通知であれば(ステップS1002)、データ格納部に含まれるハンドル値「1」と対応する音楽復号デーモン156を通常メモリ111から削除し(ステップS1011)、アプリ管理表166からハンドル値「1」を含むエントリ167を削除する(ステップS1012)。
If the read command is an application return request (step S1002), the context of the music playback program 153 is returned based on the handle value “1” included in the data storage unit and the application management table 166 (step S1009). ).
If the read command is a deletion completion notification (step S1002), the music decryption daemon 156 corresponding to the handle value “1” included in the data storage unit is deleted from the normal memory 111 (step S1011), and the application management table 166 is deleted. Entry 167 including the handle value “1” is deleted (step S1012).

次に、通常メモリ111上の各プログラムからのコマンドを受け付ける(ステップS1013)。
システムコールを受け付けると(ステップS1013)、データ格納部に書き込まれているハンドル値又はデバイスIDなどの仲介先を示す識別情報と対応するプログラムを呼び出し、データ格納部に含まれる情報を出力する(ステップS1014)。例えば、ハンドル値「1」が含まれていると、アプリ管理表166でハンドル値「1」を含むエントリ167を選択し、選択したエントリ167のデーモンアドレスを基に音楽復号デーモン156を呼び出し、デバイスID_Cが含まれていると、暗号エントリデバイスドライバ159を呼び出す。
Next, a command from each program on the normal memory 111 is accepted (step S1013).
When a system call is received (step S1013), a program corresponding to identification information indicating a mediation destination such as a handle value or a device ID written in the data storage unit is called and information included in the data storage unit is output (step S1013). S1014). For example, if the handle value “1” is included, the entry 167 including the handle value “1” is selected in the application management table 166, and the music decryption daemon 156 is called based on the daemon address of the selected entry 167, and the device If ID_C is included, the cryptographic entry device driver 159 is called.

また、具体的には図示していないが、応答通知を受け取った場合も、システムコールを受け取った場合と同様に、データ格納部に書き込まれている識別情報と対応するアプリケーションを呼び出し、データ格納部に含まれる情報を出力する。
休眠要求を受け付けると(ステップS1013)、データ格納部に書き込まれているハンドル値又はデバイスIDなどの識別情報に対応するプログラムと対応するプログラムを休眠状態に遷移させる(ステップS1016)。休眠状態とは、一切の動作を行わない状態を言う。
Although not specifically shown, even when a response notification is received, the application corresponding to the identification information written in the data storage unit is called as in the case of receiving the system call, and the data storage unit The information contained in is output.
When the sleep request is received (step S1013), the program corresponding to the identification information such as the handle value or device ID written in the data storage unit is shifted to the sleep state (step S1016). The sleep state refers to a state in which no operation is performed.

音楽復号プログラム176から図9(b)の示すように、データ格納部にセキュアアプリ情報とデーモン情報とを含むセキュアアプリ登録要求を受け付けると(ステップS1013)、音楽再生プログラム153のコンテキストを通常メモリ111上に保存し、保存先のアドレスをアプリコンテキストアドレスに書き込み、セキュアアプリ情報を基に二次記憶部104から読み出した暗号化音楽復号プログラム141を共有メモリ112に書き込む(ステップS1017)。次に、セキュアアプリ登録要求を、共有メモリ112上に書き込み(ステップS1018)、ステップS1028へ処理を移す。このときの、セキュアアプリ登録要求は、データ格納部に暗号化音楽復号プログラムの共有メモリ112上の書き込み先のアドレスを含んでいる。   When a secure application registration request including secure application information and daemon information is received in the data storage unit as shown in FIG. 9B from the music decryption program 176 (step S1013), the context of the music playback program 153 is stored in the normal memory 111. Then, the storage destination address is written in the application context address, and the encrypted music decryption program 141 read from the secondary storage unit 104 based on the secure application information is written in the shared memory 112 (step S1017). Next, a secure application registration request is written on the shared memory 112 (step S1018), and the process proceeds to step S1028. The secure application registration request at this time includes the address of the write destination on the shared memory 112 of the encrypted music decryption program in the data storage unit.

音楽再生プログラム153からセキュアアプリ削除命令を受け取ると(ステップS1013)、受け取ったセキュアアプリ削除命令を共有メモリ112に書き込む(ステップS1019)。ここで、データ格納部には、削除対象となる音楽復号プログラム176を示すハンドル値「1」が格納されている。
セキュア処理要求を受け付けると(ステップS1013)、受け付けたセキュア処理要求を共有メモリ112に書き込む(ステップS1021)。次に、切替処理を行う(ステップS1028)。
When a secure application deletion command is received from the music playback program 153 (step S1013), the received secure application deletion command is written into the shared memory 112 (step S1019). Here, a handle value “1” indicating the music decryption program 176 to be deleted is stored in the data storage unit.
When a secure processing request is received (step S1013), the received secure processing request is written into the shared memory 112 (step S1021). Next, a switching process is performed (step S1028).

また、割込が発生し、割込みコントローラ107から割込発生通知を受け取る(ステップS1023)、通常割込ハンドラ161を起動する(ステップS1024)。通常割込ハンドラ161による、割込要因の調査結果に基づき休眠しているプログラムの休眠を解除し(ステップS1026)。ステップS1013へ処理を移す。
なお、本実施の形態では、通常OS151とセキュアOS171とは、共有メモリ112を介して、各種のコマンドをやり取りしているが、共有メモリ112に代わって、専用レジスタを用いるとしてもよい。
<セキュアOS171>
セキュアOS171は、図6に示すように、オペレーティングプログラム172、デバッグ無効化プログラム173、暗復号プログラム174から構成される。
Further, when an interrupt occurs and an interrupt occurrence notification is received from the interrupt controller 107 (step S1023), the normal interrupt handler 161 is activated (step S1024). Based on the investigation result of the interrupt factor by the normal interrupt handler 161, the sleep of the sleeping program is canceled (step S1026). The process moves to step S1013.
In this embodiment, the normal OS 151 and the secure OS 171 exchange various commands via the shared memory 112, but a dedicated register may be used instead of the shared memory 112.
<Secure OS 171>
As shown in FIG. 6, the secure OS 171 includes an operating program 172, a debug invalidation program 173, and an encryption / decryption program 174.

デバッグ無効化プログラム173は、デバッガIF101のレジスタにダミーデータを書き込み、デバッガIF101を無効化するプログラムである。なお、デバッガIF101とCPU102との間にスイッチを備え、デバッグ無効化プログラム173は、このスイッチを開閉することで、デバッガIF101を無効化する構成であってもよい。
暗復号プログラム174は、予め復号鍵をコーディングされており、暗号化音楽復号プログラムを復号して、音楽復号プログラムを生成する。
The debug invalidation program 173 is a program for invalidating the debugger IF 101 by writing dummy data to the register of the debugger IF 101. Note that a switch may be provided between the debugger IF 101 and the CPU 102, and the debug invalidation program 173 may be configured to invalidate the debugger IF 101 by opening and closing this switch.
The encryption / decryption program 174 is previously coded with a decryption key, and decrypts the encrypted music decryption program to generate a music decryption program.

オペレーティングプログラム172は、セキュアメモリ113上にロードされる各種のプログラムを制御する基本ソフトウェアであり、制御プログラムと制御データとから構成される。制御部データには、図6に示すように、セキュアアプリ管理表186が含まれる。
セキュアアプリ管理表186は、図7に示すように、複数のエントリ187、188・・・を含む。各エントリは、ハンドル値、セキュアアプリアドレス、セキュアアプリコンテキストアドレスから構成され、セキュアメモリ113上にロードされているセキュアアプリケーションと対応している。
The operating program 172 is basic software that controls various programs loaded on the secure memory 113, and includes a control program and control data. As shown in FIG. 6, the control unit data includes a secure application management table 186.
As shown in FIG. 7, the secure application management table 186 includes a plurality of entries 187, 188. Each entry includes a handle value, a secure application address, and a secure application context address, and corresponds to a secure application loaded on the secure memory 113.

ハンドル値は、各セキュアアプリケーションに割り当てられた識別子である。
セキュアアプリアドレスは、セキュアアプリケーションがロードされている、セキュアメモリ113上のアドレスである。セキュアアプリコンテキストアドレスは、セキュアアプリケーションのコンテキストが保存されているセキュアメモリ113上のアドレスである。
The handle value is an identifier assigned to each secure application.
The secure application address is an address on the secure memory 113 where the secure application is loaded. The secure application context address is an address on the secure memory 113 in which the context of the secure application is stored.

一例としてエントリ187のハンドル値「1」は、オペレーティングプログラム172が音楽復号プログラム176に割り当てた識別子である。セキュアアプリアドレス「1111EEEE」は、音楽復号プログラム176が記憶されているセキュアメモリ113上のアドレスであり、セキュアアプリコンテキストアドレス「11AADDDE」は、音楽復号プログラム176のコンテキストが記憶されているセキュアメモリ113上のアドレスである。   As an example, the handle value “1” of the entry 187 is an identifier assigned to the music decryption program 176 by the operating program 172. The secure application address “1111EEEE” is an address on the secure memory 113 in which the music decryption program 176 is stored, and the secure application context address “11AADDDE” is on the secure memory 113 in which the context of the music decryption program 176 is stored. Address.

また、制御データには、セキュア入出力デバイスドライバ178と対応する識別情報であるデバイスID_B、暗号デバイスドライバ179と対応する識別情報であるデバイスID_Cが含まれる。これらは、それぞれ、セキュア入出力デバイスドライバ178及び暗号デバイスドライバ179のセキュアメモリ113上のロードアドレスと対応付けて、セキュアメモリ113上に記憶されている。
ここで、デバイスID_B及びデバイスID_Cは、通常OS151の有する制御データに含まれるデバイスID_B及びデバイスID_Cと同一である。
The control data includes device ID_B that is identification information corresponding to the secure input / output device driver 178 and device ID_C that is identification information corresponding to the encryption device driver 179. These are stored on the secure memory 113 in association with the load addresses on the secure memory 113 of the secure input / output device driver 178 and the encryption device driver 179, respectively.
Here, the device ID_B and the device ID_C are the same as the device ID_B and the device ID_C included in the control data of the normal OS 151.

セキュアOS171は、共有メモリ112のコマンド領域を介して通常OS151との間で各種のコマンドの授受を行う。また、セキュアメモリ113上の各プログラムとの間でセキュアメモリ113上のオペレーティングプログラム172の有する記憶領域を介して、コマンドを送受信する。
以下の説明において、説明の便宜上、オペレーティングプログラム172の行う処理を、セキュアOS171の行う処理として表現する。
The secure OS 171 exchanges various commands with the normal OS 151 via the command area of the shared memory 112. In addition, commands are transmitted to and received from each program on the secure memory 113 via the storage area of the operating program 172 on the secure memory 113.
In the following description, for the sake of convenience of explanation, processing performed by the operating program 172 is expressed as processing performed by the secure OS 171.

セキュアOS171が扱う各種のコマンドは、通常OS151が扱うコマンドと同様に、図9の(a)に示す構造である。コマンド部1011に格納されるコマンドには、セキュアアプリ登録要求、登録完了通知、アプリ復帰要求、セキュアアプリ削除命令、削除完了通知、システムコール、応答通知、セキュア処理要求、外部処理要求、割込発生通知などがある。セキュアアプリ登録要求、登録完了通知、アプリ復帰要求、セキュアアプリ削除命令、削除完了通知、セキュア処理要求、外部処理要求、割込発生通知については、上記の通常OS151に関する説明において既に述べた通りである。システムコールは、セキュアメモリ113上のアプリケーションからセキュアメモリ113上の他のプログラムへのデータ及びコマンドの仲介を依頼するものであり、応答通知は、システムコールにより、コマンド及びデータを受け取ったプログラムが、処理結果などの通知をセキュアOS171へ依頼するものである。   The various commands handled by the secure OS 171 have the structure shown in FIG. 9A, like the commands handled by the normal OS 151. The commands stored in the command unit 1011 include secure application registration request, registration completion notification, application restoration request, secure application deletion command, deletion completion notification, system call, response notification, secure processing request, external processing request, and interrupt generation. There are notifications. The secure application registration request, registration completion notification, application return request, secure application deletion command, deletion completion notification, secure processing request, external processing request, and interrupt occurrence notification are as described above in the description of the normal OS 151. . The system call is a request for mediation of data and commands from an application on the secure memory 113 to another program on the secure memory 113, and the response notification is sent from the program that received the command and data by the system call. The secure OS 171 is requested to notify the processing result and the like.

以下に、図11のフローチャートを用いて、セキュアOS171の動作について説明する。ここで、セキュアアプリ登録要求、登録完了通知、セキュアアプリ削除命令及び削除完了通知については、具体的に、アプリケーションを音楽再生プログラム153、セキュアアプリケーションを音楽復号プログラム176、セキュアアプリケーションと対になって動作するプログラムを音楽復号デーモン156として説明する。なお、セキュアOS171は、このフローチャートに示した処理以外にも各種の処理を行っているが、本発明とは関係がないため、ここでは説明をしない。   The operation of the secure OS 171 will be described below using the flowchart of FIG. Here, regarding the secure application registration request, registration completion notification, secure application deletion command, and deletion completion notification, specifically, the application operates as a pair with the music playback program 153, the secure application as the music decryption program 176, and the secure application. The program to be performed will be described as a music decryption daemon 156. The secure OS 171 performs various types of processing other than the processing shown in this flowchart, but is not described here because it is not related to the present invention.

切替処理によって、セキュアOS171がCPU102に復帰する(ステップS1041)。セキュアOS171は、共有メモリ112のコマンド領域からコマンドを読み出して解読し(ステップS1042)、解読したコマンドによって、以下の処理を行う。
読み出したコマンドがセキュアアプリ登録要求であれば(ステップS1042)、暗復号プログラム174によって、共有メモリ112上の暗号化音楽復号プログラムを復号して音楽復号プログラム176を生成し、セキュアメモリ113上にロードする(ステップS1043)。ロードアドレス及びハンドル値「1」をセキュアアプリ管理表186のエントリ187に書き込む(ステップS1044)。次に、登録完了通知をコマンド部に格納し、データ格納部にハンドル値「1」を格納した、登録完了通知を生成し、共有メモリ112に書き込む(ステップS1046)。次に、切替処理に移る(ステップS1062)。
Through the switching process, the secure OS 171 returns to the CPU 102 (step S1041). The secure OS 171 reads and decodes the command from the command area of the shared memory 112 (step S1042), and performs the following processing according to the decoded command.
If the read command is a secure application registration request (step S1042), the encryption / decryption program 174 decrypts the encrypted music decryption program on the shared memory 112 to generate the music decryption program 176 and loads it onto the secure memory 113. (Step S1043). The load address and the handle value “1” are written in the entry 187 of the secure application management table 186 (step S1044). Next, the registration completion notification is stored in the command portion, and the registration completion notification is generated with the handle value “1” stored in the data storage portion, and is written in the shared memory 112 (step S1046). Next, the process proceeds to a switching process (step S1062).

解読したコマンドが、セキュア処理要求であれば(ステップS1042)、データ格納部に格納されている、受け取り先となるプログラムの識別情報と対応するプログラムを呼び出す(ステップS1047)。例えば、ハンドル値「1」が格納されていれば、音楽再生プログラム153を呼び出し、デバイスID_Bが格納されていれば、セキュア入出力デバイスドライバ178を呼び出す。次に、ステップS1052へ移る。   If the decrypted command is a secure processing request (step S1042), a program corresponding to the identification information of the program to be received stored in the data storage unit is called (step S1047). For example, if the handle value “1” is stored, the music playback program 153 is called, and if the device ID_B is stored, the secure input / output device driver 178 is called. Next, the process proceeds to step S1052.

読み出したコマンドがセキュアアプリ削除命令であれば(ステップS1042)、データ格納部に格納されている、削除の対象となるプログラムを示すハンドル値「1」を抽出し、抽出したハンドル値「1」と対応する音楽復号プログラム176をセキュアメモリ113上から削除し、次に、セキュアアプリ管理表186から、エントリ187を削除する(ステップS1049)。   If the read command is a secure application deletion command (step S1042), a handle value “1” indicating a program to be deleted stored in the data storage unit is extracted, and the extracted handle value “1” is set. The corresponding music decryption program 176 is deleted from the secure memory 113, and then the entry 187 is deleted from the secure application management table 186 (step S1049).

削除し終えると、削除完了通知を共有メモリ112に書き込む(ステップS1051)。このとき、コマンド部には削除完了通知が格納されており、データ格納部には、ハンドル値「1」が格納されている。次に、ステップS1062へ処理を移す。
次に、セキュアOS171は、セキュアメモリ113上の各プログラムから、コマンドを受け取る(ステップS1052)。
When the deletion is completed, a deletion completion notification is written in the shared memory 112 (step S1051). At this time, a deletion completion notification is stored in the command portion, and a handle value “1” is stored in the data storage portion. Next, the process proceeds to step S1062.
Next, the secure OS 171 receives a command from each program on the secure memory 113 (step S1052).

受け取ったコマンドが、外部処理要求であれば(ステップS1052)、共有メモリに、受け取った外部処理要求を書き込み(ステップS1053)、ステップS1062へ処理を移す。
セキュア割込ハンドラ181(後述する)から、いずれかのデバイスで割込が発生したことを示す割込発生通知を受け取ると、受け取った割込発生通知を、共有メモリ112に書き込み(ステップS1054)、ステップS1062へ処理を移す。
If the received command is an external processing request (step S1052), the received external processing request is written in the shared memory (step S1053), and the process proceeds to step S1062.
When an interrupt occurrence notification indicating that an interrupt has occurred in any device is received from the secure interrupt handler 181 (described later), the received interrupt occurrence notification is written to the shared memory 112 (step S1054). The process moves to step S1062.

受け取ったコマンドがシステムコールであれば(ステップS1052)、データ格納部に格納されている受け取り先のプログラムを示す識別情報により、該当するプログラムを呼び出す(ステップS1056)。
受け取ったコマンドが、アプリ復帰要求であれば(ステップS1052)、共有メモリに、受け取ったアプリ復帰要求を書き込み(ステップS1061)、ステップS1062へ処理を移す。また、具体的には図示していないが、応答通知の場合も同様に、データ格納部に含まれる識別情報と対応するアプリケーションを呼び出す。
If the received command is a system call (step S1052), the corresponding program is called by the identification information indicating the receiving destination program stored in the data storage unit (step S1056).
If the received command is an application return request (step S1052), the received application return request is written in the shared memory (step S1061), and the process proceeds to step S1062. Although not specifically shown, in the case of a response notification, an application corresponding to the identification information included in the data storage unit is similarly called.

これらの処理の途中で、割込が発生し、割込みコントローラ107から割込発生通知を受け取ると(ステップS1057)、セキュア割込ハンドラ181を起動し(ステップS1059)、ステップS1052へ戻る。
<ライブラリ152>
ライブラリ152は、各種のプログラムで共通に利用される関数を含んでおり、一例として、メモリカード300のアクセスを行うアクセス関数を含む。アクセス関数は、通常入出力デバイスドライバ157を呼び出し、データの読み出しを指示する関数である。
<音楽再生プログラム153>
音楽再生プログラム153は、利用者に表示する各種の画像データなどを含み、利用者の操作を受けてメモリカード300に記憶されている音楽を再生するアプリケーションである。音楽再生プログラム153には、予め、セキュアアプリ情報とデーモン情報とがコーディングされている。セキュアアプリ情報は、音楽再生プログラム153が、セキュアな処理を依頼するプログラムを示す情報であり、具体的には、暗号化音楽復号プログラム141の記憶されている二次記憶部104上のアドレスである。デーモン情報は、セキュアアプリ情報の示すプログラムと対になるプログラムを示す情報であり、具体的には、音楽復号デーモン142の記憶されている二次記憶部104上のアドレスである。
<音楽復号プログラム176及び音楽復号デーモン156>
音楽復号プログラム176と音楽復号デーモン156は、対になって動作することにより、暗号化音楽データの復号処理が達成される。
In the middle of these processes, when an interrupt occurs and an interrupt occurrence notification is received from the interrupt controller 107 (step S1057), the secure interrupt handler 181 is activated (step S1059) and the process returns to step S1052.
<Library 152>
The library 152 includes functions that are commonly used by various programs. As an example, the library 152 includes an access function for accessing the memory card 300. The access function is a function for calling the normal input / output device driver 157 and instructing reading of data.
<Music playback program 153>
The music reproduction program 153 is an application that includes various image data to be displayed to the user and reproduces music stored in the memory card 300 in response to the user's operation. In the music playback program 153, secure application information and daemon information are coded in advance. The secure application information is information indicating a program for which the music playback program 153 requests secure processing, and specifically, an address on the secondary storage unit 104 in which the encrypted music decryption program 141 is stored. . The daemon information is information indicating a program that is paired with the program indicated by the secure application information. Specifically, the daemon information is an address on the secondary storage unit 104 in which the music decryption daemon 142 is stored.
<Music Decoding Program 176 and Music Decoding Daemon 156>
The music decryption program 176 and the music decryption daemon 156 operate in a pair to achieve decryption processing of the encrypted music data.

音楽復号プログラム176は、通常OS151及びセキュアOS171を介して、音楽再生プログラム153から復号命令を受け、図8に示すようにデータ読出ステップ、コンテンツ鍵読出ステップ、復号ステップ及び音楽データ出力ステップを経て、音楽データを生成し、音楽データ出力ステップにおいて、処理結果として、バッファ123上の音楽データの書き込み先アドレスを出力する。   The music decryption program 176 receives a decryption command from the music playback program 153 via the normal OS 151 and the secure OS 171 and, as shown in FIG. 8, undergoes a data read step, a content key read step, a decryption step, and a music data output step. Music data is generated, and in the music data output step, the music data write destination address on the buffer 123 is output as a processing result.

これらの処理の中で、高いセキュリティを必要としない処理を音楽復号デーモン156へ依頼する。具体的には、セキュアOS171へ外部処理要求を出力することによって、音楽復号デーモン156へデータ読み出し命令を出力する。その処理結果として共有メモリ112上の暗号化音楽データの書き込み先アドレスを受け取る。また、セキュアOS171へ外部処理要求によって、音楽復号デーモン156へ復号命令を出力し、処理結果として、バッファ123上の音楽データの書き込み先アドレスを取得する。   Of these processes, the music decryption daemon 156 is requested to perform a process that does not require high security. Specifically, a data read command is output to the music decryption daemon 156 by outputting an external processing request to the secure OS 171. As a result of the processing, the write destination address of the encrypted music data on the shared memory 112 is received. Further, in response to an external processing request to the secure OS 171, a decryption command is output to the music decryption daemon 156, and a music data write destination address on the buffer 123 is acquired as a processing result.

音楽復号デーモン156は、セキュアOS171及び通常OS151を介して、音楽復号プログラム176からデータ読み出し命令及び復号命令を受け取る。また、通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158、暗号エントリデバイスドライバ159、セキュア入出力デバイスドライバ178及び暗号デバイスドライバ179から各種の命令及びデータを受け取る。受け取った命令及びデータに基づいて各種の処理を行う。音楽復号デーモン156による処理について、図12のフローチャートを用いて説明する。なお、図9においては、書略しているが、音楽復号デーモン156の受け取るすべておコマンド、データには、受け取り先である音楽復号デーモン156を示す識別情報としてハンドル値「1」が含まれている。   The music decryption daemon 156 receives a data read command and a decryption command from the music decryption program 176 via the secure OS 171 and the normal OS 151. Various commands and data are received from the normal input / output device driver 157, the secure input / output entry device driver 158, the cryptographic entry device driver 159, the secure input / output device driver 178, and the cryptographic device driver 179. Various processes are performed based on the received command and data. Processing performed by the music decryption daemon 156 will be described with reference to the flowchart of FIG. Although omitted in FIG. 9, all commands and data received by the music decryption daemon 156 include a handle value “1” as identification information indicating the music decryption daemon 156 that is the recipient. .

セキュアOS171を介して、各種の命令及びデータを受け取る(ステップS011)。受け取った命令を判別し(ステップS012)、データ読出命令であれば、ライブラリ152のアクセス関数を呼び出す(ステップS013)。
コマンドの出力元を示す識別情報としてデバイスID_Aと処理結果とを受け取ると、外部処理要求により、受け取った処理結果を音楽復号プログラム176へ出力する(ステップS014)。このとき、データ格納部には、処理結果と、受け取り先を示すハンドル値「1」とを格納する。
Various commands and data are received via the secure OS 171 (step S011). The received instruction is determined (step S012), and if it is a data read instruction, the access function of the library 152 is called (step S013).
When device ID_A and the processing result are received as identification information indicating the output source of the command, the received processing result is output to the music decoding program 176 by an external processing request (step S014). At this time, the processing result and the handle value “1” indicating the receiving destination are stored in the data storage unit.

コマンドの出力元を示すデバイスID_Bと休眠要求とを受け取ると(ステップS012)、通常OS151へのシステムコールによって、受け取った休眠要求をセキュア入出力エントリデバイスドライバ158へ出力する(ステップS015)。このとき、データ格納部には、受け取り先を示す識別情報として、受け取ったデバイスID_Bを格納し、システムコールの出力元を示す識別情報として音楽復号デーモン156自身を示すハンドル値「1」とを格納する。   When the device ID_B indicating the command output source and the sleep request are received (step S012), the received sleep request is output to the secure input / output entry device driver 158 by a system call to the normal OS 151 (step S015). At this time, the data storage unit stores the received device ID_B as identification information indicating the receiving destination, and stores a handle value “1” indicating the music decoding daemon 156 itself as identification information indicating the output source of the system call. To do.

コマンドの出力元を示すデバイスID_Bと、割込通知とを受け取ると(ステップS012)、セキュア処理要求のデータ格納部に、受け取った割込通知とデバイスID_Bと音楽復号デーモン156自身を示すハンドル値「1」とを格納し、通常OSへ出力することにより、受け取った割込通知をセキュア入出力デバイスドライバ178へ出力する(ステップS016)。   When the device ID_B indicating the output source of the command and the interrupt notification are received (step S012), the handle value “indicating the received interrupt notification, the device ID_B, and the music decryption daemon 156 itself is stored in the secure processing request data storage unit. 1 "is stored and output to the normal OS, so that the received interrupt notification is output to the secure input / output device driver 178 (step S016).

セキュアOS171及び通常OS151を介して、音楽復号プログラム176から、復号命令を受け取ると、システムコールにより暗号エントリデバイスドライバ159へ復号命令を出力する(ステップS017)。
応答通知により、暗号エントリデバイスドライバ159から、デバイスID_Cと復号命令を受け取ると(ステップS012)、セキュア処理要求により、受け取った復号命令を暗号デバイスドライバ179へ出力する。このとき、データ格納部には、復号命令と受け取ったデバイスID_Cと音楽復号デーモン156自身を示すハンドル値「1」とを格納する(ステップS018)。
When a decryption instruction is received from the music decryption program 176 via the secure OS 171 and the normal OS 151, the decryption instruction is output to the encryption entry device driver 159 by a system call (step S017).
When the device ID_C and the decryption command are received from the cryptographic entry device driver 159 by the response notification (step S012), the received decryption command is output to the cryptographic device driver 179 by the secure processing request. At this time, the decryption command, the received device ID_C, and the handle value “1” indicating the music decryption daemon 156 itself are stored in the data storage unit (step S018).

通常OS151から、デバイスID_Cと休眠要求とを受け取ると、システムコールにより暗号エントリデバイスドライバ159へ、受け取った休眠要求を出力する(ステップS019)。このとき、データ格納部には、受け取り先を示す識別情報として受け取ったデバイスID_Cと音楽復号デーモン156自身を示すハンドル値「1」と休眠要求とを格納する。   When the device ID_C and the sleep request are received from the normal OS 151, the received sleep request is output to the cryptographic entry device driver 159 by a system call (step S019). At this time, the device ID_C received as identification information indicating the recipient, the handle value “1” indicating the music decryption daemon 156 itself, and the sleep request are stored in the data storage unit.

応答通知によって、暗号エントリデバイスドライバ159から、デバイスID_Cと割込通知とを受け取ると(ステップS012)、セキュア処理要求により、受け取った割込通知を暗号デバイスドライバ179へ出力する(ステップS021)。データ格納部には、受け取ったデバイスID_Cと割込通知と音楽復号デーモン156自身を示すハンドル値「1」とを格納する。   When the device ID_C and the interrupt notification are received from the cryptographic entry device driver 159 by the response notification (step S012), the received interrupt notification is output to the cryptographic device driver 179 by the secure processing request (step S021). The data storage unit stores the received device ID_C, the interrupt notification, and the handle value “1” indicating the music decryption daemon 156 itself.

通常OS151から、デバイスID_Cと処理結果とを受け取ると、システムコールにより、受け取った処理結果を暗号エントリデバイスドライバ159へ出力する(ステップS022)。
応答通知により、暗号エントリデバイスドライバ159から、デバイスID_Cと処理結果とを受け取ると、セキュア処理要求によって、音楽復号プログラム176へ受け取った処理結果を出力する(ステップS023)。
<通常入出力デバイスドライバ157>
通常入出力デバイスドライバ157は、予め、通常入出力デバイスドライバ157自身を示す識別情報として、デバイスID_Aを有している。
When the device ID_C and the processing result are received from the normal OS 151, the received processing result is output to the cryptographic entry device driver 159 by a system call (step S022).
When the device ID_C and the processing result are received from the encryption entry device driver 159 by the response notification, the processing result received by the secure processing request is output to the music decryption program 176 (step S023).
<Normal input / output device driver 157>
The normal input / output device driver 157 has a device ID_A as identification information indicating the normal input / output device driver 157 itself.

通常入出力デバイスドライバ157は、入出力部116を構成する通常入出力デバイス132を制御するプログラムである。
また、通常入出力デバイスドライバ157は、排他フラグを記憶している。通常入出力デバイス132が動作中は、排他フラグ「1」、動作中でなければ排他フラグ「0」を設定する。入出力の処理命令を受け取った際に排他フラグが「1」であれば、通常入出力デバイス132が動作中であり、処理を受け付けることができないことを示すエラー通知を出力する。
<セキュア入出力エントリデバイスドライバ158及びセキュア入出力デバイスドライバ178>
セキュア入出力デバイスドライバ178及びセキュア入出力エントリデバイスドライバ158は、予め、同一の識別情報、デバイスID_Bを有する。
The normal input / output device driver 157 is a program that controls the normal input / output device 132 configuring the input / output unit 116.
The normal input / output device driver 157 stores an exclusive flag. The exclusive flag “1” is set when the normal input / output device 132 is operating, and the exclusive flag “0” is set when the normal input / output device 132 is not operating. If the exclusive flag is “1” when the input / output processing command is received, an error notification indicating that the normal input / output device 132 is operating and cannot accept the processing is output.
<Secure I / O Entry Device Driver 158 and Secure I / O Device Driver 178>
The secure input / output device driver 178 and the secure input / output entry device driver 158 have the same identification information and device ID_B in advance.

セキュア入出力デバイスドライバ178及びセキュア入出力エントリデバイスドライバ158が、対になって制御することにより、セキュア入出力デバイス133は正常に動作する。セキュア入出力デバイスドライバ178は、セキュア入出力デバイス133の制御のうち、セキュアな処理である入出力処理の依頼及び処理結果の取得を行い、セキュア入出力エントリデバイスドライバ158は、高いセキュリティを必要としない処理である、休眠及び割込の検出を行う。   The secure input / output device 133 operates normally when the secure input / output device driver 178 and the secure input / output entry device driver 158 control in pairs. The secure input / output device driver 178 requests an input / output process, which is a secure process, and acquires a processing result in the control of the secure input / output device 133. The secure input / output entry device driver 158 requires high security. Detect sleep and interrupt, which is a process that does not.

本実施の形態において、セキュア入出力デバイスドライバ178は、セキュアOS171を介して音楽復号プログラム176から、コンテンツ鍵読出命令を受け取る。コンテンツ鍵読出命令を受け取ると、暗号処理デバイス117へ、コンテンツ鍵の読出を指示する。次に、セキュアOS171へ外部処理要求を出力することにより、音楽復号デーモン156へ休眠要求を出力する。このとき、コマンドのデータ格納部には、休眠要求と、受け取り先を示す識別情報として音楽復号プログラム176から受け取ったハンドル値「1」と、コマンドの出力元を示す識別情報としてセキュア入出力デバイスドライバ178自身を示すデバイスID_Bとを格納する。   In the present embodiment, the secure input / output device driver 178 receives a content key read command from the music decryption program 176 via the secure OS 171. When the content key read command is received, the cryptographic processing device 117 is instructed to read the content key. Next, by outputting an external processing request to the secure OS 171, a sleep request is output to the music decryption daemon 156. At this time, the command data storage unit stores the sleep request, the handle value “1” received from the music decryption program 176 as identification information indicating the recipient, and the secure input / output device driver as identification information indicating the output source of the command. The device ID_B indicating 178 itself is stored.

次に、セキュア入出力デバイスドライバ178は、セキュアOS171を介して音楽復号デーモン156から割込通知を受け取り、セキュア入出力デバイス133から処理結果として、コンテンツ鍵の格納されたアドレスを取得する。取得した処理結果をセキュアOS171への応答通知により、音楽復号プログラム176へ出力する。
セキュア入出力エントリデバイスドライバ158は、通常OS151を介して音楽復号デーモン156から休眠要求を受け取る。休眠要求を受け取ると、通常OS151に対して、データ格納部に、ハンドル値「1」とデバイスID_Bを含む休眠要求を出力する。
Next, the secure input / output device driver 178 receives an interrupt notification from the music decryption daemon 156 via the secure OS 171 and acquires the address where the content key is stored as the processing result from the secure input / output device 133. The acquired processing result is output to the music decryption program 176 by a response notification to the secure OS 171.
The secure input / output entry device driver 158 receives a sleep request from the music decryption daemon 156 via the normal OS 151. When the sleep request is received, a sleep request including the handle value “1” and the device ID_B is output to the data storage unit to the normal OS 151.

次に、通常OS151により休眠が解除されると、キュア入出力エントリデバイスドライバ158は、応答通知により通常OS151を介して、音楽復号デーモン156へ割込通知を出力する。このとき、データ格納部には、「休眠要求」と、デバイスID_Bと、ハンドル値「1」とを格納する。
<暗号デバイスドライバ179及び暗号エントリデバイスドライバ159>
暗号デバイスドライバ179及び暗号エントリデバイスドライバ159は、予め、識別情報としてデバイスID_Cを有している。
Next, when the sleep is canceled by the normal OS 151, the cure input / output entry device driver 158 outputs an interrupt notification to the music decryption daemon 156 via the normal OS 151 by a response notification. At this time, the “sleeping request”, the device ID_B, and the handle value “1” are stored in the data storage unit.
<Cryptographic device driver 179 and cryptographic entry device driver 159>
The cryptographic device driver 179 and the cryptographic entry device driver 159 have a device ID_C as identification information in advance.

暗号デバイスドライバ179と暗号エントリデバイスドライバ159が、対になって制御することにより、暗号処理デバイス117は正常に動作することができる。暗号処理デバイス117の制御のうち、暗号デバイスドライバ179は、復号処理の依頼と処理結果の取得とを行い、暗号エントリデバイスドライバ159は、排他制御と休眠及び割込通知を行う。   The cryptographic processing device 117 can operate normally by controlling the cryptographic device driver 179 and the cryptographic entry device driver 159 as a pair. Among the controls of the cryptographic processing device 117, the cryptographic device driver 179 performs a request for decryption processing and obtains a processing result, and the cryptographic entry device driver 159 performs exclusive control, sleep and interrupt notification.

本実施の形態において、具体的には、暗号エントリデバイスドライバ159は、システムコールにより音楽復号デーモン156から復号命令を受け取る。復号命令を受け取ると、排他フラグによる排他制御を行う。つまり、排他フラグが「1」であれば、エラー通知を出力し、以下の処理を中止し、排他フラグが「0」であれば、排他フラグを「1」に変更する。   In the present embodiment, specifically, the encryption entry device driver 159 receives a decryption command from the music decryption daemon 156 by a system call. When a decryption instruction is received, exclusive control using an exclusive flag is performed. That is, if the exclusion flag is “1”, an error notification is output, and the following processing is stopped. If the exclusion flag is “0”, the exclusion flag is changed to “1”.

次に、受け取った復号命令とハンドル値「1」と暗号エントリデバイスドライバ159自身の有するデバイスID_Cとをデータ格納部に含む応答通知を通常OS151へ出力することにより、復号命令を音楽復号デーモン156へ出力する。
次に、システムコールにより音楽復号デーモン156から休眠要求を受け取る。次に、通常OS151へ休眠要求を出力する。このとき、休眠要求のデータ格納部には、システムコールに含んで受け取ったハンドル値「1」とデバイスID_Cとが格納されている。
Next, a response notification including the received decryption instruction, the handle value “1”, and the device ID_C of the encryption entry device driver 159 itself in the data storage unit is output to the normal OS 151, whereby the decryption instruction is sent to the music decryption daemon 156. Output.
Next, a sleep request is received from the music decryption daemon 156 by a system call. Next, a sleep request is output to the normal OS 151. At this time, the handle value “1” and the device ID_C received in the system call are stored in the data storage unit of the sleep request.

次に、通常OSにより休眠を解除される。休眠を解除され、応答通知により割込通知を音楽復号デーモン156へ出力する。
次に、通常OS151を介して、音楽復号デーモン156から処理結果を受け取る。処理結果を受け取ると、排他制御を解除して、排他フラグを「0」に戻す。応答通知により、受け取った処理結果を音楽復号デーモン156へ出力する。
Next, the sleep is canceled by the normal OS. The sleep is canceled and an interrupt notification is output to the music decryption daemon 156 by a response notification.
Next, the processing result is received from the music decryption daemon 156 via the normal OS 151. When the processing result is received, the exclusive control is canceled and the exclusive flag is returned to “0”. In response to the notification, the received processing result is output to the music decryption daemon 156.

暗号デバイスドライバ179は、セキュア処理要求により、セキュアOS171を介して、音楽復号デーモン156から復号処理命令受け取り、暗号処理デバイス117へ復号を依頼する。次に、暗号デバイスドライバ179自身の有するデバイスID_Cと、復号処理命令と共に受け取ったハンドル値「1」と休眠要求をデータ格納部に格納した外部処理要求をセキュアOS171へ出力する。   The cryptographic device driver 179 receives a decryption processing command from the music decryption daemon 156 via the secure OS 171 in response to a secure processing request, and requests the cryptographic processing device 117 to perform decryption. Next, the device ID_C possessed by the cryptographic device driver 179 itself, the handle value “1” received together with the decryption processing instruction, and the external processing request storing the sleep request in the data storage unit are output to the secure OS 171.

次に、セキュアOS171へのセキュア処理要求により、音楽復号デーモン156から割込通知を受け取り、暗号処理デバイス117から、処理結果としてバッファ123上の書き込み先アドレスを受け取る。受け取った処理結果とハンドル値「1」とデバイスID_Cとデータ格納部に含む外部処理要求をセキュアOS171へ出力することにより、処理結果を音楽復号デーモン156へ出力する。   Next, in response to a secure processing request to the secure OS 171, an interrupt notification is received from the music decryption daemon 156, and a write destination address on the buffer 123 is received from the cryptographic processing device 117 as a processing result. By outputting the received processing result, the handle value “1”, the device ID_C, and the external processing request included in the data storage unit to the secure OS 171, the processing result is output to the music decryption daemon 156.

<通常切替デバイスドライバ160及びセキュア切替デバイスドライバ180>
通常OS151又はセキュアOSから切替指示を受け、通常切替デバイスドライバ160及びセキュア切替デバイスドライバ180は、切替制御部106へ切替指示を出力し、CPU102の使用権を通常OS151からセキュアOS171へ、又は、セキュアOS171から通常OS151へ移すプログラムである。
<Normal switching device driver 160 and secure switching device driver 180>
Upon receiving the switching instruction from the normal OS 151 or the secure OS, the normal switching device driver 160 and the secure switching device driver 180 output the switching instruction to the switching control unit 106, and the right to use the CPU 102 is transferred from the normal OS 151 to the secure OS 171 or securely. This is a program for moving from the OS 171 to the normal OS 151.

(a)切替処理1
以下に、図13を用いて、通常OS151からセキュアOS171への切替処理について説明する。なお、これは、図10のステップS1028及び図16以降のフローチャートの切替処理1の詳細である。
通常切替デバイスドライバ160は、通常OS151から呼び出され、切替指示を受け取る(ステップS162)。切替指示を受け取ると、通常OS151のコンテキストを通常メモリ111上に退避する(ステップS163)。次に、切替制御部106へ切替指示を出力する(ステップS164)。
(A) Switching process 1
Hereinafter, switching processing from the normal OS 151 to the secure OS 171 will be described with reference to FIG. This is the details of step S1028 in FIG. 10 and the switching process 1 in the flowcharts in FIG.
The normal switching device driver 160 is called from the normal OS 151 and receives a switching instruction (step S162). When the switching instruction is received, the context of the normal OS 151 is saved on the normal memory 111 (step S163). Next, a switching instruction is output to the switching control unit 106 (step S164).

切替制御部106は、CPU102及びMMU103をクリアした後、メモリ保護部114へ接続指示を出力し、セキュアメモリ113とバス130とを接続する(ステップS166)。次に、切替制御部106は、セキュアメモリ113上のセキュア切替デバイスドライバ180を呼び出す(ステップS167)。
セキュア切替デバイスドライバ180は、呼び出されると、セキュアOS171のコンテキストをCPU102に復帰させる(ステップS168)。
After clearing the CPU 102 and the MMU 103, the switching control unit 106 outputs a connection instruction to the memory protection unit 114, and connects the secure memory 113 and the bus 130 (step S166). Next, the switching control unit 106 calls the secure switching device driver 180 on the secure memory 113 (step S167).
When called, the secure switching device driver 180 returns the context of the secure OS 171 to the CPU 102 (step S168).

セキュアOS171は、デバッグ無効化プログラム173により、デバッガIF101を無効化する(ステップS169)。
(b)切替処理2
以下に、図14のフローチャートを用いて、セキュアOS171から通常OS151への切替処理について説明する。なお、これは、図11のステップS1062及び図16以降のフローチャートの切替処理2の詳細を示している。
The secure OS 171 invalidates the debugger IF 101 by the debug invalidation program 173 (step S169).
(B) Switching process 2
Hereinafter, switching processing from the secure OS 171 to the normal OS 151 will be described using the flowchart of FIG. This shows details of step S1062 in FIG. 11 and switching processing 2 in the flowcharts in FIG.

セキュアOS171は、デバッグ無効化プログラム173により、デバッガIF101を有効にし(ステップS176)、セキュア切替デバイスドライバ180を呼び出し、切替指示を出力する(ステップS177)。
セキュア切替デバイスドライバ180はセキュアOS171のコンテキストを退避し(ステップS178)、切替制御部106へ切替指示を出力する。
The secure OS 171 enables the debugger IF 101 by the debug invalidation program 173 (step S176), calls the secure switching device driver 180, and outputs a switching instruction (step S177).
The secure switching device driver 180 saves the context of the secure OS 171 (step S178) and outputs a switching instruction to the switching control unit 106.

切替制御部106は、切替指示を受け取り、CPU102及びMMU103をクリアした後、メモリ保護部114へ切断指示を出力し、セキュアメモリ113とバス130とを切断する(ステップS181)。次に、通常メモリ111上の通常切替デバイスドライバ160を呼び出す(ステップS182)。
通常切替デバイスドライバ160は通常OS151のコンテキストをCPU102へ復帰させる(ステップS183)。
The switching control unit 106 receives the switching instruction, clears the CPU 102 and the MMU 103, outputs a disconnection instruction to the memory protection unit 114, and disconnects the secure memory 113 and the bus 130 (step S181). Next, the normal switching device driver 160 on the normal memory 111 is called (step S182).
The normal switching device driver 160 restores the context of the normal OS 151 to the CPU 102 (step S183).

なお、ここでは、セキュアOS171から通常OS151へ切り替える際に、デバッガIF101を有効にしているが、有効にしなくても良い。この場合、携帯電話100に電源を入れて、最初に、通常OS151からセキュアOS171へ切り替える際に、デバッグ無効化プログラム173により、デバッガIF101を無効にし、その後は、セキュアOS171から通常OS151への切替処理においても、通常OS151からセキュアOS171への切替処理においても、デバッグガIF101を無効のままにしておく。   Although the debugger IF 101 is enabled here when switching from the secure OS 171 to the normal OS 151, it may not be enabled. In this case, when the mobile phone 100 is turned on and first switched from the normal OS 151 to the secure OS 171, the debugger invalidation program 173 disables the debugger IF 101 and then switches from the secure OS 171 to the normal OS 151. Even in the switching process from the normal OS 151 to the secure OS 171, the debug module IF 101 is left invalid.

また、本実施の形態では、セキュアOS171が有するデバッグ無効化プログラム173によって、デバッガIF101を無効化及び有効化しているが、通常OS151がデバッグ無効化プログラムを含んでいても良い。また、デバッグ無効化プログラムは、通常メモリ111上にをロードされ、通常OS151に管理される独立したプログラムであってもよい。   In the present embodiment, the debugger IF 101 is invalidated and validated by the debug invalidation program 173 included in the secure OS 171. However, the normal OS 151 may include a debug invalidation program. The debug invalidation program may be an independent program loaded on the normal memory 111 and managed by the normal OS 151.

また、通常OS151及びセキュアOS171が、それぞれ、デバッグ無効化プログラムを有しているとしても良い。この場合、通常OS151の有するデバッグ無効化プログラムが、デバッガIF101を無効化し、セキュアOS171の有するデバッグ無効化プログラムがデバッガIFを有効化する。また、逆に、セキュアOS171の有するデバッグ無効化プログラムが、デバッガIF101を無効化し、通常OS151の有するデバッグ無効化プログラムがデバッガIFを有効化してもよい。   Further, the normal OS 151 and the secure OS 171 may each have a debug invalidation program. In this case, the debug invalidation program of the normal OS 151 invalidates the debugger IF 101, and the debug invalidation program of the secure OS 171 validates the debugger IF. Conversely, the debug invalidation program that the secure OS 171 has may invalidate the debugger IF 101, and the debug invalidation program that the normal OS 151 has may validate the debugger IF.

また、これらのデバッグ無効化プログラムは、それぞれ、独立したプログラムとして、通常メモリ111及びセキュアメモリ113にロードされていても良い。
<通常割込ハンドラ161及びセキュア割込ハンドラ181>
通常割込ハンドラ161は、通常OS151及び通常OS151により制御されるプログラムの実行中に、割込が発生した場合に、通常OS151に呼び出される。通常OS151から呼び出され、割込発生通知を受け取ると、割込コントローラ107を制御し、割込を発生させている要因を調査する。次に、割込を発生させているデバイスを示す識別情報と割込通知とを通常OS151へ出力する。
These debug invalidation programs may be loaded into the normal memory 111 and the secure memory 113 as independent programs.
<Normal interrupt handler 161 and secure interrupt handler 181>
The normal interrupt handler 161 is called by the normal OS 151 when an interrupt occurs during execution of the normal OS 151 and the program controlled by the normal OS 151. When called from the normal OS 151 and receiving an interrupt occurrence notification, the interrupt controller 107 is controlled to investigate the factor causing the interrupt. Next, identification information indicating the device causing the interrupt and an interrupt notification are output to the normal OS 151.

セキュア割込ハンドラ181は、セキュアOS171及びセキュアOS171により制御されるプログラムの実行中に、割込が発生した場合に、セキュアOS171に呼び出される。セキュアOS171から呼び出され、割込発生通知を受け取ると、CPU102の割込検出用のレジスタへダミーデータを書き込むことによって、割込マスク処理を施し、セキュアOS171へ割込発生通知を出力する。   The secure interrupt handler 181 is called by the secure OS 171 when an interrupt occurs during execution of the secure OS 171 and the program controlled by the secure OS 171. When called from the secure OS 171 and receiving an interrupt occurrence notification, the dummy mask is written into the interrupt detection register of the CPU 102 to perform an interrupt mask process and output an interrupt occurrence notification to the secure OS 171.

(3)入出力部116
入出力部116は、図8に示すようにアクセス部131、通常入出力デバイス132及びセキュア入出力デバイス133から構成される。
アクセス部131は、メモリカード300と接続され、メモリカード300と通常入出力デバイス132及びセキュア入出力デバイス133との間で、情報の入出力を行う。
(3) Input / output unit 116
The input / output unit 116 includes an access unit 131, a normal input / output device 132, and a secure input / output device 133 as shown in FIG.
The access unit 131 is connected to the memory card 300 and inputs / outputs information between the memory card 300 and the normal input / output device 132 and the secure input / output device 133.

通常入出力デバイス132は、通常入出力デバイスドライバ157の制御により、メモリカード300の一般領域303へのデータの読み出し及び書き込みを行う。一例として、引数として楽曲IDを受け取り、読出要求を受けると、受け取った楽曲IDと対応する暗号化音楽データを一般領域303から読み出し、読み出した暗号化音楽データを共有メモリ112へ書き込む。   The normal input / output device 132 reads and writes data to the general area 303 of the memory card 300 under the control of the normal input / output device driver 157. As an example, when a music ID is received as an argument and a read request is received, the encrypted music data corresponding to the received music ID is read from the general area 303 and the read encrypted music data is written to the shared memory 112.

書き込み終了後に、通常入出力デバイスドライバ157から結果要求を受け取ると、処理結果として、暗号化音楽データを書き込んだ、共有メモリ112上のアドレスを出力する。
セキュア入出力デバイス133は、セキュア入出力デバイスドライバ178の制御により、メモリカード300のセキュア処理部302との間で、CPRMの仕組みに基づいて相互認証を行う。相互認証が成功であった場合に限り、鍵を共有し、共有した鍵を用いて、安全に、セキュア領域306へのデータの書き込み及び読み出しを行う。
When the result request is received from the normal input / output device driver 157 after the writing is completed, the address on the shared memory 112 where the encrypted music data is written is output as the processing result.
The secure input / output device 133 performs mutual authentication with the secure processing unit 302 of the memory card 300 based on the CPRM mechanism under the control of the secure input / output device driver 178. Only when mutual authentication is successful, the key is shared, and the shared key is used to safely write and read data to and from the secure area 306.

また、認証に失敗した場合は、メモリカード300にアクセスできないことを示すカードエラー通知をセキュア入出力デバイスドライバ178へ出力する。
ここで、セキュア入出力デバイス133は、メモリカード300のセキュア領域306にアクセスする場合にのみ使用されるデバイスであり、メモリカード300のセキュア領域306にアクセスするプログラムは、限定されている。従って、複数のアプリケーションから同時に処理を依頼されることはありえないため、排他制御を行う必要がない。
If authentication fails, a card error notification indicating that the memory card 300 cannot be accessed is output to the secure input / output device driver 178.
Here, the secure input / output device 133 is a device that is used only when accessing the secure area 306 of the memory card 300, and the program for accessing the secure area 306 of the memory card 300 is limited. Therefore, it is not possible to request processing from a plurality of applications at the same time, so there is no need to perform exclusive control.

(4)暗号処理デバイス117
暗号処理デバイス117は、暗号デバイスドライバ179の制御により、各種データの暗号処理を行う。本実施の形態では、暗号デバイスドライバ179から、暗号化音楽データの記憶されている共有メモリ112上のアドレスと、コンテンツ鍵が記憶されているセキュアメモリ113上のアドレスとを受け取り、暗号化音楽データの復号を指示される。コンテンツ鍵を用いて、暗号化音楽データに復号アルゴリズムD1を施して、音楽データを生成し、生成した音楽データをバッファ123へ書き込む。書き込み先のアドレスを、処理結果として暗号デバイスドライバ179へ出力する。復号アルゴリズムD1は、暗号化アルゴリズムE1によって生成された暗号文を復号するものである。
(4) Cryptographic processing device 117
The cryptographic processing device 117 performs cryptographic processing of various data under the control of the cryptographic device driver 179. In the present embodiment, the encrypted device driver 179 receives the address on the shared memory 112 where the encrypted music data is stored and the address on the secure memory 113 where the content key is stored. Is decrypted. Using the content key, the decrypted algorithm D1 is applied to the encrypted music data to generate music data, and the generated music data is written into the buffer 123. The write destination address is output to the cryptographic device driver 179 as the processing result. The decryption algorithm D1 is for decrypting the ciphertext generated by the encryption algorithm E1.

ここで、暗号処理デバイス117は、各種の暗号化されたデータを復号するデバイスであり、コンテンツ配信サーバから送信される暗号化コンテンツなどの復号も行う。従って、暗号処理デバイス117は、複数の異なるプログラムから復号処理を依頼される可能性があり、排他制御が必要である。
(5)CPU102
CPU102は、命令フェッチ部、命令デコーダ、演算器、プログラムカウンタ、レジスタなどを備え、通常メモリ111又はセキュアメモリ113上のプログラムから命令をフェッチし、フェッチした命令を解読し、解読した命令を実行する。
Here, the cryptographic processing device 117 is a device that decrypts various encrypted data, and also decrypts encrypted content transmitted from the content distribution server. Therefore, the cryptographic processing device 117 may be requested to perform decryption processing from a plurality of different programs, and requires exclusive control.
(5) CPU102
The CPU 102 includes an instruction fetch unit, an instruction decoder, an arithmetic unit, a program counter, a register, and the like, fetches an instruction from a program on the normal memory 111 or the secure memory 113, decodes the fetched instruction, and executes the decoded instruction .

(6)MMU103
MMU103は、論理アドレスを物理アドレスに変換することにより仮想記憶機能を実現する。
(7)デバッガIF101及び割込コントローラ107
デバッガIF101は、携帯電話100と外部のデバッガとを接続するためのインターフェースである。
(6) MMU103
The MMU 103 realizes a virtual storage function by converting a logical address into a physical address.
(7) Debugger IF 101 and interrupt controller 107
The debugger IF 101 is an interface for connecting the mobile phone 100 and an external debugger.

割込コントローラ107は、各種の割込を検出し、CPU102の割込検出用のレジスタへ割込発生通知を出力する。
(8)切替制御部106及びメモリ保護部114
切替制御部106は、通常メモリ111上の通常切替デバイスドライバ160又は、セキュアメモリ113上のセキュア切替デバイスドライバ180から切替指示を受け取り、メモリ保護部114により、バス130とセキュアメモリ113を接続又は切断する。切替制御部106及びメモリ保護部114の詳細な動作は、上記の(a)切替処理1及び(b)切替処理2において説明した通りである。
The interrupt controller 107 detects various interrupts and outputs an interrupt generation notification to the interrupt detection register of the CPU 102.
(8) Switching control unit 106 and memory protection unit 114
The switching control unit 106 receives a switching instruction from the normal switching device driver 160 on the normal memory 111 or the secure switching device driver 180 on the secure memory 113, and connects or disconnects the bus 130 and the secure memory 113 by the memory protection unit 114. To do. Detailed operations of the switching control unit 106 and the memory protection unit 114 are as described in the above (a) switching process 1 and (b) switching process 2.

(9)無線通信制御部118、通信部121及びアンテナ122
通信部121は、無線通信制御部118と、携帯電話網10、インターネット20に接続された外部機器との間で、アンテナ122を介して情報の送受信を行う。
無線通信制御部118は、ベースバンド部、変復調部、増幅器などを備えており、通信部121及びアンテナ122を介して送受信される各種の情報の信号処理を行う。
(9) Wireless communication control unit 118, communication unit 121, and antenna 122
The communication unit 121 transmits and receives information between the wireless communication control unit 118 and an external device connected to the mobile phone network 10 and the Internet 20 via the antenna 122.
The wireless communication control unit 118 includes a baseband unit, a modulation / demodulation unit, an amplifier, and the like, and performs signal processing of various types of information transmitted and received via the communication unit 121 and the antenna 122.

(10)バッファ123、符号処理部124、D/A変換部126
バッファ123は、音楽データを一時的に記憶する。
符号処理部124は、バッファ123に記憶されている音楽データにMP3などの符号化技術に従った復号処理を施し、D/A変換部126へ出力する。
D/A変換部126は、符号処理部124により復号された音楽データをアナログ音声信号に変換し、スピーカ120へ出力する。
(10) Buffer 123, code processor 124, D / A converter 126
The buffer 123 temporarily stores music data.
The code processing unit 124 performs a decoding process on the music data stored in the buffer 123 according to an encoding technique such as MP3 and outputs the result to the D / A conversion unit 126.
The D / A conversion unit 126 converts the music data decoded by the code processing unit 124 into an analog audio signal and outputs the analog audio signal to the speaker 120.

(11)入力部108、表示部109、マイク119スピーカ120
入力部108は、テンキー、決定ボタンなどの各種のボタンを備え、利用者によるこれらの操作を受け付ける。
表示部109は、VRAM、液晶画面を備え、各種の画面を表示する。
マイク119は、音声を検出し、検出した音声を無線通信制御部118へ出力する。
(11) Input unit 108, display unit 109, microphone 119 speaker 120
The input unit 108 includes various buttons such as a numeric keypad and an enter button, and accepts these operations by the user.
The display unit 109 includes a VRAM and a liquid crystal screen, and displays various screens.
The microphone 119 detects sound and outputs the detected sound to the wireless communication control unit 118.

スピーカ120は、無線通信制御部118及びD/A変換部126から、アナログ音声信号を受け取り、受け取った音声信号に基づく音声を出力する。
1.3 携帯電話100及びメモリカード300の動作
図15〜図35に示すフローチャートは、携帯電話100の動作を示すフローチャートである。図36〜図40は、携帯電話100の動作における各プログラム間のコマンドの授受を示したシーケンス図である。これらのフローチャート及びシーケンス図を用いて、携帯電話100の動作について説明する。
The speaker 120 receives an analog audio signal from the wireless communication control unit 118 and the D / A conversion unit 126, and outputs audio based on the received audio signal.
1.3 Operations of Mobile Phone 100 and Memory Card 300 The flowcharts shown in FIGS. 15 to 35 are flowcharts showing the operation of the mobile phone 100. 36 to 40 are sequence diagrams showing exchange of commands between the programs in the operation of the mobile phone 100. FIG. The operation of the mobile phone 100 will be described using these flowcharts and sequence diagrams.

なお、シーケンス図とフローチャートの対応する処理には、同一のステップ番号を付している。また、通常OS151及びセキュアOS171についての説明で述べたように、通常メモリ111及びセキュアメモリ113上の各プログラムは、システムコール、応答通知、外部処理要求、セキュア処理要求によって、他のプログラムへのコマンド及びデータの仲介を通常OS151及びセキュアOS171へ依頼している。図15〜図40及び以下の説明においては、システムコール、応答通知、外部処理要求、セキュア処理要求の記載を省略し、各プログラムが、これらのコマンドのデータ格納部に格納して出力する識別情報、データ及びコマンドをのみを記載している。   In addition, the same step number is attached | subjected to the corresponding process of a sequence diagram and a flowchart. In addition, as described in the description of the normal OS 151 and the secure OS 171, each program on the normal memory 111 and the secure memory 113 can execute commands to other programs by system calls, response notifications, external processing requests, and secure processing requests. In addition, the normal OS 151 and the secure OS 171 are requested to mediate data. In FIG. 15 to FIG. 40 and the following description, description of system calls, response notifications, external processing requests, and secure processing requests is omitted, and identification information that each program stores and outputs in the data storage unit of these commands Only the data and commands are listed.

(1)携帯電話100の動作
携帯電話100の動作について、図15に示すフローチャートを用いて説明する。
携帯電話100は、入力部108により利用者によるボタン操作を受け付ける(ステップS101)。受付た操作が、音楽再生を示している場合、音楽再生プログラム153を起動する(ステップS102)。受け付けたボタン操作がその他の処理を示している場合、その他の処理を行う(ステップS103)。
(1) Operation of Mobile Phone 100 The operation of the mobile phone 100 will be described using the flowchart shown in FIG.
The cellular phone 100 receives a button operation by the user through the input unit 108 (step S101). When the received operation indicates music reproduction, the music reproduction program 153 is activated (step S102). If the received button operation indicates other processing, other processing is performed (step S103).

次に、音楽復号プログラムの登録処理を行う(ステップS104)。次に、音楽復号プログラム176へ復号処理を依頼する(ステップS106)。音楽復号プログラム176による復号が終了すると、生成された音楽データをMP3に従った方法で伸張し、アナログデータに変換してアナログ音楽データを生成し、生成したアナログ音楽データをスピーカ120により出力する(ステップS107)。入力部108により、音楽再生の終了を示すボタン操作を受け付けるまで(ステップS108)、ステップS106〜108を繰り返す。   Next, a music decryption program registration process is performed (step S104). Next, the music decoding program 176 is requested to perform a decoding process (step S106). When the decoding by the music decoding program 176 is completed, the generated music data is expanded by a method according to MP3, converted into analog data to generate analog music data, and the generated analog music data is output from the speaker 120 ( Step S107). Steps S106 to S108 are repeated until a button operation indicating the end of music playback is received by the input unit 108 (step S108).

音楽再生の終了を示すボタン操作を受け付けると(ステップS108のYES)、音楽復号プログラムの削除処理を行う(ステップS109)。
(2)音楽復号プログラムの登録
図16〜17は、音楽復号プログラムの登録処理における、各プログラムの動作を詳細に示すフローチャートである。これは、図36におけるステップS132〜ステップS153のシーケンスと対応している。図16〜17に示すフローチャート及び図36のシーケンス図を用いて、音楽復号プログラムの登録処理について説明する。
When a button operation indicating the end of music playback is received (YES in step S108), a music decryption program deletion process is performed (step S109).
(2) Music Decoding Program Registration FIGS. 16 to 17 are flowcharts showing in detail the operation of each program in the music decoding program registration process. This corresponds to the sequence of steps S132 to S153 in FIG. The music decoding program registration process will be described with reference to the flowcharts shown in FIGS. 16 to 17 and the sequence diagram of FIG.

音楽再生プログラム153は、予め、コーディングされているデーモン情報とセキュアアプリ情報とを読み出す(ステップS131)。セキュアアプリ登録要求と、読み出したデーモン情報及びセキュアアプリ情報とを通常OS151へ出力する(ステップS132)。
通常OS151は、セキュアアプリ登録要求を受け取ると、音楽再生プログラム153のコンテキストを保存し、保存先のアドレスをアプリ管理表のエントリ167のアプリコンテキストアドレスに書き込む(ステップS133)。次に、受け取ったセキュアアプリ情報と対応する暗号化音楽復号プログラム141を二次記憶部104から読み出し、共有メモリ112へ書き込む(ステップS134)。次に、セキュアアプリ登録要求を共有メモリ112のコマンド領域へ書き込み(ステップS136)、切替処理1に移る(ステップS137)。
The music playback program 153 reads out the pre-coded daemon information and secure application information (step S131). The secure application registration request and the read daemon information and secure application information are output to the normal OS 151 (step S132).
When the normal OS 151 receives the secure application registration request, the normal OS 151 stores the context of the music playback program 153 and writes the storage destination address to the application context address of the entry 167 of the application management table (step S133). Next, the encrypted music decryption program 141 corresponding to the received secure application information is read from the secondary storage unit 104 and written to the shared memory 112 (step S134). Next, the secure application registration request is written in the command area of the shared memory 112 (step S136), and the process proceeds to the switching process 1 (step S137).

切替処理1が終了すると、セキュアOS171は共有メモリ112からセキュアアプリ登録要求を読み込む(ステップS138)。次に、暗復号プログラムにより、共有メモリ112上の暗号化音楽復号プログラムを復号して音楽復号プログラムを生成し、生成した音楽復号プログラムをセキュアメモリ113上に書き込む(ステップS139)。音楽復号プログラムに対して、ハンドル値「1」を設定し、セキュアアプリ管理表186のエントリ187のハンドル値に「1」を書き込み、セキュアアプリアドレスに音楽復号プログラム176を書き込んだセキュアメモリ113上のアドレスを書き込む(ステップS141)。   When the switching process 1 ends, the secure OS 171 reads a secure application registration request from the shared memory 112 (step S138). Next, the encrypted music decryption program on the shared memory 112 is decrypted by the encryption / decryption program to generate a music decryption program, and the generated music decryption program is written on the secure memory 113 (step S139). A handle value “1” is set for the music decryption program, “1” is written in the handle value of the entry 187 of the secure application management table 186, and the music decryption program 176 is written in the secure application address. The address is written (step S141).

次に、登録完了通知とハンドル値「1」とを共有メモリ112に書き込み(ステップS143)、切替処理2(ステップS144)へ処理を移す。
通常OS151は、共有メモリ112から登録完了通知とハンドル値「1」とを読み出す(ステップS146)。読み出したハンドル値「1」を、アプリ管理表166のエントリ167に書き込む(ステップS147)。デーモン情報を基に二次記憶部104から、音楽復号デーモン142を読み出し、通常メモリ111上に書き込む(ステップS149)。通常メモリ111上の音楽復号デーモン156の書き込み先アドレスをアプリ管理表166のエントリ167へ書き込む(ステップS151)。
Next, the registration completion notification and the handle value “1” are written in the shared memory 112 (step S143), and the process proceeds to the switching process 2 (step S144).
The normal OS 151 reads the registration completion notification and the handle value “1” from the shared memory 112 (step S146). The read handle value “1” is written to the entry 167 of the application management table 166 (step S147). Based on the daemon information, the music decryption daemon 142 is read from the secondary storage unit 104 and written to the normal memory 111 (step S149). The write destination address of the music decryption daemon 156 on the normal memory 111 is written to the entry 167 of the application management table 166 (step S151).

次に、エントリ167のアプリコンテキストアドレスを基に、音楽再生プログラム153のコンテキストをCPU102に復帰させ(ステップS152)、受け取ったハンドル値「1」を、音楽再生プログラム153へ出力する(ステップS153)。
音楽再生プログラム153は、受け取ったハンドル値「1」を、通常メモリ111における音楽再生プログラム153自身の記憶領域に書き込む(ステップS154)。
Next, based on the application context address of the entry 167, the context of the music playback program 153 is returned to the CPU 102 (step S152), and the received handle value “1” is output to the music playback program 153 (step S153).
The music playback program 153 writes the received handle value “1” in the storage area of the music playback program 153 itself in the normal memory 111 (step S154).

(3)音楽復号プログラムへの処理依頼
図18〜27のフローチャートは、音楽再生プログラム153の依頼により、音楽復号プログラム176が暗号化音楽データを復号する際の各プログラムの動作を示している。これは、図36のステップS193〜図42のステップS347と対応している。
音楽再生プログラム153は、曲目リストなどを含む選択画面を表示し、利用者の楽曲選択を受け付ける(ステップS191)。受け付けた楽曲を示す楽曲IDとハンドル値「1」を読み出す(ステップS192)。読み出した楽曲IDを引数として、引数とハンドル値「1」と復号処理命令とを通常OS151へ出力する(ステップS193)。
(3) Processing Request to Music Decryption Program The flowcharts of FIGS. 18 to 27 show the operation of each program when the music decryption program 176 decrypts the encrypted music data in response to a request from the music playback program 153. This corresponds to step S193 in FIG. 36 to step S347 in FIG.
The music playback program 153 displays a selection screen including a music list and accepts the user's music selection (step S191). The music ID indicating the received music and the handle value “1” are read (step S192). Using the read music ID as an argument, the argument, the handle value “1”, and the decryption processing instruction are output to the normal OS 151 (step S193).

通常OS151は、音楽再生プログラム153のコンテキストを通常メモリ111上に保存し(ステップS196)、保存先のアドレスをアプリ管理表166のハンドル値「1」を含むエントリ167に書き込む(ステップS197)。次に、受け取った引数とハンドル値「1」と復号処理命令とを共有メモリ112に書き込み(ステップS198)、切替処理1を行う(ステップS199)。   The normal OS 151 stores the context of the music playback program 153 in the normal memory 111 (step S196), and writes the storage destination address in the entry 167 including the handle value “1” in the application management table 166 (step S197). Next, the received argument, handle value “1”, and decryption processing instruction are written in the shared memory 112 (step S198), and switching processing 1 is performed (step S199).

セキュアOS171は、切替処理1が終了すると(ステップS199)、共有メモリ112から引数とハンドル値「1」と復号処理命令とを読み出す(ステップS201)。セキュアアプリ管理表186上で、読み出したハンドル値「1」を含むエントリ187のセキュアアプリアドレスを基に、音楽復号プログラム176を起動し(ステップS202)、読み出した引数とハンドル値「1」と復号処理命令とを音楽復号プログラム176へ出力する(ステップS203)。   When the switching process 1 ends (step S199), the secure OS 171 reads the argument, the handle value “1”, and the decryption process instruction from the shared memory 112 (step S201). On the secure application management table 186, the music decryption program 176 is started based on the secure application address of the entry 187 including the read handle value “1” (step S202), and the read argument and handle value “1” are decrypted. The processing instruction is output to the music decoding program 176 (step S203).

音楽復号プログラム176は、セキュアOS171から引数と復号処理命令とを受け取り、受け取った引数(楽曲ID)を記憶する。次に、CPU102は、音楽復号プログラム176(データ読み出しステップ)を実行する(ステップS204)。音楽復号プログラム176は、楽曲IDを読み出し(ステップS206)、読み出した楽曲IDを引数として、データ読出命令と引数とハンドル値「1」をセキュアOS171へ出力する(ステップS208)。   The music decryption program 176 receives the argument and the decryption processing instruction from the secure OS 171 and stores the received argument (music ID). Next, the CPU 102 executes the music decryption program 176 (data reading step) (step S204). The music decryption program 176 reads the music ID (step S206), and outputs the data read command, the argument, and the handle value “1” to the secure OS 171 using the read music ID as an argument (step S208).

セキュアOS171は、音楽復号プログラム176からデータ読出命令と引数とハンドル値「1」とを受け取り、音楽復号プログラム176のコンテキストをセキュアメモリ113上に保存し、保存先のアドレスをセキュアアプリ管理表186のエントリ187に書き込む(ステップS209)。次に、共有メモリ112に受け取ったデータ読出命令と引数とハンドル値「1」とを書き込み(ステップS211)、切替処理2に移る(ステップS216)。   The secure OS 171 receives the data read command, the argument, and the handle value “1” from the music decryption program 176, stores the context of the music decryption program 176 on the secure memory 113, and stores the storage destination address in the secure application management table 186. Write to the entry 187 (step S209). Next, the received data read command, argument, and handle value “1” are written to the shared memory 112 (step S211), and the process proceeds to the switching process 2 (step S216).

切替処理2が終了すると(ステップS216)、通常OS151は、共有メモリ112からデータ読出命令と引数とハンドル値「1」とを読み出す(ステップS217)。アプリ管理表166のハンドル値「1」を含むエントリ167を選択し、選択したエントリ167に含まれるデーモンアドレスにより、音楽復号デーモン156を起動する(ステップS218)。読み出したデータ読出命令と引数とハンドル値「1」とを音楽復号デーモン156へ出力する(ステップS219)。   When the switching process 2 ends (step S216), the normal OS 151 reads the data read command, the argument, and the handle value “1” from the shared memory 112 (step S217). The entry 167 including the handle value “1” in the application management table 166 is selected, and the music decryption daemon 156 is activated with the daemon address included in the selected entry 167 (step S218). The read data read command, argument, and handle value “1” are output to the music decryption daemon 156 (step S219).

音楽復号デーモン156は、データ読出命令と引数とハンドル値「1」とを受け取る。データ読出命令を受け取ると、ライブラリ152に格納されているアクセス関数を呼び出し、引数とハンドル値「1」とを出力する(ステップS221)。音楽復号デーモン156に呼び出されたアクセス関数は、読出要求と引数とデバイスID_Aと受け取ったハンドル値「1」とを通常OS151へ、出力する(ステップS222)。通常OS151は、受け取ったデバイスID_Aと対応する通常入出力デバイスドライバ157へ、読出要求と引数とデバイスID_Aとハンドル値「1」とを出力する(ステップS223)。   The music decryption daemon 156 receives the data read command, the argument, and the handle value “1”. When the data read command is received, the access function stored in the library 152 is called, and the argument and the handle value “1” are output (step S221). The access function called by the music decryption daemon 156 outputs the read request, the argument, the device ID_A, and the received handle value “1” to the normal OS 151 (step S222). The normal OS 151 outputs the read request, the argument, the device ID_A, and the handle value “1” to the normal input / output device driver 157 corresponding to the received device ID_A (step S223).

通常入出力デバイスドライバ157は、読出要求、引数及びハンドル値「1」を受け取る。次に、排他フラグが「0」であるか否かを判断する(ステップS224)。排他フラグが「1」であれば(ステップS224のNO)、通常入出力デバイスドライバ157は、通常入出力デバイス132が、動作中であり、新たな読出要求を受け付けることができないことを示すエラー通知を出力する。   The normal input / output device driver 157 receives the read request, the argument, and the handle value “1”. Next, it is determined whether or not the exclusive flag is “0” (step S224). If the exclusive flag is “1” (NO in step S224), the normal input / output device driver 157 notifies the error that the normal input / output device 132 is operating and cannot accept a new read request. Is output.

通常OS151及びアクセス関数を介して、音楽復号デーモン156は、エラー通知を受け取り、一定時間経過後に、再度、読出要求を出力する。また、受け取ったエラー通知を通常OS151、セキュアOS171を介して音楽復号プログラム176へ出力し、復号の処理を中止するとしても良い。
排他フラグが「0」であると判断すると(ステップS224のYES)、排他フラグを「1」に変更し(ステップS227)、受け取った引数を通常入出力デバイス132へ出力し、データの読み出しを指示する(ステップS231)。
The music decryption daemon 156 receives the error notification via the normal OS 151 and the access function, and outputs a read request again after a predetermined time has elapsed. Alternatively, the received error notification may be output to the music decryption program 176 via the normal OS 151 and the secure OS 171 to stop the decryption process.
If it is determined that the exclusion flag is “0” (YES in step S224), the exclusion flag is changed to “1” (step S227), the received argument is output to the normal input / output device 132, and data read is instructed. (Step S231).

通常入出力デバイス132は、引数(楽曲ID)と読出要求とを受け取り、メモリカード300の一般領域303から、受け取った楽曲IDと対応する暗号化音楽データ304の読み出し及び読み出した暗号化音楽データ304の共有メモリ112への書き込みを開始する(ステップS236)。
通常入出力デバイスドライバ157は、通常入出力デバイス132へ読出要求を出力すると(ステップS231)、通常OS151へ、通常入出力デバイスドライバ157自身の有するデバイスID_A及び受け取ったハンドル値「1」を含む休眠要求を出力する(ステップS232)。
The normal input / output device 132 receives an argument (music ID) and a read request, reads out the encrypted music data 304 corresponding to the received music ID from the general area 303 of the memory card 300, and reads out the read encrypted music data 304. Is started to be written to the shared memory 112 (step S236).
When the normal input / output device driver 157 outputs a read request to the normal input / output device 132 (step S231), the normal input / output device driver 157 sleeps including the device ID_A of the normal input / output device driver 157 itself and the received handle value “1” to the normal OS 151. A request is output (step S232).

通常OS151は、休眠要求を受け取ると、ハンドル値「1」と対応する音楽復号デーモン156とデバイスID_Aと対応する通常入出力デバイスドライバ157とを休眠状態にする(ステップS233、ステップS234)。次に、タスクスケジューリングにより、実行可能状態の他のプログラムへCPU102を割り当てる(ステップS238)。
通常入出力デバイス132における処理が終了すると、割込が発生し、音楽復号デーモン156は、処理結果を取得する(ステップS239)。ステップS239における、割込発生時の処理1につては、後で説明する。また、ステップS239の処理は、図37のステップS463〜478のシーケンスと対応している。
Upon receiving the sleep request, the normal OS 151 puts the music decryption daemon 156 corresponding to the handle value “1” and the normal input / output device driver 157 corresponding to the device ID_A into a sleep state (steps S233 and S234). Next, the CPU 102 is assigned to another program in an executable state by task scheduling (step S238).
When the processing in the normal input / output device 132 ends, an interrupt occurs, and the music decryption daemon 156 acquires the processing result (step S239). Processing 1 at the time of occurrence of an interrupt in step S239 will be described later. Further, the processing in step S239 corresponds to the sequence in steps S463 to 478 in FIG.

割込発生時の処理1(ステップS239)において、音楽復号デーモン156は、通常入出力デバイス132による処理結果として、暗号化音楽データの共有メモリ112上の書込先アドレスを取得する。取得した処理結果とハンドル値「1」を通常OS151へ出力する(ステップS241)。通常OS151は受け取った処理結果とハンドル値「1」とを共有メモリ112へ書き込み(ステップS242)、切替処理1を行う(ステップS244)。   In process 1 (step S239) when an interrupt occurs, the music decryption daemon 156 acquires the write destination address of the encrypted music data on the shared memory 112 as the processing result of the normal input / output device 132. The acquired processing result and the handle value “1” are output to the normal OS 151 (step S241). The normal OS 151 writes the received processing result and the handle value “1” into the shared memory 112 (step S242), and performs the switching process 1 (step S244).

切替処理1(ステップS244)が終了すると、セキュアOS171は、共有メモリ112からハンドル値「1」と処理結果とを読み出す(ステップS251)。セキュアアプリ管理表186から、読み出したハンドル値「1」を含むエントリ187を選択し、エントリ187のセキュアアプリコンテキストアドレスにより音楽復号プログラム176のコンテキストをCPU102に復帰させる(ステップS252)。次に、読み出した処理結果とハンドル値「1」とを音楽復号プログラム176へ出力する(ステップS254)。   When the switching process 1 (step S244) ends, the secure OS 171 reads the handle value “1” and the processing result from the shared memory 112 (step S251). The entry 187 including the read handle value “1” is selected from the secure application management table 186, and the context of the music decryption program 176 is returned to the CPU 102 by the secure application context address of the entry 187 (step S252). Next, the read processing result and the handle value “1” are output to the music decoding program 176 (step S254).

音楽復号プログラム176は、処理結果として暗号化音楽データの書込先アドレスを受け取り、受け取った書込先アドレスを自身の記憶領域に記憶する。
次に、CPU102は、音楽復号プログラム176(コンテンツ鍵読出ステップ)を実行する(ステップS256)。音楽復号プログラム176は、コンテンツ鍵読出命令とデバイスID_Bと音楽復号プログラム176自身を示すハンドル値「1」とを含むシステムコールをセキュアOS171へ出力する(ステップS257)。
The music decryption program 176 receives the write destination address of the encrypted music data as a processing result, and stores the received write destination address in its own storage area.
Next, the CPU 102 executes the music decryption program 176 (content key reading step) (step S256). The music decryption program 176 outputs a system call including the content key read command, the device ID_B, and the handle value “1” indicating the music decryption program 176 itself to the secure OS 171 (step S257).

セキュアOS171は、コンテンツ鍵読出命令とデバイスID_Bとハンドル値「1」とを受け取り、受け取ったデバイスID_Bと対応するセキュア入出力デバイスドライバ178へ、受け取ったコンテンツ鍵読出命令とデバイスID_Bとハンドル値「1」とを出力する(ステップS258)。
セキュア入出力デバイスドライバ178は、コンテンツ鍵読出命令とデバイスID_Bとハンドル値「1」とを受け取り、セキュア入出力デバイス133へ、コンテンツ鍵読出命令を出力する(ステップS259)。
The secure OS 171 receives the content key read command, the device ID_B, and the handle value “1”, and sends the received content key read command, the device ID_B, and the handle value “1” to the secure input / output device driver 178 corresponding to the received device ID_B. Is output (step S258).
The secure input / output device driver 178 receives the content key read command, the device ID_B, and the handle value “1”, and outputs the content key read command to the secure input / output device 133 (step S259).

セキュア入出力デバイス133は、コンテンツ鍵読出命令を受け取り、次に、メモリカード300のセキュア処理部302との間で相互認証を行う(ステップS262)。認証に成功すると(ステップS263のYES)、コンテンツ鍵の取得を開始する(ステップS266)。
認証が失敗であった場合、カードエラー通知を出力し、前記コンテンツ鍵の取得を中止する(ステップS264)。この場合、音楽復号デーモン156及び音楽復号プログラム176は、復号処理を中止し、音楽再生プログラム153は、メモリカード300が読み取り不可であることを通知する画面を表示する。
The secure input / output device 133 receives the content key read command, and then performs mutual authentication with the secure processing unit 302 of the memory card 300 (step S262). If the authentication is successful (YES in step S263), acquisition of the content key is started (step S266).
If the authentication is unsuccessful, a card error notification is output and the acquisition of the content key is stopped (step S264). In this case, the music decryption daemon 156 and the music decryption program 176 stop the decryption process, and the music playback program 153 displays a screen for notifying that the memory card 300 cannot be read.

セキュア入出力デバイスドライバ178は、次に、セキュアOS171へ休眠要求と、受け取ったハンドル値「1」と、セキュア入出力デバイスドライバ178自身を示すデバイスID_Bとを出力する(ステップS271)。なお、ここで出力される休眠要求は、セキュアOS171へ休眠処理を要求するものではなく、外部処理要求のデータ格納部に格納され、音楽復号デーモン156へ仲介されるコマンドである。   Next, the secure input / output device driver 178 outputs a sleep request, the received handle value “1”, and the device ID_B indicating the secure input / output device driver 178 itself to the secure OS 171 (step S271). The sleep request output here is not a request for sleep processing to the secure OS 171 but is a command stored in the data storage unit of the external processing request and mediated to the music decryption daemon 156.

セキュアOS171は、セキュア入出力デバイスドライバ178から、休眠要求とハンドル値「1」とデバイスID_Bとを受け取り、共有メモリ112へ、受け取った休眠要求とハンドル値「1」とデバイスID_Bとを書き込む(ステップS272)。次に、切替処理2に移る(ステップS273)。
切替処理が終了すると(ステップS273)、通常OS151は、共有メモリ112から、休眠要求とハンドル値「1」とデバイスID_Bとを読み出す(ステップS274)。読み出したハンドル値「1」を含むエントリ168を基に音楽復号デーモン156を起動し(ステップS276)、読み出した休眠要求とデバイスID_Bとハンドル値「1」とを出力する(ステップS277)。
The secure OS 171 receives the sleep request, the handle value “1”, and the device ID_B from the secure input / output device driver 178, and writes the received sleep request, the handle value “1”, and the device ID_B to the shared memory 112 (Step S1). S272). Next, the process proceeds to the switching process 2 (step S273).
When the switching process ends (step S273), the normal OS 151 reads the sleep request, the handle value “1”, and the device ID_B from the shared memory 112 (step S274). The music decryption daemon 156 is activated based on the entry 168 including the read handle value “1” (step S276), and the read sleep request, device ID_B, and handle value “1” are output (step S277).

音楽復号デーモン156は、通常OS151から休眠要求とデバイスID_Bとハンドル値「1」とを受け取る。休眠要求とを受け取ると、通常OS151へ休眠要求とデバイスID_Bとハンドル値「1」とを含むシステムコールを出力する(ステップS278)。
セキュアOS171は、受け取ったデバイスID_Bと対応するセキュア入出力エントリデバイスドライバ158へ、受け取った休眠要求とデバイスID_Bとハンドル値「1」とを出力する(ステップS281)。
The music decryption daemon 156 receives the sleep request, the device ID_B, and the handle value “1” from the normal OS 151. When the sleep request is received, a system call including the sleep request, the device ID_B, and the handle value “1” is output to the normal OS 151 (step S278).
The secure OS 171 outputs the received sleep request, device ID_B, and handle value “1” to the secure input / output entry device driver 158 corresponding to the received device ID_B (step S281).

セキュア入出力エントリデバイスドライバ158は、通常OS151を介して音楽復号デーモン156から休眠要求を受け取ると、デバイスID_Bとハンドル値「1」とを含む休眠要求を通常OS151へ出力する(ステップS282)。
通常OS151は、休眠要求とデバイスID_Bとハンドル値「1」とを受け取る。休眠要求を受け取ると、受け取ったデバイスID_Bと対応するセキュア入出力エントリデバイスドライバ158と、受け取ったハンドル値「1」と対応する音楽復号デーモン156とに休眠処理を行う(ステップS283、ステップS284)。
When the secure input / output entry device driver 158 receives the sleep request from the music decryption daemon 156 via the normal OS 151, the secure input / output entry device driver 158 outputs a sleep request including the device ID_B and the handle value “1” to the normal OS 151 (step S282).
The normal OS 151 receives the sleep request, the device ID_B, and the handle value “1”. When the sleep request is received, the secure input / output entry device driver 158 corresponding to the received device ID_B and the music decryption daemon 156 corresponding to the received handle value “1” are subjected to sleep processing (steps S283 and S284).

次に、通常OS151は、タスクスケジューリングを行い、実行可能状態の他のプログラムにCPUを割り当てる(ステップS286)。
セキュア入出力デバイス133によるコンテンツ鍵の取得が終了し、割込発生時の処理2(ステップS287)により、音楽復号プログラム176は、処理結果を取得する。ステップS287の割込発生時の処理2については、後で説明する。また、ステップS287における処理は、図38のステップS512〜図39のステップS541に対応している。
Next, the normal OS 151 performs task scheduling and assigns a CPU to another program in an executable state (step S286).
The acquisition of the content key by the secure input / output device 133 is completed, and the music decryption program 176 acquires the processing result by processing 2 (step S287) when an interrupt occurs. Processing 2 at the time of occurrence of an interrupt in step S287 will be described later. The processing in step S287 corresponds to step S512 in FIG. 38 to step S541 in FIG.

ステップS287において、音楽復号プログラム176は、処理結果として、コンテンツ鍵が記憶されているセキュアメモリ113上のアドレスを取得する。次に、CPU102は、音楽復号プログラム176(復号ステップ)を実行する(ステップS291)。音楽復号プログラム176は、セキュアメモリ113上のコンテンツ鍵の記憶されているアドレスと共有メモリ112上の暗号化音楽データの記憶されているアドレスとを引数として、復号命令と引数とハンドル値「1」とをセキュアOS171へ出力する(ステップS292)。   In step S287, the music decryption program 176 obtains an address on the secure memory 113 where the content key is stored as a processing result. Next, the CPU 102 executes the music decoding program 176 (decoding step) (step S291). The music decryption program 176 uses the decryption instruction, the argument, and the handle value “1”, with the address of the content key stored in the secure memory 113 and the address of the encrypted music data stored in the shared memory 112 as arguments. Are output to the secure OS 171 (step S292).

セキュアOS171は、音楽復号プログラム176から復号命令と引数とハンドル値「1」を受け取る。次に、受け取った復号命令と引数とハンドル値「1」とを共有メモリ112へ書き込み(ステップS293)、切替処理2を行う(ステップS294)。
切替処理2が終了すると(ステップS294)、通常OS151は、共有メモリ112から復号命令、引数及びハンドル値「1」を読み出す(ステップS296)。読み出したハンドル値「1」とアプリ管理表166とを用いて、音楽復号デーモン156を起動し、音楽復号デーモン156へ読み出した復号命令と引数とハンドル値「1」とを出力する(ステップS297)。
The secure OS 171 receives a decryption command, an argument, and a handle value “1” from the music decryption program 176. Next, the received decryption instruction, argument, and handle value “1” are written to the shared memory 112 (step S293), and a switching process 2 is performed (step S294).
When the switching process 2 ends (step S294), the normal OS 151 reads the decryption command, the argument, and the handle value “1” from the shared memory 112 (step S296). Using the read handle value “1” and the application management table 166, the music decryption daemon 156 is activated, and the decryption instruction, the argument, and the handle value “1” are output to the music decryption daemon 156 (step S297). .

音楽復号デーモン156は、通常OS151から復号命令と引数とハンドル値「1」とを受け取る。復号命令を受け取ると、受け取った復号命令及び引数と、デバイスID_C、ハンドル値「1」を通常OS151へ出力する(ステップS298)。
通常OS151は、音楽復号デーモン156から復号命令、引数、デバイスID_C及びハンドル値「1」を受け取り、受け取ったデバイスID_Cと対応する暗号エントリデバイスドライバ159へ、受け取った復号命令、引数、デバイスID_C及びハンドル値「1」を出力する(ステップS301)。
The music decryption daemon 156 receives a decryption command, an argument, and a handle value “1” from the normal OS 151. When the decryption command is received, the received decryption command and argument, device ID_C, and handle value “1” are output to the normal OS 151 (step S298).
The normal OS 151 receives a decryption command, an argument, a device ID_C, and a handle value “1” from the music decryption daemon 156, and sends the received decryption command, argument, device ID_C, and handle to the encryption entry device driver 159 corresponding to the received device ID_C. The value “1” is output (step S301).

暗号エントリデバイスドライバ159は、通常OS151を介して音楽復号デーモン156から引数と復号命令とデバイスID_Cとハンドル値「1」とを受け取る。復号命令を受け取ったとき、排他フラグが「1」であれば(ステップS303のNO)、暗号処理デバイス117が、既に動作中であり、新たな処理の依頼を受け付けられないことを示すエラー通知を出力する(ステップS304)。このとき、エラー通知を受け取った音楽復号デーモン156は、一定時間経過後に再度、復号命令を出力する。   The cryptographic entry device driver 159 receives an argument, a decryption command, a device ID_C, and a handle value “1” from the music decryption daemon 156 via the normal OS 151. When the decryption instruction is received, if the exclusion flag is “1” (NO in step S303), an error notification indicating that the cryptographic processing device 117 is already operating and cannot accept a new processing request is issued. Output (step S304). At this time, the music decryption daemon 156 that has received the error notification again outputs a decryption command after a predetermined time has elapsed.

排他フラグが「0」であれば(ステップS303のYES)、排他フラグを「1」に変更し(ステップS306)、受け取った引数と復号命令とハンドル値「1」及びデバイスID_Cを通常OS151へ出力する(ステップS307)
通常OSは、受け取ったハンドル値「1」と対応する音楽復号デーモン156を呼び出し、受け取った復号命令と引数とハンドル値「1」とデバイスID_Cとを出力する(ステップS308)。
If the exclusion flag is “0” (YES in step S303), the exclusion flag is changed to “1” (step S306), and the received argument, decryption instruction, handle value “1”, and device ID_C are output to the normal OS 151. (Step S307)
The normal OS calls the music decryption daemon 156 corresponding to the received handle value “1”, and outputs the received decryption command, argument, handle value “1”, and device ID_C (step S308).

音楽復号デーモン156は、通常OS151を介して、暗号エントリデバイスドライバ159から復号命令と引数とハンドル値「1」とデバイスID_Cとを受け取る。次に、受け取った復号命令と引数とデバイスID_Cとハンドル値「1」を通常OS151へ出力する(ステップS309)。
通常OS151は、音楽復号デーモン156から、復号命令と引数とデバイスID_Cとハンドル値「1」を受け取り、共有メモリ112へ、受け取った復号命令と引数とデバイスID_Cとハンドル値「1」とを書き込み(ステップS312)、切替処理2を行う(ステップS313)。
The music decryption daemon 156 receives the decryption command, the argument, the handle value “1”, and the device ID_C from the encryption entry device driver 159 via the normal OS 151. Next, the received decryption command, argument, device ID_C, and handle value “1” are output to the normal OS 151 (step S309).
The normal OS 151 receives the decryption command, argument, device ID_C, and handle value “1” from the music decryption daemon 156, and writes the received decryption command, argument, device ID_C, and handle value “1” to the shared memory 112 ( Step S312) and switching process 2 are performed (step S313).

切替処理2が終了すると(ステップS313)、セキュアOS171は、共有メモリ112から復号命令と引数とデバイスID_Cとハンドル値「1」とを読み出す(ステップS314)。読み出したデバイスID_Cを基に、暗号デバイスドライバ179を起動し(ステップS315)、読み出した復号命令、引数、ハンドル値「1」を暗号デバイスドライバ179へ出力する(ステップS316)。   When the switching process 2 ends (step S313), the secure OS 171 reads the decryption command, the argument, the device ID_C, and the handle value “1” from the shared memory 112 (step S314). Based on the read device ID_C, the cryptographic device driver 179 is activated (step S315), and the read decryption command, argument, and handle value “1” are output to the cryptographic device driver 179 (step S316).

暗号デバイスドライバ179は、セキュアOS171から復号命令と引数とデバイスID_Cとハンドル値「1」とを受け取り、暗号処理デバイス117へ受け取った引数を出力し復号を命令する(ステップS317)。
暗号処理デバイス117は、暗号デバイスドライバ179から復号を命令されると、セキュアメモリ113からコンテンツ鍵を読み出し、読み出したコンテンツ鍵を用いて、共有メモリ112上の暗号化音楽データに復号アルゴリズムD1を施して音楽データを生成し、生成した音楽データをバッファ123へ出力する(ステップS318)。
The cryptographic device driver 179 receives the decryption command, the argument, the device ID_C, and the handle value “1” from the secure OS 171, outputs the received argument to the cryptographic processing device 117, and instructs decryption (step S 317).
When the encryption processing device 117 is instructed to decrypt by the encryption device driver 179, the encryption processing device 117 reads the content key from the secure memory 113, and applies the decryption algorithm D1 to the encrypted music data on the shared memory 112 using the read content key. The music data is generated, and the generated music data is output to the buffer 123 (step S318).

暗号デバイスドライバ179は、暗号処理デバイス117へ復号を命令した後、休眠要求と、セキュアOS171から受け取ったハンドル値「1」と、暗号デバイスドライバ179自身を示すデバイスID_Cを、セキュアOS171へ出力する(ステップS321)。なお、ここで出力される休眠要求は、セキュアOS171へ休眠処理を要求するものではなく、外部処理要求のデータ格納部に格納され、音楽復号デーモン156へ仲介されるコマンドである。   The cryptographic device driver 179 instructs the cryptographic processing device 117 to decrypt, and then outputs a sleep request, the handle value “1” received from the secure OS 171, and the device ID_C indicating the cryptographic device driver 179 itself to the secure OS 171 ( Step S321). The sleep request output here is not a request for sleep processing to the secure OS 171 but is a command stored in the data storage unit of the external processing request and mediated to the music decryption daemon 156.

セキュアOS171は、暗号デバイスドライバ179から休眠要求とハンドル値「1」とデバイスID_Cを受け取り、受け取った休眠要求とハンドル値「1」とデバイスID_Cとを共有メモリ112へ書き込む(ステップS322)。次に、切替処理2を行う(ステップS323)。
切替処理2が終了すると(ステップS323)、通常OS151は、共有メモリ112からハンドル値「1」、デバイスID_C及び休眠要求を読み出す(ステップS326)。読み出したハンドル値「1」とアプリ管理表166とを基に音楽復号デーモン156を起動し、読み出した休眠要求とハンドル値「1」とデバイスID_Cとを、音楽復号デーモン156へ出力する(ステップS327)。
The secure OS 171 receives the sleep request, handle value “1”, and device ID_C from the cryptographic device driver 179, and writes the received sleep request, handle value “1”, and device ID_C to the shared memory 112 (step S322). Next, the switching process 2 is performed (step S323).
When the switching process 2 ends (step S323), the normal OS 151 reads the handle value “1”, the device ID_C, and the sleep request from the shared memory 112 (step S326). The music decryption daemon 156 is activated based on the read handle value “1” and the application management table 166, and the read sleep request, the handle value “1”, and the device ID_C are output to the music decryption daemon 156 (step S327). ).

音楽復号デーモン156は、通常OS151から休眠要求とハンドル値「1」とデバイスID_Cとを受け取る。受け取った休眠要求とデバイスID_Cと音楽復号デーモン156自身を示すハンドル値「1」とを通常OS151へ出力する(ステップS328)。通常OS151は、受け取ったデバイスID_Cと対応する暗号エントリデバイスドライバ159へ、受け取った休眠要求とデバイスID_Cとハンドル値「1」とを出力する(ステップS329)。   The music decryption daemon 156 receives the sleep request, the handle value “1”, and the device ID_C from the normal OS 151. The received sleep request, device ID_C, and handle value “1” indicating the music decryption daemon 156 itself are output to the normal OS 151 (step S328). The normal OS 151 outputs the received sleep request, device ID_C, and handle value “1” to the encryption entry device driver 159 corresponding to the received device ID_C (step S329).

暗号エントリデバイスドライバ159は、通常OS151を介して、音楽復号デーモン156から休眠要求とデバイスID_Cとハンドル値「1」とを受け取る。次に、通常OS151へ、休眠処理と受け取ったハンドル値「1」と暗号エントリデバイスドライバ159自身の有するデバイスID_Cを出力する(ステップS332)。
通常OS151は、暗号エントリデバイスドライバ159から、休眠要求とハンドル値「1」とデバイスID_Cを受け取り、受け取ったハンドル値「1」と対応する音楽復号デーモン156を休眠状態にする(ステップS333)。次に、受け取ったデバイスID_Cと対応する暗号エントリデバイスドライバ159を休眠状態にする(ステップS334)。次に、タスクスケジューリングを行い、実行可能状態のプログラムにCPUを割り当てる(ステップS336)。
The cryptographic entry device driver 159 receives the sleep request, device ID_C, and handle value “1” from the music decryption daemon 156 via the normal OS 151. Next, the sleep process, the received handle value “1”, and the device ID_C of the encryption entry device driver 159 itself are output to the normal OS 151 (step S332).
The normal OS 151 receives the sleep request, the handle value “1”, and the device ID_C from the encryption entry device driver 159, and puts the music decryption daemon 156 corresponding to the received handle value “1” into the sleep state (step S333). Next, the encryption entry device driver 159 corresponding to the received device ID_C is put into a sleep state (step S334). Next, task scheduling is performed and a CPU is assigned to a program in an executable state (step S336).

暗号処理デバイス117による、復号処理が終了し、割込発生時の処理3において、音楽復号プログラム176は、暗号処理デバイス117による処理結果を受け取る(ステップS337)。ステップS337については、後で説明する。なお、ステップS337は、図37のステップS552〜図38のステップS606に該当する。
音楽復号プログラム176は、暗号処理デバイス117による処理結果として、音楽データのバッファ123上の書込先アドレスを取得する。次に、CPU102は、音楽復号プログラム176(音楽データ出力ステップ)を実行する(ステップS338)。音楽復号プログラム176は、音楽データの書込先アドレスを処理結果として、処理結果とアプリ復帰要求とハンドル値「1」とをセキュアOS171へ出力する(ステップS339)。
When the decryption process by the cryptographic processing device 117 is completed and the interrupt 3 is generated, the music decryption program 176 receives the processing result by the cryptographic processing device 117 (step S337). Step S337 will be described later. Note that step S337 corresponds to step S552 in FIG. 37 to step S606 in FIG.
The music decryption program 176 acquires the write destination address on the music data buffer 123 as a processing result by the cryptographic processing device 117. Next, the CPU 102 executes the music decryption program 176 (music data output step) (step S338). The music decryption program 176 outputs the processing result, the application return request, and the handle value “1” to the secure OS 171 using the write destination address of the music data as the processing result (step S339).

セキュアOS171は、アプリ復帰要求と処理結果とハンドル値「1」とを受け取り、受け取ったアプリ復帰要求と処理結果とハンドル値「1」とを共有メモリ112へ書き込む(ステップS341)。次に、切替処理2を行う(ステップS342)。
切替処理2が終了すると(ステップS342)、通常OS151は、共有メモリ112から、アプリ復帰要求と処理結果とハンドル値「1」とを読み出す(ステップS344)。アプリ管理表166のハンドル値「1」を含むエントリ167を基に音楽復号プログラム176のコンテキスト復帰させる(ステップS346)。次に、読み出した処理結果を音楽復号プログラム176へ出力する(ステップS347)。
The secure OS 171 receives the application return request, the processing result, and the handle value “1”, and writes the received application return request, the processing result, and the handle value “1” in the shared memory 112 (step S341). Next, the switching process 2 is performed (step S342).
When the switching process 2 ends (step S342), the normal OS 151 reads the application return request, the processing result, and the handle value “1” from the shared memory 112 (step S344). Based on the entry 167 including the handle value “1” in the application management table 166, the context of the music decryption program 176 is returned (step S346). Next, the read processing result is output to the music decoding program 176 (step S347).

(4)割込発生時の処理1
図28に示すフローチャートを用いて、割込発生時の処理1について説明する。これは、図21のステップS239の詳細である。また、図37のステップS463〜478のシーケンスに対応している。
通常入出力デバイス132は、暗号化音楽データの読み出しが終了すると(ステップS462)、割り込みを発生させる(ステップS463)。
(4) Processing 1 when an interrupt occurs
Processing 1 when an interrupt occurs will be described using the flowchart shown in FIG. This is the detail of step S239 in FIG. Also, this corresponds to the sequence of steps S463 to 478 in FIG.
When the reading of the encrypted music data is completed (step S462), the normal input / output device 132 generates an interrupt (step S463).

割込コントローラ107は、割込の発生を検出し、通常OS151へ割込発生通知を出力する(ステップS464)。通常OS151は、割込発生通知を受け取り、割込テーブルを基に通常割込ハンドラ161を起動する(ステップS466)。次に、通常割込ハンドラ161へ割込発生通知を出力する(ステップS467)。
通常割込ハンドラ161は、割込コントローラ107を制御し、割込の要因を調査する(ステップS468)。次に、割込を発生させている通常入出力デバイスと対応するデバイスID_Aと割込通知とを通常OS151へ出力する(ステップS469)。
The interrupt controller 107 detects the occurrence of an interrupt and outputs an interrupt occurrence notification to the normal OS 151 (step S464). The normal OS 151 receives the interrupt occurrence notification and activates the normal interrupt handler 161 based on the interrupt table (step S466). Next, an interrupt generation notification is output to the normal interrupt handler 161 (step S467).
The normal interrupt handler 161 controls the interrupt controller 107 and investigates the cause of the interrupt (step S468). Next, the device ID_A corresponding to the normal input / output device generating the interrupt and the interrupt notification are output to the normal OS 151 (step S469).

通常OS151は、通常割込ハンドラ161から、割込通知とデバイスID_Aとを受け取る。受け取ったデバイスID_Aと対応する通常入出力デバイスドライバ157及び、通常入出力デバイスドライバ157と共に休眠処理を施した音楽復号デーモン156とを休眠解除し(ステップS471、ステップS472)、CPU102を通常入出力デバイスドライバ157へ割り当てる。   The normal OS 151 receives an interrupt notification and device ID_A from the normal interrupt handler 161. The normal input / output device driver 157 corresponding to the received device ID_A and the music decoding daemon 156 that has performed the sleep processing together with the normal input / output device driver 157 are released from sleep (step S471, step S472), and the CPU 102 is set to the normal input / output device. Assign to the driver 157.

通常入出力デバイスドライバ157は、休眠を解除され、通常入出力デバイス132へ結果要求を出力し(ステップS473)、通常入出力デバイス132から、処理結果として、共有メモリ112上における暗号化音楽データの書込先アドレスを取得する(ステップS474)。処理結果を取得すると、排他フラグを「0」に設定し(ステップS476)、取得した処理結果と、読出要求の出力元を示す識別情報として受け取ったハンドル値「1」と、通常入出力デバイスドライバ157自身を示すデバイスID_Aとを通常OS151へ出力し(ステップS477)、通常OS151は、ハンドル値「1」と対応する音楽復号デーモン156へ、受け取った処理結果とハンドル値「1」とデバイスID_Aとを出力する(ステップS478)。   The normal input / output device driver 157 is released from sleep and outputs a result request to the normal input / output device 132 (step S473). As a processing result from the normal input / output device 132, the encrypted music data on the shared memory 112 is output. A write destination address is acquired (step S474). When the processing result is acquired, the exclusive flag is set to “0” (step S476), the acquired processing result, the handle value “1” received as the identification information indicating the output source of the read request, and the normal input / output device driver 157 itself is output to the normal OS 151 (step S477), and the normal OS 151 sends the received processing result, the handle value “1”, the device ID_A, and the music decoding daemon 156 corresponding to the handle value “1”. Is output (step S478).

(5)割込発生時の処理1−2
上記の割込発生時の処理1は、通常OS151又は通常OS151に管理される通常メモリ111上のプログラムの実行中に割込が発生した場合の動作を示している。ここでは、図29のフローチャートを用いて、セキュアOS171又はセキュアOS171によって管理されているプログラムの実行中に割込が発生した場合の動作について説明する。
(5) Processing when an interrupt occurs 1-2
The above processing 1 when an interrupt occurs indicates an operation when an interrupt occurs during execution of the normal OS 151 or a program on the normal memory 111 managed by the normal OS 151. Here, the operation when an interrupt occurs during execution of the secure OS 171 or a program managed by the secure OS 171 will be described using the flowchart of FIG.

通常入出力デバイス132は、暗号化音楽データの読み出しが終了すると(ステップS491)、割込を発生させる(ステップS492)。
割込コントローラ107は、割込を検出し、セキュアOS171へ割込発生通知を出力する(ステップS493)。
セキュアOS171は、割込コントローラ107から割込発生通知を受け取る。割込発生通知を受け取ると、セキュア割込ハンドラ181を起動し(ステップS494)、割込発生通知を出力する(ステップS496)。
When the reading of the encrypted music data is completed (step S491), the normal input / output device 132 generates an interrupt (step S492).
The interrupt controller 107 detects an interrupt and outputs an interrupt occurrence notification to the secure OS 171 (step S493).
The secure OS 171 receives an interrupt occurrence notification from the interrupt controller 107. When the interrupt occurrence notification is received, the secure interrupt handler 181 is activated (step S494), and the interrupt occurrence notification is output (step S496).

セキュア割込ハンドラ181は、割込発生通知を受け取り、CPU102へ割込マスク処理を行い(ステップS497)、セキュアOS171へ割込発生通知を出力する(ステップS498)。
セキュアOS171は、セキュア割込ハンドラ181から、割込発生通知を受け取り、受け取った割込発生通知を共有メモリ112へ書き込む(ステップS499)。次に、セキュアOS171と通常OS151は、切替処理2を行う(ステップS501)。
The secure interrupt handler 181 receives the interrupt occurrence notification, performs an interrupt mask process to the CPU 102 (step S497), and outputs an interrupt occurrence notification to the secure OS 171 (step S498).
The secure OS 171 receives the interrupt occurrence notification from the secure interrupt handler 181 and writes the received interrupt occurrence notification to the shared memory 112 (step S499). Next, the secure OS 171 and the normal OS 151 perform the switching process 2 (step S501).

切替処理2が終了すると(ステップS501)、共有メモリ112から割込発生通知を読み出し、CPUの割込マスクを解除する(ステップS502)。
ここで、割込コントローラ107は、クリアされていないので、割込発生通知を出力し続けており、ステップS502以降の処理は、図28のステップS464以降の処理と同様である。
When the switching process 2 is completed (step S501), the interrupt occurrence notification is read from the shared memory 112, and the CPU interrupt mask is released (step S502).
Here, since the interrupt controller 107 has not been cleared, it continues to output the interrupt occurrence notification, and the processing after step S502 is the same as the processing after step S464 in FIG.

(6)割込発生時の処理2
以下に、図30〜31のフローチャートを用いて、割込発生時の処理2について説明する。これは、図23のステップS287の詳細である。また、これは、図38のステップS512〜図39のステップS541のシーケンスと対応している。
セキュア入出力デバイス133は、コンテンツ鍵の読み出しが終了すると(ステップS511)、割り込みを発生させる(ステップS512)。
(6) Processing 2 when an interrupt occurs
Below, the process 2 at the time of interruption generation | occurrence | production is demonstrated using the flowchart of FIGS. This is a detail of step S287 in FIG. This corresponds to the sequence from step S512 in FIG. 38 to step S541 in FIG.
When the secure input / output device 133 finishes reading the content key (step S511), the secure input / output device 133 generates an interrupt (step S512).

割込コントローラ107は、割込の発生を検出し、通常OS151へ割込発生通知を出力する(ステップS513)。
通常OS151は、割込コントローラ107から、割込発生通知を受け取り、通常割込ハンドラ161を起動する(ステップS514)。次に、通常割込ハンドラ161へ割込発生通知を出力する(ステップS516)。
The interrupt controller 107 detects the occurrence of an interrupt and outputs an interrupt occurrence notification to the normal OS 151 (step S513).
The normal OS 151 receives an interrupt occurrence notification from the interrupt controller 107 and activates the normal interrupt handler 161 (step S514). Next, an interrupt generation notification is output to the normal interrupt handler 161 (step S516).

通常割込ハンドラ161は、割込発生通知を受け取り、割り込みを発生させている要因を調査する(ステップS517)。セキュア入出力デバイス133が割り込みを発生させていることを検出し、セキュア入出力デバイス133と対応するデバイスID_Bと割込通知とを、通常OS151へ出力する(ステップS518)。
通常OS151は、通常割込ハンドラ161から割込通知とデバイスID_Bとを受け取る。次に受け取ったデバイスID_Bと対応するセキュア入出力エントリデバイスドライバ158と、セキュア入出力エントリデバイスドライバ158と共に休眠処理を施した音楽復号デーモン156の休眠を解除する(ステップS519、ステップS521)。セキュア入出力エントリデバイスドライバ158へCPU102を割り当てる。
The normal interrupt handler 161 receives the interrupt occurrence notification and investigates the factor causing the interrupt (step S517). It detects that the secure input / output device 133 has generated an interrupt, and outputs a device ID_B corresponding to the secure input / output device 133 and an interrupt notification to the normal OS 151 (step S518).
The normal OS 151 receives an interrupt notification and a device ID_B from the normal interrupt handler 161. Next, the sleep of the secure input / output entry device driver 158 corresponding to the received device ID_B and the music decryption daemon 156 that has performed the sleep processing together with the secure input / output entry device driver 158 is released (steps S519 and S521). The CPU 102 is assigned to the secure input / output entry device driver 158.

セキュア入出力エントリデバイスドライバ158は、休眠を解除され、割込通知と、休眠要求の出力元を示す識別情報として受け取ったハンドル値「1」と、セキュア入出力エントリデバイスドライバ158自身の有するデバイスID_Bとを通常OS151へ出力する(ステップS523)。
通常OS151は、受け取ったハンドル値「1」と対応する音楽復号デーモン156へ、受け取った割込通知とハンドル値「1」とデバイスID_Bとを出力する(ステップS524)。
The secure input / output entry device driver 158 is released from sleep, receives the interrupt notification, the handle value “1” received as identification information indicating the output source of the sleep request, and the device ID_B possessed by the secure input / output entry device driver 158 itself. Are output to the normal OS 151 (step S523).
The normal OS 151 outputs the received interrupt notification, the handle value “1”, and the device ID_B to the music decryption daemon 156 corresponding to the received handle value “1” (step S524).

音楽復号デーモン156は、割込通知とハンドル値「1」とデバイスID_Bとを受け取る。受け取った割込通知とデバイスID_Bと、音楽復号デーモン156自身を示すハンドル値「1」とを通常OS151へ出力する(ステップS527)。
通常OS151は、音楽復号デーモン156から割込通知とデバイスID_Bとハンドル値「1」とを受け取る。受け取った割込通知とデバイスID_Bとハンドル値「1」とを、共有メモリ112へ書き込み(ステップS529)、切替処理1に移る(ステップS531)。
The music decryption daemon 156 receives the interrupt notification, the handle value “1”, and the device ID_B. The received interrupt notification, device ID_B, and handle value “1” indicating the music decryption daemon 156 itself are output to the normal OS 151 (step S527).
The normal OS 151 receives an interrupt notification, device ID_B, and handle value “1” from the music decryption daemon 156. The received interrupt notification, device ID_B, and handle value “1” are written to the shared memory 112 (step S529), and the process proceeds to the switching process 1 (step S531).

切替処理1が終了すると、セキュアOS171は共有メモリ112から、割込通知とデバイスID_Bとハンドル値「1」とを読み出し(ステップS532)、読み出したデバイスID_Bを基にセキュア入出力デバイスドライバ178を起動する(ステップS533)。次に、セキュア入出力デバイスドライバ178へ、読み出した割込通知とデバイスID_Bとハンドル値「1」とを出力する(ステップS534)。   When the switching process 1 ends, the secure OS 171 reads the interrupt notification, the device ID_B, and the handle value “1” from the shared memory 112 (step S532), and starts the secure input / output device driver 178 based on the read device ID_B. (Step S533). Next, the read interrupt notification, device ID_B, and handle value “1” are output to the secure input / output device driver 178 (step S534).

セキュア入出力デバイスドライバ178は、割込通知とデバイスID_Bとハンドル値「1」とを受け取り、セキュア入出力デバイス133へ処理結果を要求する(ステップS536)。セキュア入出力デバイス133から、処理結果として、セキュアメモリ113上のコンテンツ鍵格納アドレスを受け取る(ステップS537)。受け取った処理結果とハンドル値「1」とデバイスID_Bとを含む応答通知をセキュアOS171へ出力する(ステップS539)。   The secure input / output device driver 178 receives the interrupt notification, the device ID_B, and the handle value “1”, and requests the secure input / output device 133 for the processing result (step S536). The content key storage address on the secure memory 113 is received as a processing result from the secure input / output device 133 (step S537). A response notification including the received processing result, handle value “1”, and device ID_B is output to the secure OS 171 (step S539).

セキュアOS171は、受け取ったハンドル値「1」と対応する音楽復号プログラム176へ、受け取った処理結果とハンドル値「1」とデバイスID_Bとを出力する(ステップS541)。
ここまで、図30〜31を用いた説明では、通常OS151又は通常OS151によって管理される通常メモリ111上のプログラムの実行中における、割込発生時の動作について説明してきたが、セキュアOS171及びセキュアOS171によって管理されるプログラムの実行中における割込発生時の動作は、上述した割込発生時の処理1−2とほぼ同様であり、図26中の通常入出力デバイスを、セキュア入出力デバイスに変更すればよい。ステップS502以降の処理は、図30のステップS513へと続く。
The secure OS 171 outputs the received processing result, the handle value “1”, and the device ID_B to the music decryption program 176 corresponding to the received handle value “1” (step S541).
So far, in the description using FIGS. 30 to 31, the operation at the time of occurrence of an interrupt during execution of the normal OS 151 or the program on the normal memory 111 managed by the normal OS 151 has been described. However, the secure OS 171 and the secure OS 171 are described. The operation at the time of occurrence of an interrupt during execution of the program managed by the program is almost the same as the above-described process 1-2 at the time of occurrence of the interrupt, and the normal input / output device in FIG. 26 is changed to a secure input / output device. do it. The processing after step S502 continues to step S513 in FIG.

(7)割込発生時の処理3
以下に、図32〜34のフローチャートを用いて、割込発生時の処理3について説明する。これは、図27のステップS337の詳細である。また、割込発生時の処理3は、図40のステップS552〜図41のステップS606のシーケンスと対応している。
暗号処理デバイス117は、暗号化音楽データの復号が終了すると、割り込みを発生させる(ステップS552)。
(7) Processing 3 when an interrupt occurs
Below, the process 3 at the time of interruption generation | occurrence | production is demonstrated using the flowchart of FIGS. This is the detail of step S337 in FIG. Further, the process 3 at the time of occurrence of an interrupt corresponds to the sequence from step S552 in FIG. 40 to step S606 in FIG.
When the decryption of the encrypted music data ends, the cryptographic processing device 117 generates an interrupt (step S552).

割込コントローラ107は、割込の発生を検出し、通常OS151へ割込発生通知を出力する(ステップS553)。
通常OS151は、割込コントローラ107から割込発生通知を受け取り、通常割込ハンドラ161を起動する(ステップS556)。通常割込ハンドラ161へ割込発生通知を出力する(ステップS557)。
The interrupt controller 107 detects the occurrence of an interrupt and outputs an interrupt occurrence notification to the normal OS 151 (step S553).
The normal OS 151 receives the interrupt occurrence notification from the interrupt controller 107 and activates the normal interrupt handler 161 (step S556). An interrupt generation notification is output to the normal interrupt handler 161 (step S557).

通常割込ハンドラ161は、割込発生通知を受け取ると、割り込みを発生させている要因を調査する(ステップS558)。暗号処理デバイス117が割り込みを発生させていることを検出し、デバイスID_Cと割込通知とを通常OS151へ出力する(ステップS561)。
通常OS151は、通常割込ハンドラ161から割込通知とデバイスID_Cとを受け取る。受け取ったデバイスID_Cと対応する暗号エントリデバイスドライバ159及び、暗号エントリデバイスドライバ159と共に休眠処理を施した音楽復号デーモン156の休眠を解除し(ステップS562、ステップS563)、暗号エントリデバイスドライバ159へCPU102を割り当てる。
When receiving the interrupt occurrence notification, the normal interrupt handler 161 investigates the factor causing the interrupt (step S558). It detects that the cryptographic processing device 117 has generated an interrupt, and outputs a device ID_C and an interrupt notification to the normal OS 151 (step S561).
The normal OS 151 receives an interrupt notification and a device ID_C from the normal interrupt handler 161. The sleep of the encryption entry device driver 159 corresponding to the received device ID_C and the music decryption daemon 156 that has performed sleep processing together with the encryption entry device driver 159 is released (steps S562 and S563), and the CPU 102 is transferred to the encryption entry device driver 159. assign.

暗号エントリデバイスドライバ159は、休眠を解除されると、割込通知とハンドル値「1」と自身を示すデバイスID_Cとを、通常OS151へ出力する(ステップS564)。
通常OS151は、割込通知とハンドル値「1」とデバイスID_Cとを受け取り、受け取ったハンドル値「1」と対応する音楽復号デーモン156へ、割込通知とハンドル値「1」とデバイスID_Cとを出力する(ステップS567)。
When the sleep is canceled, the cryptographic entry device driver 159 outputs the interrupt notification, the handle value “1”, and the device ID_C indicating itself to the normal OS 151 (step S564).
The normal OS 151 receives the interrupt notification, the handle value “1”, and the device ID_C, and sends the interrupt notification, the handle value “1”, and the device ID_C to the music decryption daemon 156 corresponding to the received handle value “1”. Output (step S567).

音楽復号デーモン156は、通常OS151を介して暗号エントリデバイスドライバ159からデバイスID_Cと割込通知とを受け取る。次に、受け取った割込通知及びデバイスID_Cと、音楽復号デーモン156自身と対応するハンドル値「1」とを通常OS151へ出力する(ステップS568)。
通常OS151は、音楽復号デーモン156から割込通知とデバイスID_Cとハンドル値「1」とを受け取り、受け取った割込通知とデバイスID_Cとハンドル値「1」とを共有メモリ112へ書き込む(ステップS571)。
The music decryption daemon 156 receives the device ID_C and the interrupt notification from the encryption entry device driver 159 via the normal OS 151. Next, the received interrupt notification and device ID_C and the handle value “1” corresponding to the music decryption daemon 156 itself are output to the normal OS 151 (step S568).
The normal OS 151 receives the interrupt notification, device ID_C, and handle value “1” from the music decryption daemon 156, and writes the received interrupt notification, device ID_C, and handle value “1” to the shared memory 112 (step S571). .

次に、通常OS151及びセキュアOS171は、切替処理1を行う(ステップS572)。
切替処理1が終了すると、セキュアOS171は、共有メモリ112から、割込通知とデバイスID_Cとハンドル値「1」とを読み出す(ステップS576)。読み出したデバイスID_Cを基に、暗号デバイスドライバ179を起動し、読み出した割込通知とデバイスID_Cとハンドル値「1」とを出力する(ステップS577)。
Next, the normal OS 151 and the secure OS 171 perform the switching process 1 (step S572).
When the switching process 1 ends, the secure OS 171 reads the interrupt notification, the device ID_C, and the handle value “1” from the shared memory 112 (step S576). Based on the read device ID_C, the cryptographic device driver 179 is activated, and the read interrupt notification, device ID_C, and handle value “1” are output (step S577).

暗号デバイスドライバ179は、割込通知とデバイスID_Cハンドル値「1」とを受け取り、暗号処理デバイス117へ処理結果を要求する(ステップS578)。暗号処理デバイス117から、処理結果として、バッファ123上における音楽データの書込先アドレスを取得する(ステップS579)。
暗号デバイスドライバ179は、取得した処理結果と、受け取ったハンドル値「1」と、暗号デバイスドライバ179自身を示すデバイスID_CをセキュアOS171へ出力する(ステップS582)。
The cryptographic device driver 179 receives the interrupt notification and the device ID_C handle value “1”, and requests the cryptographic processing device 117 for a processing result (step S578). From the cryptographic processing device 117, the write destination address of the music data on the buffer 123 is acquired as a processing result (step S579).
The cryptographic device driver 179 outputs the acquired processing result, the received handle value “1”, and the device ID_C indicating the cryptographic device driver 179 itself to the secure OS 171 (step S582).

セキュアOS171は、暗号デバイスドライバ179から処理結果とハンドル値「1」とデバイスID_Cとを受け取り、受け取った処理結果とハンドル値「1」とデバイスID_Cとを共有メモリ112へ書き込む(ステップS583)。
次に、セキュアOS171及び通常OS151は、切替処理2を行う(ステップS584)。
The secure OS 171 receives the processing result, the handle value “1”, and the device ID_C from the cryptographic device driver 179, and writes the received processing result, the handle value “1”, and the device ID_C to the shared memory 112 (step S583).
Next, the secure OS 171 and the normal OS 151 perform the switching process 2 (step S584).

切替処理2が終了すると、通常OS151は、共有メモリ112からハンドル値「1」、処理結果、デバイスID_Cを読み出す(ステップS586)。読み出したハンドル値「1」を基に、音楽復号デーモン156を起動し、音楽復号デーモン156へ、読み出した処理結果とハンドル値「1」とデバイスID_Cとを出力する(ステップS587)。
音楽復号デーモン156は、通常OS151から処理結果とハンドル値「1」とデバイスID_Cとを受け取る。受け取った処理結果とデバイスID_Cと音楽復号デーモン156自身を示すハンドル値「1」とを含むシステムコールを通常OS151へ出力する(ステップS588)。
When the switching process 2 ends, the normal OS 151 reads the handle value “1”, the processing result, and the device ID_C from the shared memory 112 (step S586). Based on the read handle value “1”, the music decryption daemon 156 is activated, and the read processing result, the handle value “1”, and the device ID_C are output to the music decryption daemon 156 (step S587).
The music decryption daemon 156 receives the processing result, the handle value “1”, and the device ID_C from the normal OS 151. A system call including the received processing result, device ID_C, and handle value “1” indicating the music decryption daemon 156 itself is output to the normal OS 151 (step S588).

通常OS151は、デバイスID_Cと対応する暗号エントリデバイスドライバ159へ、受け取った処理結果とデバイスID_Cとハンドル値「1」とを出力する(ステップS589)。
暗号エントリデバイスドライバ159は、通常OS151を介して、音楽復号デーモン156から処理結果とデバイスID_Cとハンドル値「1」とを受け取り、排他フラグを「0」に変更する(ステップS592)。次に、暗号エントリデバイスドライバ159は、通常OS151への応答通知により(ステップS596)、音楽復号デーモン156へ、受け取った処理結果とハンドル値「1」とデバイスID_Cとを出力する(ステップS597)。
The normal OS 151 outputs the received processing result, the device ID_C, and the handle value “1” to the encryption entry device driver 159 corresponding to the device ID_C (step S589).
The cryptographic entry device driver 159 receives the processing result, the device ID_C, and the handle value “1” from the music decryption daemon 156 via the normal OS 151, and changes the exclusive flag to “0” (step S592). Next, the encryption entry device driver 159 outputs the received processing result, the handle value “1”, and the device ID_C to the music decryption daemon 156 by a response notification to the normal OS 151 (step S596) (step S597).

音楽復号デーモン156は、セキュアOS171を介して音楽復号デーモン156から処理結果とハンドル値「1」とデバイスID_Cとを受け取る。次に、受け取った処理結果とハンドル値「1」とを通常OS151へ出力する(ステップS598)。
通常OS151は、音楽復号デーモン156から処理結果とハンドル値「1」とを受け取り、受け取った処理結果とハンドル値「1」とを共有メモリ112へ書き込む(ステップS601)。
The music decryption daemon 156 receives the processing result, the handle value “1”, and the device ID_C from the music decryption daemon 156 via the secure OS 171. Next, the received processing result and the handle value “1” are output to the normal OS 151 (step S598).
The normal OS 151 receives the processing result and the handle value “1” from the music decryption daemon 156, and writes the received processing result and the handle value “1” to the shared memory 112 (step S601).

次に、通常OS151とセキュアOS171は、切替処理1を行う(ステップS602)。
切替処理1が終了すると、セキュアOS171は、共有メモリ112からハンドル値「1」と処置結果とを読み出す(ステップS603)。セキュアアプリ管理表186上の、ハンドル値「1」を含むエントリ187を基に、音楽復号プログラム176のコンテキストを復帰し(ステップS604)、読み出した処理結果を音楽復号プログラム176へ出力する(ステップS606)。
Next, the normal OS 151 and the secure OS 171 perform the switching process 1 (step S602).
When the switching process 1 ends, the secure OS 171 reads the handle value “1” and the treatment result from the shared memory 112 (step S603). Based on the entry 187 including the handle value “1” on the secure application management table 186, the context of the music decryption program 176 is restored (step S604), and the read processing result is output to the music decryption program 176 (step S606). ).

ここまで、図32〜34を用いた説明では、通常OS151又は通常OS151によって管理される通常メモリ111上のプログラムの実行中における、割込発生時の動作について説明してきたが、セキュアOS171及びセキュアOS171によって管理されるプログラムの実行中における割込発生時の動作は、上述した割込発生時の処理1−2とほぼ同様であり、図29中の通常入出力デバイスを、暗号処理デバイスに変更すればよい。ステップS502以降の処理は、図32のステップS553へと続く。   So far, in the description using FIGS. 32 to 34, the operation at the time of occurrence of an interrupt during execution of the normal OS 151 or the program on the normal memory 111 managed by the normal OS 151 has been described. However, the secure OS 171 and the secure OS 171 The operation at the time of occurrence of an interrupt during the execution of the program managed by the above is substantially the same as the above-described process 1-2 at the time of occurrence of the interrupt, and the normal input / output device in FIG. 29 is changed to a cryptographic processing device. That's fine. Processing subsequent to step S502 continues to step S553 in FIG.

(7)音楽復号プログラムの削除
図35に示すフローチャートを用いて、音楽復号プログラムの削除処理について説明する。これは、図15のステップS109の詳細である。また、音楽復号プログラム削除処理は、図42のステップS611〜618のシーケンスと対応する。
音楽復号プログラム176は、セキュアアプリ削除命令とハンドル値「1」とを通常OS151へ出力する(ステップS611)。
(7) Delete music decryption program
The music decryption program deletion process will be described with reference to the flowchart shown in FIG. This is the detail of step S109 in FIG. The music decryption program deletion process corresponds to the sequence of steps S611 to 618 in FIG.
The music decryption program 176 outputs the secure application deletion command and the handle value “1” to the normal OS 151 (step S611).

通常OS151は、音楽復号プログラム176から、ハンドル値「1」とセキュアアプリ削除命令を受け取り、受け取ったハンドル値「1」とセキュアアプリ削除命令とを共有メモリ112へ書き込む(ステップS612)。
次に、通常OS151及びセキュアOS171は、切替処理1を行う(ステップS613)。
The normal OS 151 receives the handle value “1” and the secure application deletion command from the music decryption program 176, and writes the received handle value “1” and the secure application deletion command to the shared memory 112 (step S612).
Next, the normal OS 151 and the secure OS 171 perform the switching process 1 (step S613).

切替処理1が終了すると、セキュアOS171は、共有メモリ112からセキュアアプリ削除命令とハンドル値「1」とを読み出す(ステップS614)。セキュアアプリ管理表186上のハンドル値「1」を含むエントリのセキュアアプリアドレスを基に音楽復号プログラム176をセキュアメモリ113上から削除し(ステップS616)、ハンドル値「1」を含むエントリ187をセキュアアプリ管理表186から削除する(ステップS617)。   When the switching process 1 ends, the secure OS 171 reads the secure application deletion command and the handle value “1” from the shared memory 112 (step S614). The music decryption program 176 is deleted from the secure memory 113 based on the secure application address of the entry including the handle value “1” on the secure application management table 186 (step S616), and the entry 187 including the handle value “1” is secured. Delete from the application management table 186 (step S617).

次に、ハンドル値「1」と削除完了通知とを共有メモリ112に書き込む(ステップS618)。
次に、セキュアOS171と通常OS151は切替処理2を行う(ステップS619)。
切替処理2が終了すると、通常OS151は、共有メモリ112から削除処理完了通知とハンドル値「1」とを読み出す(ステップS621)。ハンドル値「1」とアプリ管理表166とを基に音楽復号デーモン156を、通常メモリ111から削除する(ステップS622)。次に、音楽再生プログラム153へ、削除完了通知を出力し(ステップS623)、ハンドル値「1」を含むエントリ167をアプリ管理表166から削除する(ステップS624)。
Next, the handle value “1” and the deletion completion notification are written in the shared memory 112 (step S618).
Next, the secure OS 171 and the normal OS 151 perform the switching process 2 (step S619).
When the switching process 2 ends, the normal OS 151 reads the deletion process completion notification and the handle value “1” from the shared memory 112 (step S621). The music decryption daemon 156 is deleted from the normal memory 111 based on the handle value “1” and the application management table 166 (step S622). Next, a deletion completion notification is output to the music playback program 153 (step S623), and the entry 167 including the handle value “1” is deleted from the application management table 166 (step S624).

1.3まとめ・効果
以上説明してきたように、本発明の携帯電話100において、通常メモリ111上にロードされて実行される音楽再生プログラム153は、保護されるべき処理、具体的には、暗号化音楽データの復号の処理を、セキュアメモリ113上にロードされて実行される音楽復号プログラム176へ依頼する。
1.3 Summary / Effects As described above, in the mobile phone 100 of the present invention, the music playback program 153 loaded and executed on the normal memory 111 is a process to be protected, specifically, encryption. The music decryption program 176 loaded on the secure memory 113 and executed is requested to decrypt the music data.

音楽復号プログラム176と、通常メモリ111上の音楽復号デーモン156とは対になって動作し、暗号化音楽データの復号に関する一連の処理のうち、保護されるべき処理は、音楽復号プログラム176が分担し、保護する必要のない処理は、音楽復号デーモン156が担う。
このように処理を分担することで、音楽復号プログラム176自体のプログラムサイズが小さくなり、音楽復号プログラム176の保持するデータ、変数なども減少する。さらに、音楽復号プログラム176からの依頼により、音楽復号デーモン156が、通常メモリ111上のライブラリに格納されている関数を使用する。このため、セキュアメモリ113上にライブラリを持つ必要がなくなる。
The music decryption program 176 and the music decryption daemon 156 on the normal memory 111 operate as a pair, and the music decryption program 176 shares the processing to be protected among the series of processing related to decryption of the encrypted music data. However, the music decryption daemon 156 performs processing that does not need to be protected.
By sharing the processing in this way, the program size of the music decoding program 176 itself is reduced, and the data, variables, etc. held by the music decoding program 176 are also reduced. Further, in response to a request from the music decryption program 176, the music decryption daemon 156 uses a function stored in the library on the normal memory 111. This eliminates the need for having a library on the secure memory 113.

従って、音楽復号プログラム176及び音楽復号デーモン156による一連の復号処理において、確保すべきセキュアメモリ113の容量を削減することになり、セキュアメモリ113を保護する保護機構の負荷を軽減することができる。
セキュアOS171に管理される、保護されるべきデバイスである暗号処理デバイス117の制御に関する処理について、保護する必要のない排他制御、休眠、割込の通知については、通常メモリ111上にロードされて実行される暗号エントリデバイスドライバ159が実行する。
Therefore, the capacity of the secure memory 113 to be secured is reduced in a series of decryption processes by the music decryption program 176 and the music decryption daemon 156, and the load of the protection mechanism for protecting the secure memory 113 can be reduced.
Regarding the processing related to the control of the cryptographic processing device 117, which is the device to be protected, managed by the secure OS 171, the notification of exclusive control, sleep, and interrupt that do not need to be protected is loaded into the normal memory 111 and executed. The encryption entry device driver 159 is executed.

この動作を、時間の経過に沿って、考察すると、通常OS151は、音楽復号デーモン156からのシステムコールにより、暗号エントリデバイスドライバ159を実行状態に遷移させる。暗号エントリデバイスドライバ159は、排他制御を行い、音楽復号デーモン156を呼び出す。音楽復号デーモン156は、通常OS151及び、セキュアOS171を介して、暗号デバイスドライバ179を呼び出す。セキュアOS171は、暗号デバイスドライバ179を実行状態に遷移させる。暗号デバイスドライバ179は、暗号処理デバイス117に復号処理を指示した後、休眠要求を出力する。暗号エントリデバイスドライバ159は、セキュアOS171、通常OS151及び音楽復号デーモン156を介して、休眠要求を受け取ると、通常OS151へ休眠処理を依頼し、通常OS151は、暗号エントリデバイスドライバ159を休眠状態に遷移させる。   Considering this operation over time, the normal OS 151 causes the cryptographic entry device driver 159 to transition to the execution state by a system call from the music decryption daemon 156. The encryption entry device driver 159 performs exclusive control and calls the music decryption daemon 156. The music decryption daemon 156 calls the encryption device driver 179 via the normal OS 151 and the secure OS 171. The secure OS 171 causes the cryptographic device driver 179 to transition to the execution state. The encryption device driver 179 outputs a sleep request after instructing the encryption processing device 117 to perform a decryption process. When the cryptographic entry device driver 159 receives a sleep request via the secure OS 171, the normal OS 151, and the music decryption daemon 156, the cryptographic entry device driver 159 requests the normal OS 151 to perform a sleep process, and the normal OS 151 shifts the cryptographic entry device driver 159 to the sleep state. Let

次に、暗号処理デバイス117による処理が終了し、割込が発生し、通常OS151は、音楽復号デーモン156の休眠を解除し、実行状態に遷移させる。暗号エントリデバイスドライバ159は、割込通知を出力し、音楽復号デーモン156は、通常OS151及びセキュアOS171を介して割込通知を、暗号デバイスドライバ179へ出力する。通常OS151は、暗号デバイスドライバ179にCPU102を割り当て、実行状態にする。   Next, the processing by the cryptographic processing device 117 ends, an interrupt occurs, and the normal OS 151 cancels the sleep of the music decryption daemon 156 and shifts to the execution state. The cryptographic entry device driver 159 outputs an interrupt notification, and the music decryption daemon 156 outputs an interrupt notification to the cryptographic device driver 179 via the normal OS 151 and the secure OS 171. The normal OS 151 assigns the CPU 102 to the encryption device driver 179 and puts it into an execution state.

このように、暗号デバイスドライバ179と暗号エントリデバイスドライバ159は、対応して状態遷移する。従って、通常OS151は、暗号エントリデバイスドライバ159を介して、セキュアOS171によって管理されている暗号処理デバイス117の使用状態を管理することが可能になった。
セキュアOS171により管理されるデバイスであるセキュア入出力デバイス133についても、同様に、セキュア入出力エントリデバイスドライバ158を制御することにより、通常OS151は、セキュア入出力デバイス133の動作を監視し、制御することが可能になった。
In this way, the cryptographic device driver 179 and the cryptographic entry device driver 159 make a corresponding state transition. Therefore, the normal OS 151 can manage the usage state of the cryptographic processing device 117 managed by the secure OS 171 via the cryptographic entry device driver 159.
Similarly, the secure input / output device 133, which is a device managed by the secure OS 171, similarly controls the secure input / output entry device driver 158 so that the normal OS 151 monitors and controls the operation of the secure input / output device 133. It became possible.

1.4 携帯電話100のその他の動作
携帯電話100の初期動作及び仮想メモリ空間の構築について以下に説明する。
(1)ブートプログラム
図43は、通常メモリ111に記憶されているデータの一例を示している。これは、携帯電話100の起動直後の通常メモリ111内の様子を示している。
1.4 Other Operations of the Mobile Phone 100 The initial operation of the mobile phone 100 and the construction of the virtual memory space will be described below.
(1) Boot Program FIG. 43 shows an example of data stored in the normal memory 111. This shows a state in the normal memory 111 immediately after the mobile phone 100 is activated.

通常OS151、ライブラリ152、通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158、暗号エントリデバイスドライバ159、通常切替デバイスドライバ160、通常割込ハンドラ161は、既に説明したとおりである。
ブートプログラム162は、通常メモリ111を構成するROMに予め記憶されておりブートプログラム162は、具体的には図示されていないが、携帯電話100に、含まれる起動部により読み出され実行されるプログラムである。
The normal OS 151, library 152, normal input / output device driver 157, secure input / output entry device driver 158, encryption entry device driver 159, normal switching device driver 160, and normal interrupt handler 161 are as described above.
The boot program 162 is stored in advance in the ROM constituting the normal memory 111, and the boot program 162 is not specifically illustrated, but is a program that is read and executed by the activation unit included in the mobile phone 100. It is.

起動部は、携帯電話100に電源が投入された直後に通常メモリ111からブートプログラム162を読み出し、読み出したブートプログラム162に従って動作する。以下、ブートプログラム162に従う起動部の動作によって、ブートプログラムについて説明する。
先ず、ブートプログラム162は、CPU102のレジスタ、MMU103をクリアし、切替制御部106へ初期化要求を出力する。切替制御部106から、セキュアメモリ113上のプログラムの初期化が終了したことを通知する初期化終了通知を受け取り、次に、通常OS151、通常切替デバイスドライバ160などを、通常メモリ111上にロードし、初期化する。
The activation unit reads the boot program 162 from the normal memory 111 immediately after the mobile phone 100 is turned on, and operates according to the read boot program 162. Hereinafter, the boot program will be described by the operation of the activation unit according to the boot program 162.
First, the boot program 162 clears the register of the CPU 102 and the MMU 103 and outputs an initialization request to the switching control unit 106. An initialization end notification for notifying that the initialization of the program on the secure memory 113 is completed is received from the switching control unit 106. Next, the normal OS 151, the normal switching device driver 160, etc. are loaded onto the normal memory 111. ,initialize.

(2)携帯電話100の初期動作
携帯電話100は、起動時に切替制御部106及びブートプログラムによって、初期化される。携帯電話100の起動時の動作について、図44に示すフローチャートを用いて説明する。
携帯電話100の電源がONの状態になり、電力供給が開始されると(ステップS651)、起動部は、ブートプログラム162を起動する(ステップS652)。ブートプログラム162は、先ず、CPU102及びMMU103のレジスタをクリアすることで初期化する(ステップS653)。次に、切替制御部106へ、初期化要求を出力する(ステップS654)。
(2) Initial operation of the mobile phone 100 The mobile phone 100 is initialized by the switching control unit 106 and the boot program at startup. The operation when the mobile phone 100 is activated will be described with reference to the flowchart shown in FIG.
When the mobile phone 100 is turned on and power supply is started (step S651), the activation unit activates the boot program 162 (step S652). First, the boot program 162 is initialized by clearing the registers of the CPU 102 and the MMU 103 (step S653). Next, an initialization request is output to the switching control unit 106 (step S654).

切替制御部106は、初期化要求を受け取り、二次記憶部104から暗号化セキュアOSを読み出す(ステップS656)。読み出した暗号化セキュアOSを復号してセキュアOSを生成する(ステップS657)。次に、メモリ保護部114により、バス130とセキュアメモリ113とを接続する(ステップS658)。生成したセキュアOSをセキュアメモリ113上に書き込み、初期化する(ステップS659)。続いて、セキュア切替デバイスドライバを、二次記憶部104から読み出し、セキュアメモリ113上にロードする(ステップS661)。   The switching control unit 106 receives the initialization request and reads the encrypted secure OS from the secondary storage unit 104 (step S656). The read encrypted secure OS is decrypted to generate a secure OS (step S657). Next, the memory protection unit 114 connects the bus 130 and the secure memory 113 (step S658). The generated secure OS is written on the secure memory 113 and initialized (step S659). Subsequently, the secure switching device driver is read from the secondary storage unit 104 and loaded onto the secure memory 113 (step S661).

次に、メモリ保護部114により、セキュアメモリ113とバス130とを切断し(ステップS662)、初期化終了通知をブートプログラム162へ出力する(ステップS663)。
ブートプログラム162は、切替制御部106から、初期化終了通知を受け取り、次に、通常OS151、通常切替デバイスドライバ160などのプログラムを通常メモリ上にロードし、初期化する(ステップS664)。
Next, the memory protection unit 114 disconnects the secure memory 113 and the bus 130 (step S662), and outputs an initialization end notification to the boot program 162 (step S663).
The boot program 162 receives the initialization end notification from the switching control unit 106, and then loads programs such as the normal OS 151 and the normal switching device driver 160 onto the normal memory and initializes them (step S664).

なお、上記の説明では、暗号化セキュアOS、セキュア切替デバイスドライバは、二次記憶部104上に記憶されているとして説明したが、外部の記録メディアなどに記憶されているとしてもよい。
(3)通常OS151及びセキュアOS171による初期化動作
通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158、暗号エントリデバイスドライバ159は、通常OS151の管理下で、通常メモリ111上に常駐するプログラムである。
In the above description, the encrypted secure OS and the secure switching device driver have been described as being stored on the secondary storage unit 104, but may be stored on an external recording medium or the like.
(3) Initialization Operation by Normal OS 151 and Secure OS 171 Normal I / O device driver 157, secure I / O entry device driver 158, and cryptographic entry device driver 159 are programs that reside on normal memory 111 under the control of normal OS 151. is there.

また、セキュア入出力デバイスドライバ178及び暗号デバイスドライバ179は、セキュアOS171の管理下でセキュアメモリ113上に常駐するプログラムである。
ブートプログラム162は、通常OS151及び通常切替デバイスドライバ160などを通常メモリ111上にロードし、初期化し終えると、通常OS151を起動する。
通常OS151は、起動すると、先ず、通常メモリ111上にロードされているプログラムをサーチし、通常入出力デバイスドライバ157、セキュア入出力エントリデバイスドライバ158、暗号エントリデバイスドライバ159がロードされているか否かを判断し、ロードされていなければ、二次記憶部104から読み出し、ロードする。
The secure input / output device driver 178 and the encryption device driver 179 are programs that reside on the secure memory 113 under the management of the secure OS 171.
The boot program 162 loads the normal OS 151, the normal switching device driver 160, and the like onto the normal memory 111, and starts the normal OS 151 when initialization is completed.
When the normal OS 151 is started, it first searches for a program loaded on the normal memory 111, and whether or not the normal input / output device driver 157, secure input / output entry device driver 158, and encryption entry device driver 159 are loaded. If it is not loaded, it is read from the secondary storage unit 104 and loaded.

通常OS151が、セキュア入出力エントリデバイスドライバ158及び暗号エントリデバイスドライバ159をロードする際に、セキュアOS171によって、セキュア入出力デバイスドライバ178及び暗号デバイスドライバ179もセキュアメモリ113上にロードされる。
通常OS151及びセキュアOS171による、この動作は、既に説明した音楽復号プログラムの登録処理と類似しているので、ここでは、簡単に説明する。なお、二次記憶部104は、各デバイスドライバ及び、エントリデバイスドライバを暗号化して生成された暗号化エントリデバイスドライバを、予め記憶しているものとする。
When the normal OS 151 loads the secure input / output entry device driver 158 and the cryptographic entry device driver 159, the secure input / output device driver 178 and the cryptographic device driver 179 are also loaded onto the secure memory 113 by the secure OS 171.
This operation by the normal OS 151 and the secure OS 171 is similar to the music decryption program registration process already described, and will be described briefly here. It is assumed that the secondary storage unit 104 stores in advance each device driver and an encrypted entry device driver generated by encrypting the entry device driver.

セキュア入出力エントリデバイスドライバが、ロードされていないと判断すると、通常OS151は、二次記憶部104から、セキュア入出力エントリデバイスドライバを読み出し、通常メモリ111に書き込む。書き込み先のアドレスとセキュア入出力エントリデバイスドライバ158とを対応付けて記憶する。次に、共有メモリ112にデバイスドライバのロードを指示するデバドラ登録要求とセキュア入出力デバイスドライバを示すデバイスID_Bとを書き込む。次に、通常切替デバイスドライバ160へ切替指示を出力する。   When determining that the secure input / output entry device driver is not loaded, the normal OS 151 reads the secure input / output entry device driver from the secondary storage unit 104 and writes it in the normal memory 111. The write destination address and the secure input / output entry device driver 158 are stored in association with each other. Next, a device registration request for instructing loading of the device driver and a device ID_B indicating the secure input / output device driver are written into the shared memory 112. Next, a switching instruction is output to the normal switching device driver 160.

切替処理が終了し、セキュアOS171は、CPU102に復帰する。共有メモリ112から、デバドラ登録要求とデバイスID_Bとを読み出す。デバイスID_Bと対応する暗号化セキュア入出力エントリデバイスドライバを読み出し、暗復号プログラム174によって、読み出した暗号化エントリデバイスドライバを復号して、セキュア入出力エントリデバイスドライバを生成し、セキュアメモリ113に書き込む。書き込み先のアドレスとデバイスID_Bとを対応付けて記憶する。   The switching process ends, and the secure OS 171 returns to the CPU 102. The device registration request and device ID_B are read from the shared memory 112. The encrypted secure input / output entry device driver corresponding to the device ID_B is read out, and the encrypted entry device driver read out is decrypted by the encryption / decryption program 174 to generate a secure input / output entry device driver and write it into the secure memory 113. The write destination address and the device ID_B are stored in association with each other.

次に、共有メモリ112に、デバドラ登録完了通知を書き込み、セキュア切替デバイスドライバ180へ切替指示を出力する。
切替処理が終了し、CPU102に復帰すると、通常OS151は、共有メモリ112から、デバドラ登録完了通知を読み出す。
続いて、暗号エントリデバイスドライバついても、同様にして、ロードする。
Next, a notification of registration completion registration is written in the shared memory 112 and a switching instruction is output to the secure switching device driver 180.
When the switching process ends and returns to the CPU 102, the normal OS 151 reads a notification of completion of registration of the devdora from the shared memory 112.
Subsequently, the encryption entry device driver is loaded in the same manner.

(4)MMU制御プログラム184による仮想記憶空間
セキュアOS171は、これまで言及していないが、図45に示すようにMMU制御プログラム184を含んでいる。MMU制御プログラム184は、MMU103により実行されるプログラムであり、セキュアメモリ113、共有メモリ112及び二次記憶部104の物理アドレスと論理アドレスとを変換することにより、仮想記憶空間を構築する。
(4) Virtual Storage Space by MMU Control Program 184 Although not mentioned so far, the secure OS 171 includes an MMU control program 184 as shown in FIG. The MMU control program 184 is a program executed by the MMU 103, and constructs a virtual storage space by converting physical addresses and logical addresses of the secure memory 113, the shared memory 112, and the secondary storage unit 104.

図46は、MMU制御プログラム184により、実現される仮想記憶空間の一例を示している。図45に示すように、セキュアメモリ113上には、音楽復号プログラム176と通信鍵生成プログラム185とがロードされていると想定する。音楽復号プログラム176及び通信鍵生成プログラム185は、セキュアアプリケーションである。
音楽復号プログラム176及び通信鍵生成プログラム185は、それぞれ、仮想空間201、仮想空間204にロードされている。それぞれのプログラムには、個別に、通常共有空間202及び通常共有空間206が割り当てられている。通常共有空間202及び通常共有空間206は、それぞれのプログラムが、通常メモリ111上のプログラムと共有する仮想空間である。
FIG. 46 shows an example of a virtual storage space realized by the MMU control program 184. As shown in FIG. 45, it is assumed that a music decryption program 176 and a communication key generation program 185 are loaded on the secure memory 113. The music decryption program 176 and the communication key generation program 185 are secure applications.
The music decryption program 176 and the communication key generation program 185 are loaded in the virtual space 201 and the virtual space 204, respectively. A normal shared space 202 and a normal shared space 206 are individually assigned to each program. The normal shared space 202 and the normal shared space 206 are virtual spaces that are shared by the programs on the normal memory 111.

音楽復号プログラム176は、仮想空間204及び通常共有空間206へアクセスすることはできない。また、通信鍵生成プログラム185は、仮想空間201及び通常共有空間202へアクセスすることはできない。
セキュア共有空間207は、音楽復号プログラム176及び通信鍵生成プログラム185のいずれからもアクセス可能であるが、通常OS151の管理下で動作するプログラムからはアクセスできない仮想空間である。
The music decryption program 176 cannot access the virtual space 204 and the normal shared space 206. Further, the communication key generation program 185 cannot access the virtual space 201 and the normal shared space 202.
The secure shared space 207 is a virtual space that can be accessed from both the music decryption program 176 and the communication key generation program 185, but cannot be accessed from programs that normally operate under the management of the OS 151.

セキュアOS171は、仮想空間208にロードされている。セキュアOS171は、仮想空間201及び204へアクセス可能であるが、音楽復号プログラム176及び通信鍵生成プログラム185から仮想空間208へアクセスすることはできない。
このようにして、MMU制御プログラム184は、それぞれのアプリケーションごとに、個別の仮想空間を割り当て、お互いにアクセスできないように制御する。
The secure OS 171 is loaded in the virtual space 208. The secure OS 171 can access the virtual spaces 201 and 204, but cannot access the virtual space 208 from the music decryption program 176 and the communication key generation program 185.
In this way, the MMU control program 184 assigns an individual virtual space for each application and performs control so that they cannot access each other.

なお、MMU制御プログラム184は、上述した仮想記憶空間を、セキュアメモリ113、共有メモリ112及び二次記憶部104上に実現する。MMU制御プログラム184は、暗号処理プログラムを含んでおり、セキュアメモリ113上に記憶されているデータを二次記憶部104上にページアウトする際には、データを暗号化し、二次記憶部104から、セキュアメモリ113上へ、ページインする際には、復号するとしてもよい。   The MMU control program 184 realizes the above-described virtual storage space on the secure memory 113, the shared memory 112, and the secondary storage unit 104. The MMU control program 184 includes an encryption processing program. When data stored in the secure memory 113 is paged out to the secondary storage unit 104, the data is encrypted, and the data is stored in the secondary storage unit 104. When page-in is performed on the secure memory 113, decryption may be performed.

また、音楽復号プログラム176及び通信鍵生成プログラム185は、それぞれの通常共有空間に互いにアクセスできるとしてもよい。
1.5 実施の形態1の変形例
(1) 実施の形態1において、音楽復号プログラム176と音楽復号デーモン156とが対になって動作することにより、暗号化音楽データの復号処理を達成するとして説明してきたが、図47に示すような構成であっても良い。
Further, the music decryption program 176 and the communication key generation program 185 may be able to access each normal shared space.
1.5 Modification of Embodiment 1 (1) In Embodiment 1, the music decryption program 176 and the music decryption daemon 156 operate as a pair, thereby achieving the decryption processing of the encrypted music data. Although described, a configuration as shown in FIG. 47 may be used.

この構成では、通常メモリ111上には、音楽再生プログラム153に代わって音楽再生プログラム153bがロードされている。音楽再生プログラム153bは、外部処理マネージャ156bを含んで構成され、外部処理マネージャ156bは、上述の音楽復号デーモン156と同様に、暗号化音楽データの復号処理のうち、保護される必要のない処理を分担する。また、音楽復号プログラム176と通常OS151との間の各種の情報及びコマンドの入出力を行う。   In this configuration, a music playback program 153 b is loaded on the normal memory 111 instead of the music playback program 153. The music playback program 153b is configured to include an external processing manager 156b. The external processing manager 156b performs processing that does not need to be protected among the decryption processing of the encrypted music data, like the above-described music decryption daemon 156. to share the load. Various information and commands are input / output between the music decryption program 176 and the normal OS 151.

この構成の場合、アプリ管理表166の各エントリは、ハンドル値とアプリコンテキストアドレスとから構成される。通常OS151は、受け取り先を示す識別情報としてハンドル値「1」を含むコマンドを受け取ると、アプリ管理表166を基に、音楽再生プログラム153のコンテキストを復帰させ、外部処理マネージャのスレットにCPU102を割り当てる。   In the case of this configuration, each entry of the application management table 166 includes a handle value and an application context address. When the normal OS 151 receives a command including the handle value “1” as identification information indicating the receiving destination, the OS 151 returns the context of the music playback program 153 based on the application management table 166 and assigns the CPU 102 to the external processing manager threat. .

このような構成によると、音楽再生プログラム153が外部処理マネージャ156bを含んでいるため、音楽復号プログラムの登録処理の際に、音楽復号デーモン156を、通常メモリ上にロードする必要がなく、実施の形態1において説明した登録処理を短縮することができる。
(2) なお、本実施の形態において、セキュア入出力エントリデバイスドライバ158とセキュア入出力デバイスドライバ178とを同一の識別情報デバイスID_Bによって識別しているが、異なる識別情報にによって識別するとしても良い。暗号エントリデバイスドライバ159と暗号デバイスドライバ179についても同様である。
According to such a configuration, since the music playback program 153 includes the external processing manager 156b, it is not necessary to load the music decryption daemon 156 on the normal memory during the music decryption program registration process. The registration process described in the first embodiment can be shortened.
(2) In this embodiment, the secure input / output entry device driver 158 and the secure input / output device driver 178 are identified by the same identification information device ID_B, but may be identified by different identification information. . The same applies to the encryption entry device driver 159 and the encryption device driver 179.

具体的には、通常OS151及びセキュアOS171は、制御データとして、それぞれの記憶領域に、図48に示すセキュアデバイスドライバ管理表231を有する。
図48に示すセキュアデバイスドライバ管理表231は、2つのセキュアデバイスドライバ管理情報232、234を含む。各セキュアデバイスドライバ管理情報は、エントリデバイスドライバ識別子とセキュアデバイスドライバ識別子とから構成される。セキュアデバイスドライバ識別子は、セキュアOS171に管理されるデバイスを制御するデバイスドライバを示す識別情報であり、エントリデバイスドライバ識別子は、前記デバイスドライバと対になって動作する通常メモリ111上のプログラムを示す識別情報である。具体的には、セキュアデバイスドライバ管理情報232は、セキュア入出力エントリデバイスドライバ158を識別する情報であるデバイスID_Bと、セキュア入出力エントリデバイスドライバ158と対になって動作するセキュア入出力デバイスドライバ178を識別する情報である「100」から構成される。セキュアデバイスドライバ管理情報234は、暗号エントリデバイスドライバ159を示す識別情報デバイスあるデバイスID_Cと、暗号エントリデバイスドライバ159と対になって動作する暗号デバイスドライバ179を示す識別情報「101」とを含む。
Specifically, the normal OS 151 and the secure OS 171 have a secure device driver management table 231 shown in FIG. 48 in their storage areas as control data.
The secure device driver management table 231 shown in FIG. 48 includes two secure device driver management information 232 and 234. Each secure device driver management information includes an entry device driver identifier and a secure device driver identifier. The secure device driver identifier is identification information indicating a device driver that controls a device managed by the secure OS 171, and the entry device driver identifier is an identification indicating a program on the normal memory 111 that operates as a pair with the device driver. Information. Specifically, the secure device driver management information 232 includes a device ID_B that is information for identifying the secure input / output entry device driver 158 and a secure input / output device driver 178 that operates in combination with the secure input / output entry device driver 158. It is composed of “100” which is information for identifying. The secure device driver management information 234 includes a device ID_C that is an identification information device indicating the cryptographic entry device driver 159, and identification information “101” that indicates the cryptographic device driver 179 that operates as a pair with the cryptographic entry device driver 159.

セキュアデバイスドライバ管理表231は、通常OS151及びセキュアOS171の起動時に生成されるものであり、通常OS151は、通常メモリ111上にセキュア入出力エントリデバイスドライバをロードすると、セキュア入出力エントリデバイスドライバを示す識別情報であるデバイスID_Bを共有メモリ112に書き込み、切替処理に移る。   The secure device driver management table 231 is generated when the normal OS 151 and the secure OS 171 are activated, and the normal OS 151 indicates the secure input / output entry device driver when the secure input / output entry device driver is loaded on the normal memory 111. The device ID_B, which is identification information, is written in the shared memory 112, and the process proceeds to the switching process.

切替処理が終了すると、セキュアOS171は、共有メモリ112からデバイスID_Bを読み出し、次に、二次記憶部104から暗号化セキュアデバイスドライバを読み出し、復号して、セキュアメモリ113上にロードする。ここで、ロードしたセキュア入出力デバイスドライバを示す識別情報「100」と受け取ったデバイスID_Bとを含むセキュアデバイスドライバ管理情報232を生成し、セキュアメモリ113上に書き込む。次に、識別情報「100」を共有メモリ112に書き込み、切り替え処理に移る。   When the switching process is completed, the secure OS 171 reads the device ID_B from the shared memory 112, then reads the encrypted secure device driver from the secondary storage unit 104, decrypts it, and loads it onto the secure memory 113. Here, secure device driver management information 232 including identification information “100” indicating the loaded secure input / output device driver and the received device ID_B is generated and written on the secure memory 113. Next, the identification information “100” is written in the shared memory 112 and the process proceeds to the switching process.

切り替え処理が終了すると、通常OS151は、共有メモリ112から識別情報「100」を読み出し、読み出した識別情報「100」と、セキュア入出力エントリデバイスドライバ158を示すデバイスID_Bとからなるセキュアデバイスドライバ管理情報を生成し、通常メモリ111上に書き込む。
セキュアデバイスドライバ情報234についても同様である。
When the switching process ends, the normal OS 151 reads the identification information “100” from the shared memory 112, and secure device driver management information including the read identification information “100” and the device ID_B indicating the secure input / output entry device driver 158. Is written in the normal memory 111.
The same applies to the secure device driver information 234.

通常OS151、上記のようにして生成した、セキュアデバイスドライバ管理表231を用いて、セキュア入出力エントリデバイスドライバ158及び暗号エントリデバイスドライバ159を管理する。また、セキュアOS171は、セキュアデバイスドライバ管理表231を用いて、セキュア入出力デバイスドライバ178及び暗号デバイスドライバ179を管理する。   The normal OS 151 manages the secure input / output entry device driver 158 and the encryption entry device driver 159 using the secure device driver management table 231 generated as described above. In addition, the secure OS 171 manages the secure input / output device driver 178 and the cryptographic device driver 179 using the secure device driver management table 231.

(3) 上記の実施の形態において、セキュアOS171は、デバッグ無効化プログラムを含んでいるが、セキュア切替デバイスドライバ180が、この機能を備えているとしてもよい。
この構成では、セキュア切替デバイスドライバ180は、切替制御部106から呼び出される度に、先ず、デバッガIF101を無効化し、次に、セキュアOS171のコンテキストを復帰させる。
(3) In the above embodiment, the secure OS 171 includes the debug invalidation program, but the secure switching device driver 180 may have this function.
In this configuration, each time the secure switching device driver 180 is called from the switching control unit 106, the secure switching device driver 180 first invalidates the debugger IF 101 and then restores the context of the secure OS 171.

また、セキュアOS171から切替指示を受け取ると、セキュアOS171のコンテキストを保存した後、デバッガIF101を有効にし、切替制御部106へ切替指示を出力する。
このようにして、セキュアOS171がCPU102に復帰する前に、デバッガIF101を無効化することで、セキュアOS171の動作を、外部のデバッグ装置に検出、操作されることを、より確実に防ぐことができる。
When receiving a switching instruction from the secure OS 171, after saving the context of the secure OS 171, the debugger IF 101 is enabled and the switching instruction is output to the switching control unit 106.
In this way, by disabling the debugger IF 101 before the secure OS 171 returns to the CPU 102, the operation of the secure OS 171 can be more reliably prevented from being detected and operated by an external debug device. .

また、セキュアメモリ113上のプログラムに代わって、切替制御部106が、デバッガIF101を無効化、有効化するとしても良い。
(4)上記の実施の形態1では、通常入出力デバイスドライバ157及び暗号エントリデバイスドライバ159は、排他フラグを用いて排他制御を行っており、排他フラグが「1」であれば、エラー通知を出力するとしている。しかし、各ドライバが動作している間に受け取った処理の依頼をストックしておくとしても良い。
Further, instead of the program on the secure memory 113, the switching control unit 106 may invalidate and validate the debugger IF 101.
(4) In the first embodiment, the normal input / output device driver 157 and the encryption entry device driver 159 perform exclusive control using the exclusive flag. If the exclusive flag is “1”, an error notification is sent. It is supposed to output. However, processing requests received while each driver is operating may be stocked.

この場合、通常入出力デバイスドライバ157及び暗号エントリデバイスドライバ159は、受け取った処理の依頼を記憶するQUEUEを備えており、処理の要求を受け取ると、排他フラグを確認する代わりに、受け取った処理依頼をQUEUEに格納する。
通常入出力デバイスドライバ157は、通常入出力デバイス132が処理を終え、処理結果を取得する。次に、QUEUEから次の処理依頼を読み出し、通常入出力デバイス132へ出力する。
In this case, the normal input / output device driver 157 and the encryption entry device driver 159 include a QUEUE that stores the received processing request, and when receiving the processing request, instead of checking the exclusive flag, the received processing request Is stored in QUEUE.
The normal input / output device driver 157 acquires the processing result when the normal input / output device 132 finishes processing. Next, the next processing request is read from the QUEUE and output to the normal input / output device 132.

暗号エントリデバイスドライバ159は、処理結果を受け取り、受け取った処理結果を出力すると、QUEUEから次の処理依頼を読み出す。読み出した処理依頼を、暗号デバイスドライバ179へ、出力する。
また、QUEUEに代わって、暗号エントリデバイスドライバ159専用のバッファ領域を備え、バッファ領域に受け取った処理依頼と、受け取った処理依頼の優先度とを対応付けて書き込むとしてもよい。
When the cryptographic entry device driver 159 receives the processing result and outputs the received processing result, the cryptographic entry device driver 159 reads the next processing request from the QUEUE. The read processing request is output to the encryption device driver 179.
Instead of QUEUE, a buffer area dedicated to the encryption entry device driver 159 may be provided, and the received processing request and the priority of the received processing request may be written in association with each other.

この場合、暗号処理デバイス117による処理が終了し、処理結果を受け取ると、暗号デバイスドライバ179は、優先度の高い処理依頼を読み出し、暗号処理デバイス117へ出力する。
(5)上記の実施の形態では、セキュア切替デバイスドライバ180が、セキュアOS171のコンテキストの保存及び復帰を行っているが、これを通常切替デバイスドライバ160が行っても良い。
In this case, when the processing by the cryptographic processing device 117 is completed and a processing result is received, the cryptographic device driver 179 reads a processing request with a high priority and outputs it to the cryptographic processing device 117.
(5) In the above embodiment, the secure switching device driver 180 stores and restores the context of the secure OS 171. However, the normal switching device driver 160 may perform this.

この場合、セキュアOS171から通常OS151への切替処理2の際に、セキュアOS171は、切替制御部106へ切替指示を出力する。切替制御部106は、メモリ保護部114に切断指示を出力し、セキュアメモリ113とバス130とを切断する。次に、通常切替デバイスドライバ160を呼び出す。通常切替デバイスドライバ160は、CPU102のレジスタ、MMU103の内容などを含むセキュアOS171のコンテキストを通常メモリ111上に保存し、CPU102及びMMU103をクリアし、通常OS151のコンテキストを復帰させる。   In this case, during the switching process 2 from the secure OS 171 to the normal OS 151, the secure OS 171 outputs a switching instruction to the switching control unit 106. The switching control unit 106 outputs a disconnection instruction to the memory protection unit 114 and disconnects the secure memory 113 and the bus 130. Next, the normal switching device driver 160 is called. The normal switching device driver 160 saves the context of the secure OS 171 including the registers of the CPU 102 and the contents of the MMU 103 on the normal memory 111, clears the CPU 102 and the MMU 103, and restores the context of the normal OS 151.

通常OS151からセキュアOS171への切替処理1の際には、通常OS151から切替指示を受けると、通常切替デバイスドライバ160は、通常OS151のコンテキストを保存し、CPU102及びMMU103をクリアする。次に、セキュアOS171のコンテキストを復帰させ、切替制御部106へ切替指示を出力する。
このようにして、セキュアOS171のコンテキストの保存と復帰を通常メモリ111上の通常切替デバイスドライバ160が行うことにより、セキュアメモリ113上にセキュア切替デバイスドライバ180が不要になる。従って、セキュアメモリ113の容量を削減することができる。
In the switching process 1 from the normal OS 151 to the secure OS 171, when receiving a switching instruction from the normal OS 151, the normal switching device driver 160 saves the context of the normal OS 151 and clears the CPU 102 and the MMU 103. Next, the context of the secure OS 171 is restored, and a switching instruction is output to the switching control unit 106.
In this way, the normal switching device driver 160 on the normal memory 111 stores and restores the context of the secure OS 171, thereby eliminating the need for the secure switching device driver 180 on the secure memory 113. Therefore, the capacity of the secure memory 113 can be reduced.

(6)上記の実施の形態及び変形例では、携帯電話100は、MMU103により仮想記憶空間を形成している。しかし、仮想記憶空間を使用しない構成であっても良い。この場合、各メモリに記憶されているデータ及びプログラムは物理アドレスによって管理されている。
従って、このような構成の場合、コンテキストの保存及び復帰に係るMMUの内容の保存を行う必要がなくなる。
(6) In the above embodiment and modification, the mobile phone 100 forms a virtual storage space by the MMU 103. However, a configuration that does not use the virtual storage space may be used. In this case, data and programs stored in each memory are managed by physical addresses.
Therefore, in such a configuration, it is not necessary to save the contents of the MMU related to saving and returning the context.

また、この場合、セキュアOS171のコンテキストを保存しない構成であってもよい。セキュア切替デバイスドライバ180は、切替制御部106から呼び出されると、セキュアOS171の先頭アドレスをCPU102に復帰させ、セキュアOS171を最初から起動する。
(7)また、上記の実施の形態1において、携帯電話100は、通常メモリ111上にロードされる通常OS151とセキュアメモリ113上にロードされて実行されるセキュアOS171とを備えているが、通常OS151を備えていない構成であっても良い。
In this case, the secure OS 171 context may not be saved. When called from the switching control unit 106, the secure switching device driver 180 returns the head address of the secure OS 171 to the CPU 102 and starts the secure OS 171 from the beginning.
(7) In the first embodiment, the mobile phone 100 includes the normal OS 151 loaded on the normal memory 111 and the secure OS 171 loaded on the secure memory 113 and executed. A configuration without the OS 151 may also be used.

携帯電話100の初期動作において説明したように、電源投入後に、先ず、ブートプログラム162が起動する。ブートプログラム162は、CPU102及びMMU103を初期化した後、切替制御部106へ、初期化要求を出力し、切替制御部106が、セキュアOS171及びセキュア切替デバイスドライバ180をセキュアメモリ113上にロードする。   As described in the initial operation of the mobile phone 100, after the power is turned on, first, the boot program 162 is started. The boot program 162 initializes the CPU 102 and the MMU 103 and then outputs an initialization request to the switching control unit 106, and the switching control unit 106 loads the secure OS 171 and the secure switching device driver 180 onto the secure memory 113.

セキュアOS171が、セキュアメモリ113及び通常メモリ111上に、各種のプログラムをロードする。
通常メモリ111上の各プログラムは、システムコールを含む全てのコマンドを、通常OS151に代わって、通常切替デバイスドライバ160へ出力する。
通常切替デバイスドライバ160は、通常メモリ111上のプログラムから、コマンドを受け取ると、受け取ったコマンドを、所定の記憶領域に書き込み、切替処理を行う。セキュアOS171は、CPU102に復帰すると、所定の記憶領域から、コマンドを読み出す。
The secure OS 171 loads various programs on the secure memory 113 and the normal memory 111.
Each program on the normal memory 111 outputs all commands including system calls to the normal switching device driver 160 instead of the normal OS 151.
When the normal switching device driver 160 receives a command from the program on the normal memory 111, the normal switching device driver 160 writes the received command in a predetermined storage area and performs switching processing. When the secure OS 171 returns to the CPU 102, it reads a command from a predetermined storage area.

このようにして、セキュアOS171が、通常メモリ111及びセキュアメモリ113上の各プログラムを制御する。
また、逆に、セキュアOS171を備えていない構成であっても良い。この場合、セキュア切替デバイスドライバ180又は切替制御部106がデバッガ無効化プログラムを備えている。
In this way, the secure OS 171 controls each program on the normal memory 111 and the secure memory 113.
Conversely, a configuration without the secure OS 171 may be used. In this case, the secure switching device driver 180 or the switching control unit 106 includes a debugger invalidation program.

セキュアメモリ113上の各プログラムは、システムコールを含む全てのコマンドをセキュア切替デバイスドライバ180へ出力する。セキュア切替デバイスドライバ180は、共有メモリ112上のコマンド領域に受け取ったコマンドを書き込み、切替制御部106へ切替指示を出力する。
通常OS151は、CPU102に復帰すると、共有メモリ112のコマンド領域から、セキュアメモリ113上のプログラムから出力されたコマンドを読み出す。
Each program on the secure memory 113 outputs all commands including system calls to the secure switching device driver 180. The secure switching device driver 180 writes the received command in the command area on the shared memory 112 and outputs a switching instruction to the switching control unit 106.
When the normal OS 151 returns to the CPU 102, the command output from the program on the secure memory 113 is read from the command area of the shared memory 112.

このようにして、通常OS151が、通常メモリ111及びセキュアメモリ113上の各プログラムを制御するとしてもよい。
(8)上記の実施の形態及び変形例において、切替制御部106及びメモリ保護部114は、セキュアメモリ113とバス130とを切断することで、セキュアメモリ113上のプログラム及びデータを外部のアクセスから保護している。
In this way, the normal OS 151 may control each program on the normal memory 111 and the secure memory 113.
(8) In the embodiment and the modification described above, the switching control unit 106 and the memory protection unit 114 disconnect the secure memory 113 and the bus 130 so that the programs and data on the secure memory 113 can be externally accessed. Protect.

これに代わって、メモリ保護部114が、セキュアメモリ113内のデータを暗号化及び復号することによって、保護しても良い。切替制御部106は、メモリ保護部114へ、接続指示又は切断指示に代わって、暗号化又は復号を指示する。
メモリ保護部114は、切替制御部106の指示によって、セキュアメモリ113内のデータを暗号化又は復号する。
Alternatively, the memory protection unit 114 may protect the data in the secure memory 113 by encrypting and decrypting the data. The switching control unit 106 instructs the memory protection unit 114 to perform encryption or decryption instead of a connection instruction or a disconnection instruction.
The memory protection unit 114 encrypts or decrypts data in the secure memory 113 according to an instruction from the switching control unit 106.

また、セキュアメモリ113内のデータを全てではなく、必要に応じて、音楽再生プログラム153のコード部分のみ、データ部分のみ又はスタック部分のみを暗号化するとしても良い。セキュアOS171、暗号デバイスドライバ179、セキュア入出力デバイスドライバ178などについても同様である。
(9)上記の実施の形態及び変形例では、通常OS151が、アプリ管理表166を管理し、アプリ管理表166を用いて、該当するアプリケーション及びセキュアアプリケーションと対応するプログラム(例えば音楽復号デーモン156)を呼び出している。しかし、音楽再生プログラム153と同様にセキュアアプリケーションに処理を依頼するアプリケーションが多数存在する場合、通常OS151とは別に、アプリ管理表166の管理と、プログラムの呼び出しを行うプログラムを備える構成であっても良い。このプログラムをデーモン制御プログラムと呼ぶ。
In addition, not all data in the secure memory 113 but only the code portion, only the data portion, or only the stack portion of the music playback program 153 may be encrypted as necessary. The same applies to the secure OS 171, the encryption device driver 179, the secure input / output device driver 178, and the like.
(9) In the embodiment and the modification described above, the normal OS 151 manages the application management table 166, and uses the application management table 166 to correspond to the corresponding application and the secure application (for example, the music decryption daemon 156). Is calling. However, when there are a large number of applications that request processing to the secure application as with the music playback program 153, a configuration that includes a program for managing the application management table 166 and calling the program separately from the normal OS 151. good. This program is called a daemon control program.

この場合、通常切替デバイスドライバ160は、切替制御部106から呼び出されると、通常OS151に代わって、デーモン制御プログラムを起動する。デーモン制御プログラムは、共有メモリ112から、コマンドを読み出し、読み出したコマンドに含まれる識別情報によって、該当するプログラムを呼び出す。
また、各アプリケーション及び、音楽復号デーモン156を初めとするプログラムは、通常OS151に代わって、セキュア処理要求をデーモン制御プログラムに出力する。
In this case, when the normal switching device driver 160 is called from the switching control unit 106, the normal switching device driver 160 starts the daemon control program instead of the normal OS 151. The daemon control program reads a command from the shared memory 112 and calls the corresponding program based on the identification information included in the read command.
Each application and the program including the music decryption daemon 156 output a secure processing request to the daemon control program instead of the normal OS 151.

デーモン制御プログラムは、受け取ったセキュア処理要求を共有メモリ112に書き込み、通常切替デバイスドライバ160へ、切替指示を出力する。
(10)ここまで、本発明のひとつの実施の形態として携帯電話100について説明してきたが、同様の機能を有する情報処理装置、例えばパーソナルコンピュータなどであってもよい。
The daemon control program writes the received secure processing request in the shared memory 112 and outputs a switching instruction to the normal switching device driver 160.
(10) Although the mobile phone 100 has been described as one embodiment of the present invention, an information processing apparatus having a similar function, such as a personal computer, may be used.

この場合、通常メモリ111及びセキュアメモリ113は、RAM及びハードディスクを含んで構成される。上記の説明では、セキュアOS171及び音楽復号プログラム176は暗号化されて、二次記憶部104に記憶されているが、予め、セキュアメモリ113上のハードディスク部分に記憶されているとしてもよい。
2. 実施の形態2
本発明の実施の形態2について、以下に説明する。
In this case, the normal memory 111 and the secure memory 113 include a RAM and a hard disk. In the above description, the secure OS 171 and the music decryption program 176 are encrypted and stored in the secondary storage unit 104, but may be stored in advance in the hard disk portion on the secure memory 113.
2. Embodiment 2
A second embodiment of the present invention will be described below.

図49は、本発明の実施の形態2の携帯電話400の使用例を示している。携帯電話400は、基地局15、携帯電話網10、インターネット20を介して、無効化リスト発行装置250と接続されている。
無効化リスト発行装置250は、無効化されたプログラムに係る情報を管理しており、これらのプログラムを示す無効化リストを生成し、インターネット20を介して、生成した無効化リストを携帯電話400へ送信する。
FIG. 49 shows a usage example of the mobile phone 400 according to the second embodiment of the present invention. The mobile phone 400 is connected to the invalidation list issuing device 250 via the base station 15, the mobile phone network 10, and the Internet 20.
The invalidation list issuing device 250 manages information related to invalidated programs, generates an invalidation list indicating these programs, and transmits the generated invalidation list to the mobile phone 400 via the Internet 20. Send.

携帯電話400は、無効化リスト発行装置250から無効化リストを受信し、受信した無効化リストを基に、自身の記憶しているプログラムが無効であるか否かを判断する。
2.1 無効化リスト発行装置250
無効化リスト発行装置250は、図50に示すように、通信部251、署名生成部252、鍵記憶部253、ハッシュ生成部254、制御部257、情報記憶部260、入力部262及び表示部263から構成される。
The mobile phone 400 receives the invalidation list from the invalidation list issuing device 250 and determines whether or not the program stored therein is invalid based on the received invalidation list.
2.1 Invalidation list issuing device 250
As shown in FIG. 50, the invalidation list issuing device 250 includes a communication unit 251, a signature generation unit 252, a key storage unit 253, a hash generation unit 254, a control unit 257, an information storage unit 260, an input unit 262, and a display unit 263. Consists of

無効化リスト発行装置250は、具体的には、マイクロプロセッサ、RAM、ROMを含んで構成されるコンピュータシステムである。RAM、ROMにはコンピュータプログラムが記憶されており、前記マイクロプロセッサが前記コンピュータプログラムに従って動作することにより、無効化リスト発行装置250は、その機能を達成する。
(1)情報記憶部260
情報記憶部260は、図50に示すように、OS無効化リスト266及びアプリ無効化リスト276を記憶している。
Specifically, the invalidation list issuing device 250 is a computer system including a microprocessor, a RAM, and a ROM. Computer programs are stored in the RAM and ROM, and the invalidation list issuing device 250 achieves its functions by the microprocessor operating according to the computer programs.
(1) Information storage unit 260
As shown in FIG. 50, the information storage unit 260 stores an OS invalidation list 266 and an application invalidation list 276.

OS無効化リスト266は、発行者ID267、リストID268及び無効化ID269、270、271・・・から構成される。
発行者ID267は、OS無効化リストの発行者を示しており、一例として、無効化リスト発行装置250の装置ID、無効化リスト発行装置250の管理者の識別情報などである。
The OS invalidation list 266 includes an issuer ID 267, a list ID 268, and invalidation IDs 269, 270, 271,.
The issuer ID 267 indicates the issuer of the OS revocation list. Examples of the issuer ID 267 include the device ID of the revocation list issuance device 250 and the identification information of the administrator of the revocation list issuance device 250.

リストID268は、OS無効化リスト266の新旧を示す情報であり、ここでは、OS無効化リスト266の作成日「20041015」を、リストID268としている。
無効化ID269、270、271・・・は、無効化されたオペレーティングシステムの識別情報である。
アプリ無効化リスト276は、発行者ID277、リストID278、無効化ID279、280、281・・・から構成される。発行者ID277は、アプリ無効化リストの発行者を示す情報であり、一例として、無効化リスト発行装置250の装置ID、無効化リスト発行装置250の管理者の識別情報などである。
The list ID 268 is information indicating whether the OS invalidation list 266 is new or old. Here, the creation date “2004015” of the OS invalidation list 266 is set as the list ID 268.
The invalidation IDs 269, 270, 271... Are identification information of the invalidated operating system.
The application invalidation list 276 includes an issuer ID 277, a list ID 278, an invalidation ID 279, 280, 281. The issuer ID 277 is information indicating the issuer of the application invalidation list. Examples of the issuer ID 277 include the device ID of the invalidation list issuance device 250 and the identification information of the administrator of the invalidation list issuance device 250.

リストID278は、アプリ無効化リスト276の新旧を示す情報である。ここでは、アプリ無効化リスト276の作成日「20041009」をリストID278としている。
無効化ID279、280、281・・・は、無効化されたアプリケーションの識別情報である。
The list ID 278 is information indicating whether the application invalidation list 276 is new or old. Here, the creation date “20041009” of the application invalidation list 276 is set as the list ID 278.
The invalidation IDs 279, 280, 281... Are identification information of invalidated applications.

(2)通信部251
通信部251は、インターネット20と接続されており、制御部257とインターネット20に接続されている外部機器との間で、情報の送受信を行う。ここで、外部機器とは携帯電話400である。
(3)ハッシュ生成部254
ハッシュ生成部254は、制御部257から、OS無効化リスト266とハッシュ生成指示とを受け取る。また、アプリ無効化リスト276とハッシュ生成指示とを受け取る。
(2) Communication unit 251
The communication unit 251 is connected to the Internet 20 and transmits and receives information between the control unit 257 and an external device connected to the Internet 20. Here, the external device is the mobile phone 400.
(3) Hash generation unit 254
The hash generation unit 254 receives the OS invalidation list 266 and the hash generation instruction from the control unit 257. Also, the application invalidation list 276 and the hash generation instruction are received.

ハッシュ生成指示を受け取ると、受け取ったOS無効化リスト266又はアプリ無効化リスト276をハッシュ関数に代入し160バイトのOSダイジェストデータ又はアプリダイジェストデータを生成する。ここで、ハッシュ関数には、一例としてSHA−1を用いる。ハッシュ関数SHA−1については、公知の技術であるので説明を省略する。また、他のハッシュ関数を用いても良い。   When the hash generation instruction is received, the received OS invalidation list 266 or application invalidation list 276 is substituted into a hash function to generate 160-byte OS digest data or application digest data. Here, SHA-1 is used for the hash function as an example. Since the hash function SHA-1 is a known technique, the description thereof is omitted. Other hash functions may be used.

生成した、OSダイジェストデータ又はアプリダイジェストデータを制御部257へ出力する。
(4)鍵記憶部253及び署名生成部252
鍵記憶部253は、無効化リスト発行装置250に固有の発行装置秘密鍵と、前記発行装置秘密鍵と対応する発行装置公開鍵とを記憶している。
The generated OS digest data or application digest data is output to the control unit 257.
(4) Key storage unit 253 and signature generation unit 252
The key storage unit 253 stores an issuing device private key unique to the revocation list issuing device 250 and an issuing device public key corresponding to the issuing device private key.

署名生成部252は、制御部257から、OSダイジェストデータ又はアプリダイジェストデータを受け取り、署名生成を指示される。
OSダイジェストデータを受け取り、署名生成を指示されると、鍵記憶部253から、発行装置秘密鍵を読み出し、読み出した発行装置秘密鍵を用いて、受け取ったOSダイジェストデータに署名生成アルゴリズムSを施して、署名データを生成し、生成した署名データを、制御部257へ出力する。署名生成アルゴリズムSは、一例として、楕円DSA署名、RSA(RivestShamirAdleman)署名などを用いる。
The signature generation unit 252 receives the OS digest data or the application digest data from the control unit 257, and is instructed to generate a signature.
When the OS digest data is received and the signature generation is instructed, the issuing device secret key is read from the key storage unit 253, and the received OS digest data is subjected to the signature generation algorithm S using the read issuing device secret key. The signature data is generated, and the generated signature data is output to the control unit 257. As an example, the signature generation algorithm S uses an elliptical DSA signature, an RSA (RivestShamirAdleman) signature, or the like.

アプリダイジェストデータを受け取り、署名生成を指示された場合についても同様にして署名データを生成し、制御部257へ出力する。
(5)制御部257
制御部257は、通信部251及びインターネット20を介して携帯電話400から、最新のOS無効化リスト及びアプリ無効化リストの送信を要求するリスト要求を受信する。
When application digest data is received and signature generation is instructed, signature data is similarly generated and output to the control unit 257.
(5) Control unit 257
The control unit 257 receives a list request for requesting transmission of the latest OS invalidation list and application invalidation list from the mobile phone 400 via the communication unit 251 and the Internet 20.

リスト要求を受信すると、情報記憶部260からOS無効化リスト266を読み出し、読み出したOS無効化リスト266をハッシュ生成部254へ出力し、ハッシュ生成指示を出力する。次に、ハッシュ生成部254から、OSダイジェストデータを受け取る。受け取ったOSダイジェストデータを署名生成部252へ出力し署名生成を指示する。次に、署名生成部252から署名データを受け取る。受け取った署名データを、OS無効化リスト266に付加して、署名付OS無効化リストを生成する。   When the list request is received, the OS invalidation list 266 is read from the information storage unit 260, the read OS invalidation list 266 is output to the hash generation unit 254, and a hash generation instruction is output. Next, OS digest data is received from the hash generation unit 254. The received OS digest data is output to the signature generation unit 252 to instruct signature generation. Next, signature data is received from the signature generation unit 252. The received signature data is added to the OS invalidation list 266 to generate a signed OS invalidation list.

アプリ無効化リスト276についても同様にして、ハッシュ生成部254及び署名生成部252へ指示して署名データを生成する。生成した署名データをアプリ無効化リスト276に付加して、署名付アプリ無効化リストを生成する。
次に、通信部251及びインターネット20を介して携帯電話400へ、生成した署名付OS無効化リストと署名付アプリ無効化リストとを送信する。
Similarly, the application invalidation list 276 instructs the hash generation unit 254 and the signature generation unit 252 to generate signature data. The generated signature data is added to the application invalidation list 276 to generate a signed application invalidation list.
Next, the generated signed OS invalidation list and signed application invalidation list are transmitted to the mobile phone 400 via the communication unit 251 and the Internet 20.

また、制御部257は、入力部262を介して、操作者による各種の指示及びデータを受け取り、受け取った指示に従って動作する。
(6)入力部262及び表示部263
入力部262は、無効化リスト発行装置250の操作者による指示及びデータの入力を受け付け、受け付けた指示及びデータを制御部257へ出力する。
The control unit 257 receives various instructions and data from the operator via the input unit 262, and operates according to the received instructions.
(6) Input unit 262 and display unit 263
The input unit 262 receives an instruction and data input from the operator of the invalidation list issuing device 250 and outputs the received instruction and data to the control unit 257.

表示部263は、制御部257の指示により各種の画面を表示する。
2.2 携帯電話400
携帯電話400のハード構成は、図2に示す携帯電話100の構成とほぼ同様であり、デバッガIF、CPU、MMU、二次記憶部、切替制御部106、割込コントローラ、入力部、表示部、通常メモリ、共有メモリ、セキュアメモリ413、メモリ保護部414、入出力部、暗号処理デバイス、無線通信制御部、マイク、スピーカ、通信部、バッファ、符号処理部、D/A変換部から構成される。
The display unit 263 displays various screens according to instructions from the control unit 257.
2.2 Mobile phone 400
The hardware configuration of the mobile phone 400 is substantially the same as the configuration of the mobile phone 100 shown in FIG. 2, and includes a debugger IF, CPU, MMU, secondary storage unit, switching control unit 106, interrupt controller, input unit, display unit, Consists of normal memory, shared memory, secure memory 413, memory protection unit 414, input / output unit, cryptographic processing device, wireless communication control unit, microphone, speaker, communication unit, buffer, code processing unit, and D / A conversion unit .

セキュアメモリ413、メモリ保護部414以外の各部については、携帯電話100と同様であるので、詳細な説明を省略し、ここでは、携帯電話100と異なる部分についてのみ説明する。
(1)セキュアメモリ413
セキュアメモリ413は、図51に示すように、音楽復号プログラム446、セキュアOS441などの各種のプログラムを記憶している。
Since each unit other than the secure memory 413 and the memory protection unit 414 is the same as that of the mobile phone 100, detailed description thereof will be omitted, and only portions different from the mobile phone 100 will be described here.
(1) Secure memory 413
As shown in FIG. 51, the secure memory 413 stores various programs such as a music decryption program 446 and a secure OS 441.

音楽復号プログラム446は、実施の形態1の音楽復号プログラム176と同様に、暗号化音楽データの復号の手順を含んでおり、この手順については、説明を省略する。
音楽復号プログラム446は、ヘッダ部分にアプリID447及び無効フラグ448を含んでいる。アプリID447は、音楽復号プログラム446に固有の識別情報である。無効フラグ448は、音楽復号プログラム446が、無効化されているか否かを示すフラグであり、無効フラグ「1」は、音楽復号プログラム446が無効化されていることを示しており、無効フラグ「0」は、無効化されていないことを示す。
Similar to the music decryption program 176 of the first embodiment, the music decryption program 446 includes a procedure for decrypting encrypted music data, and the description of this procedure is omitted.
The music decryption program 446 includes an application ID 447 and an invalid flag 448 in the header portion. The application ID 447 is identification information unique to the music decryption program 446. The invalid flag 448 is a flag indicating whether or not the music decryption program 446 has been invalidated, and the invalid flag “1” represents that the music decryption program 446 has been invalidated. “0” indicates that it is not invalidated.

セキュアOS441は、実施の形態1のセキュアOS171と同様の処理を実行する本ソフトウェアであるので、セキュアOS441の動作については説明を省略する。ただし、セキュアOS441は、セキュアメモリ413上の各アプリケーションを起動又はCPUに復帰させる際に、各アプリケーションのヘッダ部分の無効フラグを読み出し、無効フラグが「1」である場合、そのアプリケーションの起動又は復帰を中止する。   Since the secure OS 441 is this software that executes the same processing as the secure OS 171 of the first embodiment, description of the operation of the secure OS 441 is omitted. However, when starting each application on the secure memory 413 or returning the CPU to the secure OS 441, the secure OS 441 reads the invalid flag in the header portion of each application. If the invalid flag is “1”, the secure OS 441 starts or returns the application. Cancel.

セキュアOS441は、ヘッダ部分にセキュアOSID442及び無効フラグ443を含んでいる。
セキュアOSID442は、セキュアOS171をと対応する識別情報である。無効フラグ443は、セキュアOS441が無効化されているか否かを示すフラグであり、無効フラグ「1」は、音楽復号プログラム446が無効化されていることを示しており、無効フラグ「0」は、無効化されていないことを示す。
The secure OS 441 includes a secure OSID 442 and an invalid flag 443 in the header portion.
The secure OS ID 442 is identification information corresponding to the secure OS 171. The invalid flag 443 is a flag indicating whether or not the secure OS 441 has been invalidated. The invalid flag “1” represents that the music decryption program 446 has been invalidated, and the invalid flag “0” Indicates that it has not been disabled.

また、本実施の形態において、セキュアメモリ413上にロードされ切替処理を行うセキュア切替デバイスドライバは、セキュアOS441のコンテキストをCPUに復帰させる前に、セキュアOS441の無効フラグ443を読み出し、無効フラグが「1」であった場合には、セキュアOS441の復帰を中止する。
(2)メモリ保護部414
メモリ保護部414は、図51に示すように、無効化リスト記憶部421、無効化リスト更新部424、アプリ検証部428、アプリ無効化部429、OS検証部431及びOS無効化部432から構成される。
In this embodiment, the secure switching device driver that is loaded onto the secure memory 413 and performs the switching process reads the invalid flag 443 of the secure OS 441 before returning the context of the secure OS 441 to the CPU, and the invalid flag is “ If “1”, the return of the secure OS 441 is stopped.
(2) Memory protection unit 414
As shown in FIG. 51, the memory protection unit 414 includes an invalidation list storage unit 421, an invalidation list update unit 424, an application verification unit 428, an application invalidation unit 429, an OS verification unit 431, and an OS invalidation unit 432. Is done.

<無効化リスト記憶部421>
無効化リスト記憶部421は、アプリ無効化リスト422及びOS無効化リスト423を記憶している。
アプリ無効化リスト422及びOS無効化リスト423は、それぞれ、無効化リスト発行装置250の情報記憶部260に記憶されているアプリ無効化リスト276及びOS無効化リスト266と同様の構成である。
<Invalidation list storage unit 421>
The invalidation list storage unit 421 stores an application invalidation list 422 and an OS invalidation list 423.
The application invalidation list 422 and the OS invalidation list 423 have the same configurations as the application invalidation list 276 and the OS invalidation list 266 stored in the information storage unit 260 of the invalidation list issuing device 250, respectively.

<無効化リスト更新部424>
無効化リスト更新部424は、予め、署名検証鍵426を記憶している。署名検証鍵426は、無効化リスト発行装置250の鍵記憶部253に記憶されている発行装置公開鍵と同一の鍵である。
無効化リスト更新部424は、切替制御部106から、セキュアメモリ413とバス130との接続を指示する接続指示を受け取る。接続指示を受け取ると、無線通信制御部、通信部を介して、最新のアプリ無効化リスト及びOS無効化リストの送信を要求するリスト要求を、無効化リスト発行装置250へ送信する。
<Invalidation list update unit 424>
The invalidation list update unit 424 stores a signature verification key 426 in advance. The signature verification key 426 is the same key as the issuing device public key stored in the key storage unit 253 of the revocation list issuing device 250.
The invalidation list update unit 424 receives a connection instruction for instructing connection between the secure memory 413 and the bus 130 from the switching control unit 106. When the connection instruction is received, a list request for requesting transmission of the latest application invalidation list and OS invalidation list is transmitted to the invalidation list issuing device 250 via the wireless communication control unit and the communication unit.

次に、無線通信制御部、通信部を介して、無効化リスト発行装置250から、署名付OS無効化リストと署名付アプリ無効化リストとを受信する。
受信した署名付OS無効化リストの署名データに、署名検証鍵を用いて、署名検証を行う。具体的には、署名データに、署名検証鍵を用いて、署名検証アルゴリズムVを施してチェックデータを生成する。署名検証アルゴリズムVは、署名生成アルゴリズムSによって生成された署名データを検証するアルゴリズムである。
Next, the signed OS invalidation list and the signed application invalidation list are received from the invalidation list issuing device 250 via the wireless communication control unit and the communication unit.
Signature verification is performed on the received signature data of the signed OS revocation list using a signature verification key. Specifically, check data is generated by applying a signature verification algorithm V to the signature data using a signature verification key. The signature verification algorithm V is an algorithm for verifying signature data generated by the signature generation algorithm S.

次に、受信したOS無効化リストをハッシュ関数に代入し、OSダイジェストデータを生成する。生成したチェックデータとダイジェストデータとを比較し、両者が一致する場合、署名検証が成功であると判断し、一致しない場合、失敗であると判断する。署名検証に失敗した場合には、以下に説明する、リストIDの比較及びOS無効化リストの更新を中止する。   Next, the received OS invalidation list is substituted into a hash function to generate OS digest data. The generated check data and digest data are compared, and if they match, it is determined that the signature verification is successful, and if they do not match, it is determined that the verification is unsuccessful. When signature verification fails, comparison of list IDs and update of the OS invalidation list, which will be described below, are stopped.

受信した署名付アプリ無効化リストについても、同様にして署名検証を行う。署名検証が失敗であった場合には、以下に説明するアプリIDの比較及びアプリ無効化リストの更新を中止する。
次に、受信したOS無効化リストと、無効化リスト記憶部421の記憶しているOS無効化リスト423とに含まれるリストIDを比較する。両者が同一であれば、受信したOS無効化リストを破棄する。受信したOS無効化リストのリストIDが、無効化リスト記憶部421の記憶しているOS無効化リスト423のリストIDよりも新しい日付を示していれば、無効化リスト記憶部421の記憶しているOS無効化リスト423を、受信したOS無効化リストにより更新する。
The signature verification is similarly performed on the received signed application invalidation list. If the signature verification is unsuccessful, the comparison of the application ID and update of the application invalidation list described below are stopped.
Next, the list IDs included in the received OS invalidation list and the OS invalidation list 423 stored in the invalidation list storage unit 421 are compared. If both are the same, the received OS invalidation list is discarded. If the received OS invalidation list list ID indicates a newer date than the list ID of the OS invalidation list 423 stored in the invalidation list storage unit 421, the invalidation list storage unit 421 stores the date. The existing OS invalidation list 423 is updated with the received OS invalidation list.

アプリ無効化リストについても、同様にして、受信したアプリ無効化リストと、無効化リスト記憶部421の記憶しているアプリ無効化リスト422の新旧を比較し、アプリ無効化リスト422の方が古い場合は、受信したアプリ無効化リストにより、無効化リスト記憶部421内のアプリ無効化リスト422を更新する。
<OS検証部431及びOS無効化部432>
OS検証部431は、セキュアOS441のヘッダ部分からセキュアOSID442を読み出す。次に、無効化リスト記憶部421からOS無効化リスト423を読み出し、読み出したセキュアOSID442が、OS無効化リスト423の無効IDに含まれているか否かを判断する。セキュアOSID442が、OS無効化リスト423に含まれている場合には、セキュアOS441が無効であると判断し、OS無効化部432へ無効化を指示する。
Similarly, for the application invalidation list, the received application invalidation list is compared with the old and new of the application invalidation list 422 stored in the invalidation list storage unit 421, and the application invalidation list 422 is older. In this case, the application invalidation list 422 in the invalidation list storage unit 421 is updated with the received application invalidation list.
<OS verification unit 431 and OS invalidation unit 432>
The OS verification unit 431 reads the secure OSID 442 from the header portion of the secure OS 441. Next, the OS revocation list 423 is read from the revocation list storage unit 421, and it is determined whether or not the read secure OSID 442 is included in the invalidation ID of the OS revocation list 423. If the secure OS ID 442 is included in the OS invalidation list 423, it is determined that the secure OS 441 is invalid, and the OS invalidation unit 432 is instructed to invalidate.

セキュアOSID442が、OS無効化リスト423に含まれていなければ、有効であると判断する。
OS無効化部432は、OS検証部431から無効化を指示され、セキュアOS441のヘッダ部分の無効フラグを「1」に書き換える。
<アプリ検証部428及びアプリ無効化部429>
アプリ検証部428は、セキュアメモリ413上の音楽復号プログラム446のヘッダ部分からアプリID447を読み出す。次に、無効化リスト記憶部421からアプリ無効化リスト422を読み出し、アプリID447がアプリ無効化リスト422に含まれているか否かを判断する。アプリID447がアプリ無効化リスト422に含まれている場合、音楽復号プログラム446が無効なプログラムであると判断し、アプリ無効化部429へ無効化を指示する。
If the secure OSID 442 is not included in the OS invalidation list 423, it is determined to be valid.
The OS invalidation unit 432 receives an invalidation instruction from the OS verification unit 431 and rewrites the invalid flag in the header portion of the secure OS 441 to “1”.
<Application Verification Unit 428 and Application Invalidation Unit 429>
The application verification unit 428 reads the application ID 447 from the header portion of the music decryption program 446 on the secure memory 413. Next, the application invalidation list 422 is read from the invalidation list storage unit 421, and it is determined whether or not the application ID 447 is included in the application invalidation list 422. When the application ID 447 is included in the application invalidation list 422, it is determined that the music decryption program 446 is an invalid program, and the application invalidation unit 429 is instructed to be invalidated.

アプリID447がアプリ無効化リストに含まれていなければ、音楽復号プログラム446が有効なプログラムであると判断する。
アプリ無効化部429は、アプリ検証部428から、無効化の指示を受け、音楽復号プログラム446の無効フラグを「1」に設定する。
セキュアメモリ413上に、複数のアプリケーションが存在する場合、全てのアプリケーションについて、アプリ検証部428及びアプリ無効化部429は、同様にして、アプリケーションが無効であるか否かの判断、無効であった場合の無効フラグの設定を繰り返す。
If the application ID 447 is not included in the application invalidation list, it is determined that the music decryption program 446 is a valid program.
The application invalidation unit 429 receives an invalidation instruction from the application verification unit 428 and sets the invalid flag of the music decryption program 446 to “1”.
When there are a plurality of applications on the secure memory 413, the application verification unit 428 and the application invalidation unit 429 similarly determine whether or not the application is invalid for all applications. Repeat the setting of the invalid flag.

(3)メモリ保護部の検証動作
図52〜53に示すフローチャートを用いて、メモリ保護部414によるプログラムの検証動作について、説明する。
切替制御部106から、接続指示を受ける(ステップS671)。接続指示を受け取ると、無効化リスト更新部424は、無線通信制御部118及び通信部121を介して無効化リスト発行装置250へ、リスト要求を送信する(ステップS672)。次に、通信部及び無線通信制御部を介して、署名付OS無効化リストと署名付アプリ無効化リストとを取得する(ステップS673)。
(3) Memory Protection Unit Verification Operation The program verification operation by the memory protection unit 414 will be described with reference to the flowcharts shown in FIGS.
A connection instruction is received from the switching control unit 106 (step S671). Upon receiving the connection instruction, the invalidation list update unit 424 transmits a list request to the invalidation list issuing device 250 via the wireless communication control unit 118 and the communication unit 121 (step S672). Next, a signed OS invalidation list and a signed application invalidation list are acquired via the communication unit and the wireless communication control unit (step S673).

無効化リスト更新部424は、署名検証鍵426を読み出し、読み出した署名検証鍵を用いて、取得した署名付OS無効化リスト及び署名付アプリ無効化リストの署名検証を行う(ステップS674)。署名検証が失敗であれば(ステップS676のNO)、OS検証部によるステップS681へ処理を移す。
署名検証が成功であれば(ステップS676のYES)、無効化リスト記憶部に記憶されているOS無効化リスト423及びアプリ無効化リスト422のリストIDを読み出す(ステップS677)。読み出したOS無効化リスト423リストIDと、受信したOS無効化リストのリストIDと比較し、アプリ無効化リスト422のリストIDと受信したアプリ無効化リストのリストIDを比較することで、OS無効化リスト423及びアプリ無効化リスト422が最新版であるか否かを判断する(ステップS678)。最新版でないと判断すると(ステップS678のNO)、受信したOS無効化リスト及び受信したアプリ無効化リストにより、無効化リスト記憶部421に記憶されているOS無効化リスト423及びアプリ無効化リスト422を更新する(ステップS679)。
The revocation list update unit 424 reads the signature verification key 426, and uses the read signature verification key to perform signature verification of the obtained signed OS revocation list and signed application revocation list (step S674). If signature verification fails (NO in step S676), the process proceeds to step S681 by the OS verification unit.
If the signature verification is successful (YES in step S676), the list IDs of the OS invalidation list 423 and the application invalidation list 422 stored in the invalidation list storage unit are read (step S677). By comparing the read OS invalidation list 423 list ID with the list ID of the received OS invalidation list, and comparing the list ID of the application invalidation list 422 with the list ID of the received application invalidation list, OS invalidation It is determined whether the activation list 423 and the application invalidation list 422 are the latest version (step S678). If it is determined that it is not the latest version (NO in step S678), the OS invalidation list 423 and the application invalidation list 422 stored in the invalidation list storage unit 421 are determined based on the received OS invalidation list and the received application invalidation list. Is updated (step S679).

最新版であると判断すると(ステップS678のYES)、ステップS679の処理を省略する。
ステップS672〜679の無効化リスト更新部424による処理が終了すると、OS検証部431は、セキュアメモリ413から、セキュアOSID442を読み出し(ステップS681)、読み出したセキュアOSID442が、OS無効化リスト423に登録されているか否かによって、セキュアOS441が無効であるか有効であるかを判定する(ステップS682)。
If it is determined that it is the latest version (YES in step S678), the process in step S679 is omitted.
When the processing by the invalidation list update unit 424 in steps S672 to 679 is completed, the OS verification unit 431 reads the secure OSID 442 from the secure memory 413 (step S681), and the read secure OSID 442 is registered in the OS invalidation list 423. Whether the secure OS 441 is invalid or valid is determined based on whether or not it has been established (step S682).

有効であると判定すると(ステップS683のYES)、アプリ検証部428によるステップS686の処理に移る。
無効であると判断されると(ステップS683のNO)、OS無効化部432は、セキュアOS441の無効フラグ443を「1」に設定する(ステップS684)。
OS検証部431及びOS無効化部432によるステップS684までの処理が終了すると、アプリ検証部428は、セキュアメモリ413上の音楽復号プログラム446のアプリID447を読み出し(ステップS686)、読み出したアプリIDがアプリ無効化リスト422に登録されているか否かによって、音楽復号プログラム446が有効であるか無効であるかを判定する(ステップS687)。
If it is determined to be valid (YES in step S683), the process proceeds to step S686 by the application verification unit 428.
If it is determined to be invalid (NO in step S683), the OS invalidation unit 432 sets the invalid flag 443 of the secure OS 441 to “1” (step S684).
When the processing up to step S684 by the OS verification unit 431 and the OS invalidation unit 432 is completed, the application verification unit 428 reads the application ID 447 of the music decryption program 446 on the secure memory 413 (step S686), and the read application ID is Whether the music decryption program 446 is valid or invalid is determined based on whether or not it is registered in the application invalidation list 422 (step S687).

有効であると判定されると(ステップS688のYES)、検証処理を終了する。無効であると判定されると(ステップS688のNO)、アプリ無効化部429は、音楽復号プログラム446の無効フラグを「1」に設定する(ステップS689)。
2.3 まとめ・効果
以上、説明してきたように、本実施の形態の携帯電話400は、無効化リスト発行装置250から、随時最新のOS無効化リスト及びアプリ無効化リストを取得する。取得したOS無効化リスト及びアプリ無効化リストを基に、自身の記憶しているセキュアOS441、音楽復号プログラム446を初めとするセキュアメモリ413上にロードされているアプリケーションが有効であるか否かを判断し、無効化されているプログラムの実行を中止する。
If it is determined to be valid (YES in step S688), the verification process is terminated. If it is determined to be invalid (NO in step S688), the application invalidation unit 429 sets the invalid flag of the music decryption program 446 to “1” (step S689).
2.3 Summary / Effects As described above, the mobile phone 400 according to the present embodiment acquires the latest OS invalidation list and application invalidation list from the invalidation list issuing device 250 as needed. Based on the acquired OS invalidation list and application invalidation list, whether or not an application loaded on the secure memory 413 including the secure OS 441 and the music decryption program 446 stored therein is valid is stored. Judgment is made and execution of the disabled program is stopped.

このような構成にすることで、携帯電話400が発売された後、後発的に無効化すべきであることが判明したプログラムについても、その実行を中断することが可能となり、不正なプログラムの実行による、データの不正使用を防止することができる。
2.4 実施の形態2の変形例1
本発明の実施の形態2について、以下のような構成であっても良い。
(1)無効化リスト発行装置250
無効化リスト発行装置250は、OS無効化リスト及びアプリ無効化リストを記憶しているが、OS無効化リストは、無効化ID269、270、271・・・に代わって、無効化されたオペレーティングシステムのセキュアOS証明書(後述する)の証明書IDを含んで構成される。
By adopting such a configuration, it becomes possible to interrupt the execution of a program that has been found to be invalidated later after the mobile phone 400 is released. Can prevent unauthorized use of data.
2.4 Modification 1 of Embodiment 2
The second embodiment of the present invention may have the following configuration.
(1) Invalidation list issuing device 250
The invalidation list issuing device 250 stores an OS invalidation list and an application invalidation list. The OS invalidation list is an invalidated operating system in place of the invalidation IDs 269, 270, 271,. And a certificate ID of a secure OS certificate (to be described later).

アプリ無効化リストについても、無効化ID279、280、281・・・に代わって、無効化されたアプリケーションのアプリ証明書(後述する)の証明書IDを含んで構成される。
(2)携帯電話400
携帯電話400は、メモリ保護部414に代わってメモリ保護部454を備え、セキュアメモリ413に代わってセキュアメモリ453を備えている。メモリ保護部414が、セキュアメモリ413上の各プログラムに固有のIDによって、各プログラムが有効であるか無効であるかを判定する代わりに、メモリ保護部454は、セキュアメモリ453上の各プログラムに固有の証明書を用いて判定する。
The application revocation list is also configured to include certificate IDs of application certificates (to be described later) of revoked applications instead of the revocation IDs 279, 280, 281.
(2) Mobile phone 400
The mobile phone 400 includes a memory protection unit 454 instead of the memory protection unit 414, and includes a secure memory 453 instead of the secure memory 413. Instead of the memory protection unit 414 determining whether each program is valid or invalid based on an ID unique to each program on the secure memory 413, the memory protection unit 454 stores each program on the secure memory 453. Judge using a unique certificate.

以下に、この機能を実現する構成について説明する。
(2−1)セキュアメモリ453
セキュアメモリ453は、一例として、図54に示すように、音楽復号プログラム476、セキュアOS481を含んでいる。
セキュアOS481は、ヘッダ部分に、セキュアOS証明書482及び無効フラグ483を含んでいる。
Below, the structure which implement | achieves this function is demonstrated.
(2-1) Secure memory 453
As an example, the secure memory 453 includes a music decryption program 476 and a secure OS 481 as shown in FIG.
The secure OS 481 includes a secure OS certificate 482 and an invalid flag 483 in the header portion.

セキュアOS証明書482は、X.509に従った公開鍵証明書であり、図55に示すように、発行者ID484、証明書ID487、セキュアOS公開鍵488、署名アルゴリズム489及びCA署名491を含んで構成される。
発行者ID484は、セキュアOS証明書482の発行元である認証局(以下、CA:Certificate Authorityと呼ぶ)の識別子である。セキュアOS公開鍵488は、セキュアOS証明書482によって正当性を証明されるセキュアOS481に固有の公開鍵である。署名アルゴリズム489は、CA署名491の生成に使用されたアルゴリズムを示す識別情報である。CA署名491は、セキュアOS証明書482の発行元であるCAの秘密鍵を用いて、上記の発行者ID484、証明書ID487・・・に、署名アルゴリズム489の示すアルゴリズムS1を施して生成された署名データである。
The secure OS certificate 482 is an X. As shown in FIG. 55, the public key certificate includes an issuer ID 484, a certificate ID 487, a secure OS public key 488, a signature algorithm 489, and a CA signature 491.
The issuer ID 484 is an identifier of a certificate authority (hereinafter referred to as CA: Certificate Authority) that is the issuer of the secure OS certificate 482. The secure OS public key 488 is a public key unique to the secure OS 481 whose validity is proved by the secure OS certificate 482. The signature algorithm 489 is identification information indicating the algorithm used to generate the CA signature 491. The CA signature 491 is generated by applying the algorithm S1 indicated by the signature algorithm 489 to the above-described issuer ID 484, certificate ID 487,... Using the secret key of the CA that is the issuer of the secure OS certificate 482. It is signature data.

無効フラグ483は、セキュアOS481が有効であるか無効であるかを示している。
音楽復号プログラム476は、そのヘッダ部分にアプリ証明書477と無効フラグ478とを含んでいる。
アプリ証明書477は、図55のセキュアOS公開鍵488を、アプリ公開鍵に置き換えた構成である。
The invalid flag 483 indicates whether the secure OS 481 is valid or invalid.
The music decryption program 476 includes an application certificate 477 and an invalid flag 478 in its header portion.
The application certificate 477 has a configuration in which the secure OS public key 488 in FIG. 55 is replaced with an application public key.

無効フラグ478は、音楽復号プログラム476が無効であるか有効であるかを示している。
(2−2)メモリ保護部454
メモリ保護部454は、図54に示すように、無効化リスト記憶部461、無効化リスト更新部424、鍵格納部464、アプリ検証部468、アプリ無効化部429、OS検証部471及びOS無効化部432から構成される。
The invalid flag 478 indicates whether the music decoding program 476 is invalid or valid.
(2-2) Memory protection unit 454
As shown in FIG. 54, the memory protection unit 454 includes an invalidation list storage unit 461, an invalidation list update unit 424, a key storage unit 464, an application verification unit 468, an application invalidation unit 429, an OS verification unit 471, and an OS invalidation. The configuration unit 432 is configured.

無効化リスト更新部424、OS無効化部432及びアプリ無効化部429の動作は、上記の実施の形態2の無効化リスト更新部424、OS無効化部432及びアプリ無効化部429と同様であるので、ここでは説明を省略する。
<無効化リスト記憶部461>
無効化リスト記憶部461は、図54に示すようにOS無効化リスト463及びアプリ無効化リスト462を含んでいる。
The operations of the invalidation list update unit 424, the OS invalidation unit 432, and the application invalidation unit 429 are the same as those of the invalidation list update unit 424, the OS invalidation unit 432, and the application invalidation unit 429 of the second embodiment. Since there is, explanation is omitted here.
<Invalidation list storage unit 461>
The invalidation list storage unit 461 includes an OS invalidation list 463 and an application invalidation list 462 as shown in FIG.

OS無効化リスト463は、無効化リスト発行装置250の記憶しているOS無効化リストと同様の構成であり、無効化されたオペレーティングシステムの証明書IDを含んでいる。
アプリ無効化リスト462は、無効化リスト発行装置250の記憶しているアプリ無効化リストと同様の構成であり、無効化されたアプリケーションの証明書IDを含んでいる。
The OS revocation list 463 has the same configuration as the OS revocation list stored in the revocation list issuance apparatus 250 and includes a certificate ID of the revoked operating system.
The application invalidation list 462 has the same configuration as the application invalidation list stored in the invalidation list issuing apparatus 250, and includes the certificate ID of the invalidated application.

<鍵格納部464>
鍵格納部464は、CA公開鍵466を記憶している。CA公開鍵466は、セキュアOS証明書482及びアプリ証明書477の発行元であるCAの公開鍵であり、セキュアOS証明書482及びアプリ証明書477に含まれるCA署名の生成に用いられたCAの秘密鍵と対になる鍵である。
<Key storage unit 464>
The key storage unit 464 stores a CA public key 466. The CA public key 466 is the public key of the CA that is the issuer of the secure OS certificate 482 and the application certificate 477, and the CA used for generating the CA signature included in the secure OS certificate 482 and the application certificate 477. It is a key that is paired with the secret key.

<OS検証部471>
OS検証部471は、無効化リスト更新部424によるOS無効化リスト及びアプリ無効化リストの更新の処理が終了すると、セキュアメモリ453から、セキュアOS481に含まれるセキュアOS証明書482を読み出す。鍵格納部464からCA公開鍵466を読み出し、読み出したCA公開鍵466を用いて、セキュアOS証明書482に含まれるCA署名491に署名検証アルゴリズムV1を施して署名検証を行う。署名検証アルゴリズムV1は、署名生成アルゴリズムS1により生成された署名データを検証するアルゴリズムである。
<OS verification unit 471>
When the revocation list update unit 424 finishes updating the OS revocation list and the application revocation list, the OS verification unit 471 reads the secure OS certificate 482 included in the secure OS 481 from the secure memory 453. The CA public key 466 is read from the key storage unit 464, and the signature verification is performed by applying the signature verification algorithm V1 to the CA signature 491 included in the secure OS certificate 482 using the read CA public key 466. The signature verification algorithm V1 is an algorithm for verifying the signature data generated by the signature generation algorithm S1.

署名検証の結果が失敗であれば、以降の処理を中止し、OS無効化部432へ、セキュアOS481の無効化を指示する。
署名検証の結果が成功であれば、次に、セキュアOS証明書482に含まれる証明書ID487が、OS無効化リスト463に登録されているか否かによって、セキュアOS481が無効であるか否かを判定する。登録されていれば、セキュアOS481が無効なプログラムであると判定し、OS無効化部432へ、セキュアOS481の無効化を指示する。
If the signature verification result is unsuccessful, the subsequent processing is stopped and the OS invalidation unit 432 is instructed to invalidate the secure OS 481.
If the signature verification result is successful, whether or not the secure OS 481 is invalid is determined based on whether or not the certificate ID 487 included in the secure OS certificate 482 is registered in the OS revocation list 463. judge. If registered, it is determined that the secure OS 481 is an invalid program, and the OS invalidation unit 432 is instructed to invalidate the secure OS 481.

登録されていなければ、OS検証部471は、セキュアOS481が、有効なプログラムであると判定する。
なお、本実施の形態において、セキュアOS証明書482の署名検証を行い、署名検証が成功の場合に、証明書ID487が、OS無効化リスト463に登録されているか否かを判定しているが、証明書ID487が、OS無効化リスト463に登録されているか否かを判定し、登録されていない場合に、署名検証を行うとしてもよい。
If not registered, the OS verification unit 471 determines that the secure OS 481 is a valid program.
In the present embodiment, signature verification of the secure OS certificate 482 is performed, and if the signature verification is successful, it is determined whether or not the certificate ID 487 is registered in the OS revocation list 463. Whether or not the certificate ID 487 is registered in the OS revocation list 463 is determined. If the certificate ID 487 is not registered, signature verification may be performed.

<アプリ検証部468>
アプリ検証部468は、OS検証部471によるセキュアOS481の検証が終了すると、セキュアメモリ453から、音楽復号プログラム476に含まれるアプリ証明書477を読み出す。鍵格納部464からCA公開鍵466を読み出し、読み出したCA公開鍵466を用いて、アプリ証明書477に含まれるCA署名に署名検証アルゴリズムV1を施して署名検証を行う。
<App verification unit 468>
When the verification of the secure OS 481 by the OS verification unit 471 is completed, the application verification unit 468 reads the application certificate 477 included in the music decryption program 476 from the secure memory 453. The CA public key 466 is read from the key storage unit 464, and the signature verification is performed by applying the signature verification algorithm V1 to the CA signature included in the application certificate 477 using the read CA public key 466.

署名検証の結果が失敗であれば、以降の処理を中止し、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
署名検証の結果が成功であれば、次に、アプリ証明書477に含まれる証明書IDが、アプリ無効化リスト462に登録されているか否かによって、音楽復号プログラム476が無効であるか否かを判定する。登録されていれば、音楽復号プログラム476が無効なプログラムであると判定し、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
If the signature verification result is unsuccessful, the subsequent processing is stopped and the application invalidation unit 429 is instructed to invalidate the music decryption program 476.
If the result of the signature verification is successful, whether or not the music decryption program 476 is invalid depending on whether the certificate ID included in the application certificate 477 is registered in the application invalidation list 462 or not. Determine. If registered, it is determined that the music decryption program 476 is an invalid program, and the application invalidation unit 429 is instructed to invalidate the music decryption program 476.

登録されていなければ、音楽復号プログラム476は、有効なプログラムであると判定する。
なお、上記の署名検証と証明書IDが、アプリ無効化リスト462に登録されているか否かの判定の順序は逆でもよい。
2.5 実施の形態2の変形例2
上記の変形例1において、音楽復号プログラム476は、階層構造を構成する複数の証明書を含んでいるとしても良い。
If not registered, the music decryption program 476 is determined to be an effective program.
Note that the order of determining whether or not the signature verification and the certificate ID are registered in the application invalidation list 462 may be reversed.
2.5 Modification 2 of Embodiment 2
In the first modification, the music decryption program 476 may include a plurality of certificates constituting a hierarchical structure.

図56は、音楽復号プログラム476の有する複数の証明書の構成及び、これらの証明書の階層構造を表している。
音楽復号プログラム476は、図56に示すように、アプリ証明書501、メーカー証明書511及びCA証明書521を含んでいる。
アプリ証明書501は、発行元502、証明書ID503、アプリ公開鍵504、署名アルゴリズム506及びメーカー署名508を含んで構成される。
FIG. 56 shows the configuration of a plurality of certificates included in the music decryption program 476 and the hierarchical structure of these certificates.
As shown in FIG. 56, the music decryption program 476 includes an application certificate 501, a manufacturer certificate 511, and a CA certificate 521.
The application certificate 501 includes an issuer 502, a certificate ID 503, an application public key 504, a signature algorithm 506, and a manufacturer signature 508.

発行元502は、アプリ証明書501の発行元であるアプリメーカーを示す識別情報である。図56には説明の便宜上「アプリメーカー」と記載している。証明書ID503は、アプリ証明書501に固有の識別情報である。アプリ公開鍵504は、音楽復号プログラム476に固有の公開鍵であり、アプリ証明書501によって、その正当性を証明される。署名アルゴリズム506は、メーカー署名508の生成に使用された署名生成アルゴリズムを示す識別情報である。メーカー署名508は、音楽復号プログラム476の製造メーカーに固有のアプリメーカー秘密鍵519を用いて、発行元502、証明書ID503、アプリ公開鍵504、署名アルゴリズム506などのアプリ証明書501に含まれる情報に、署名生成アルゴリズムS2を施して生成された署名データである。   The issuer 502 is identification information indicating the application maker that is the issuer of the application certificate 501. In FIG. 56, “application maker” is described for convenience of explanation. The certificate ID 503 is identification information unique to the application certificate 501. The application public key 504 is a public key unique to the music decryption program 476, and its validity is proved by the application certificate 501. The signature algorithm 506 is identification information indicating the signature generation algorithm used to generate the manufacturer signature 508. The manufacturer signature 508 is information included in the application certificate 501 such as an issuer 502, a certificate ID 503, an application public key 504, and a signature algorithm 506 using an application maker private key 519 unique to the manufacturer of the music decryption program 476. And signature data generated by applying the signature generation algorithm S2.

メーカー証明書511は、発行元512、証明書ID513、メーカー公開鍵514、署名アルゴリズム516及びCA署名518を含んで構成される。
発行元512は、メーカー証明書511の発行元であるCAを示す識別情報である。図56には説明の便宜上「CA」と記載している。証明書ID513は、メーカー証明書511に固有の識別情報である。メーカー公開鍵514は、音楽復号プログラム476の製造メーカーの公開鍵であり、メーカー証明書511によって、その正当性を証明される。メーカー公開鍵514は、アプリメーカー秘密鍵519と対応する鍵である。署名アルゴリズム516は、CA署名518の生成に使用された署名生成アルゴリズムを示す識別情報である。CA署名518は、CA秘密鍵529を用いて、発行元512、証明書ID513、メーカー公開鍵514、署名アルゴリズム516などのメーカー証明書511に含まれる情報に、署名生成アルゴリズムS3を施して生成された署名データである。
The manufacturer certificate 511 includes an issuer 512, a certificate ID 513, a manufacturer public key 514, a signature algorithm 516, and a CA signature 518.
The issuer 512 is identification information indicating the CA that is the issuer of the manufacturer certificate 511. FIG. 56 shows “CA” for convenience of explanation. The certificate ID 513 is identification information unique to the manufacturer certificate 511. The manufacturer public key 514 is the manufacturer's public key of the music decryption program 476, and its validity is proved by the manufacturer certificate 511. The manufacturer public key 514 is a key corresponding to the application manufacturer secret key 519. The signature algorithm 516 is identification information indicating the signature generation algorithm used for generating the CA signature 518. The CA signature 518 is generated by applying the signature generation algorithm S3 to information included in the manufacturer certificate 511 such as the issuer 512, the certificate ID 513, the manufacturer public key 514, and the signature algorithm 516 using the CA private key 529. Signature data.

CA証明書521は、発行元522、証明書ID523、CA公開鍵524、署名アルゴリズム526及びルートCA署名528を含んで構成される。
発行元522は、CA証明書521の発行元であるルートCAを示す識別情報である。図56には説明の便宜上「ルートCA」と記載している。証明書ID523は、CA証明書521に固有の識別情報である。CA公開鍵524は、CAの公開鍵であり、CA証明書521によって、その正当性を証明される。CA公開鍵524は、CA秘密鍵529と対応する鍵である。署名アルゴリズム526は、ルートCA署名528の生成に使用された署名生成アルゴリズムを示す識別情報である。ルートCA署名528は、ルートCA秘密鍵531を用いて、発行元522、証明書ID523、CA公開鍵524、署名アルゴリズム526などのCA証明書521に含まれる情報に、ルートCA秘密鍵531を用いて、署名生成アルゴリズムS4を施して生成された署名データである。ルートCA秘密鍵531は、ルートCAに固有の秘密鍵である。
The CA certificate 521 includes an issuer 522, a certificate ID 523, a CA public key 524, a signature algorithm 526, and a root CA signature 528.
The issuer 522 is identification information indicating the root CA that is the issuer of the CA certificate 521. FIG. 56 shows “root CA” for convenience of explanation. The certificate ID 523 is identification information unique to the CA certificate 521. The CA public key 524 is a CA public key, and its validity is proved by the CA certificate 521. The CA public key 524 is a key corresponding to the CA private key 529. The signature algorithm 526 is identification information indicating the signature generation algorithm used to generate the root CA signature 528. The root CA signature 528 uses the root CA private key 531 and uses the root CA private key 531 for information included in the CA certificate 521 such as the issuer 522, certificate ID 523, CA public key 524, and signature algorithm 526. The signature data generated by applying the signature generation algorithm S4. The root CA private key 531 is a private key unique to the root CA.

ここで、一例として、CAには携帯電話400の販売メーカー、ルートCAには、公的な証明書発行機関が該当する。また、メーカー証明書511に代わって、音楽復号プログラム476を制御するセキュアOS481のOS証明書482、携帯電話400に割り当てられる証明書、セキュアOS481の製造メーカーの証明書を用いるとしても良い。
この変形例において、鍵格納部464は、CA公開鍵466に代わって、ルートCA公開鍵を記憶している。ルートCA公開鍵は、ルートCA秘密鍵531と対応する鍵である。また、無効化リスト記憶部461は、アプリ無効化リスト462に加えて、メーカー無効化リスト及び、CA無効化リストを記憶している。メーカー無効化リストは、無効化されたメーカー証明書の証明書IDを含むリストであり、CA無効化リストは、無効化されたCA証明書の証明書IDを含むリストである。
Here, as an example, CA is a manufacturer of mobile phone 400, and root CA is a public certificate issuing organization. In place of the manufacturer certificate 511, an OS certificate 482 of the secure OS 481 that controls the music decryption program 476, a certificate assigned to the mobile phone 400, and a manufacturer's certificate of the secure OS 481 may be used.
In this modification, the key storage unit 464 stores a root CA public key instead of the CA public key 466. The root CA public key is a key corresponding to the root CA private key 531. The invalidation list storage unit 461 stores a manufacturer invalidation list and a CA invalidation list in addition to the application invalidation list 462. The manufacturer invalidation list is a list including certificate IDs of invalidated manufacturer certificates, and the CA invalidation list is a list including certificate IDs of invalidated CA certificates.

アプリ検証部468は、先ず、CA証明書521とルートCA公開鍵を読み出し、読み出したルートCA公開鍵を用いてCA証明書521に含まれるルートCA署名528に署名検証アルゴリズムV4を施して署名検証を行う。署名検証アルゴリズムV4は、署名生成アルゴリズムS4により生成された署名データを検証するアルゴリズムである。
署名検証が失敗であれば、アプリ検証部468は、以下の処理を中止して、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
First, the application verification unit 468 reads the CA certificate 521 and the root CA public key, and applies the signature verification algorithm V4 to the root CA signature 528 included in the CA certificate 521 using the read root CA public key to verify the signature. I do. The signature verification algorithm V4 is an algorithm for verifying the signature data generated by the signature generation algorithm S4.
If the signature verification fails, the application verification unit 468 stops the following processing and instructs the application invalidation unit 429 to invalidate the music decryption program 476.

署名検証が成功であれば、次に、CA証明書521に含まれる証明書ID523がCA無効化リストに登録されているか否かを判断し、登録されていれば、アプリ検証部468は、以下の処理を中止して、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
登録されていなければ、次に、メーカー証明書511を読み出し、CA証明書521に含まれるCA公開鍵524を用いて、読み出したメーカー証明書511に含まれるCA署名518に署名検証アルゴリズムV3を施して署名検証を行う。署名検証アルゴリズムV3は、署名生成アルゴリズムS3により生成された署名データを検証するアルゴリズムである。
If the signature verification is successful, it is next determined whether or not the certificate ID 523 included in the CA certificate 521 is registered in the CA revocation list. If registered, the application verification unit 468 And the application invalidation unit 429 is instructed to invalidate the music decryption program 476.
If it is not registered, the maker certificate 511 is read out, and the signature verification algorithm V3 is applied to the CA signature 518 included in the read maker certificate 511 using the CA public key 524 included in the CA certificate 521. Signature verification. The signature verification algorithm V3 is an algorithm for verifying signature data generated by the signature generation algorithm S3.

署名検証が失敗であれば、アプリ検証部468は、以下の処理を中止して、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
署名検証が成功であれば、次に、メーカー証明書511に含まれる証明書ID513がメーカー無効化リストに登録されているか否かを判断し、登録されていれば、アプリ検証部468は、以下の処理を中止して、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
If the signature verification fails, the application verification unit 468 stops the following processing and instructs the application invalidation unit 429 to invalidate the music decryption program 476.
If the signature verification is successful, it is next determined whether or not the certificate ID 513 included in the manufacturer certificate 511 is registered in the manufacturer invalidation list. If registered, the application verification unit 468 And the application invalidation unit 429 is instructed to invalidate the music decryption program 476.

登録されていなければ、次に、アプリ証明書501を読み出す。メーカー証明書511に含まれるメーカー公開鍵514を用いて、読み出したアプリ証明書501に含まれるメーカー署名508に署名検証アルゴリズムV2を施して署名検証を行う。署名検証アルゴリズムV2は、署名生成アルゴリズムS2により生成された署名データを検証するアルゴリズムである。   If it is not registered, the application certificate 501 is read out next. Using the manufacturer public key 514 included in the manufacturer certificate 511, signature verification is performed by applying the signature verification algorithm V2 to the manufacturer signature 508 included in the read application certificate 501. The signature verification algorithm V2 is an algorithm for verifying the signature data generated by the signature generation algorithm S2.

署名検証が失敗であれば、アプリ検証部468は、以下の処理を中止して、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
署名検証が成功であれば、次に、アプリ証明書501に含まれる証明書ID503がアプリ無効化リストに462に登録されているか否かを判断し、登録されていれば、アプリ検証部468は、アプリ無効化部429へ、音楽復号プログラム476の無効化を指示する。
If the signature verification fails, the application verification unit 468 stops the following processing and instructs the application invalidation unit 429 to invalidate the music decryption program 476.
If the signature verification is successful, it is next determined whether or not the certificate ID 503 included in the application certificate 501 is registered in the application revocation list 462. If registered, the application verification unit 468 The application invalidation unit 429 is instructed to invalidate the music decryption program 476.

登録されていなければ、音楽復号プログラム476が有効なプログラムであると判定する。
このように、2重、3重の検証をすることで、より高いセキュリティを確保することができる。また、メーカー証明書を導入したことにより、同一のメーカーにより開発されたプログラム全てを無効化することができる。
If not registered, it is determined that the music decoding program 476 is an effective program.
Thus, higher security can be ensured by performing double and triple verification. In addition, by introducing a manufacturer certificate, all programs developed by the same manufacturer can be invalidated.

セキュアOS481についても、同様に複数の証明書による検証を行っても良い。
2.6その他の変形例
(1)上記の実施の形態2において、OS無効化リストは、リストIDとして、OS無効化リストの生成された日付を含んでいるが、図57に示すOS無効化リスト541のようにバージョン番号をリストID543として含んでいても良い。バージョン情報とは、OS無効化リストの世代を示す番号であり、値が大きいほど新しいことを示す。
Similarly, the secure OS 481 may be verified using a plurality of certificates.
2.6 Other Modifications (1) In the second embodiment described above, the OS invalidation list includes the date when the OS invalidation list was generated as the list ID, but the OS invalidation shown in FIG. A version number may be included as a list ID 543 as in a list 541. The version information is a number indicating the generation of the OS invalidation list. A larger value indicates newer information.

また、OS無効化リスト551に示すように、無効化IDの総数をリストID553として含んでいるとしても良い。無効化されるプログラムの総数は、減少することはありえないため、無効化IDの総数をリストIDとすることで、リストIDの値の大きいものほど新しいOS無効化リストであると、判断することができる。
(2)上記の説明において、無効化リスト発行装置250は、OS無効化リスト及びアプリ無効化リストを生成しているが、アプリ無効化リストとOS無効化リストの発行元は別々でも良い。
Further, as shown in the OS invalidation list 551, the total number of invalidation IDs may be included as the list ID 553. Since the total number of programs to be invalidated cannot be reduced, it is possible to determine that the larger the list ID value is, the newer the OS invalidation list is, by using the total number of invalidation IDs as the list ID. it can.
(2) In the above description, the invalidation list issuing device 250 generates the OS invalidation list and the application invalidation list, but the issuer of the application invalidation list and the OS invalidation list may be different.

例えば、OS無効化リストは、オペレーティングシステム開発メーカーの管理する無効化リスト発行装置により、生成され発行される。アプリ無効化リストは、アプリケーションの開発メーカーの管理する無効化リスト発行装置により生成され発行される。
(3)上記の実施の形態及び変形例において、OS検証がセキュアアプリケーションを検証し、アプリ検証部がセキュアOSを検証するとしてもよい。
For example, the OS invalidation list is generated and issued by an invalidation list issuing device managed by an operating system developer. The application invalidation list is generated and issued by an invalidation list issuing device managed by the application developer.
(3) In the above embodiments and modifications, the OS verification may verify the secure application, and the application verification unit may verify the secure OS.

セキュアアプリケーションとセキュアOSの開発メーカーは異なる場合、このように相互に検証しあうことで、より安全性を高めることができる。
(4)また、無効化リスト発行装置250が送信するアプリ無効化リスト及びOS無効化リストは、必ず最新のものであり、無効化リスト記憶部421が記憶しているアプリ無効化リスト422及びOS無効化リスト423がこれらよりも新しいことはありえない。従って、無効化リスト更新部424は、アプリ無効化リスト及びOS無効化リストの更新を行う際に、上述したようなリストIDの比較を省略し、署名検証に成功すれば、無条件に、無効化リスト発行装置250から受信したアプリ無効化リスト及びOS無効化リストにより、アプリ無効化リスト422及びOS無効化リスト423を更新するとしてもよい。
When the developers of secure applications and secure OSs are different, it is possible to further improve safety by mutually verifying in this way.
(4) The application invalidation list and the OS invalidation list transmitted by the invalidation list issuing device 250 are always the latest, and the application invalidation list 422 and the OS stored in the invalidation list storage unit 421 are stored. The invalidation list 423 cannot be newer than these. Accordingly, when updating the application invalidation list and the OS invalidation list, the invalidation list update unit 424 skips the comparison of the list IDs as described above, and unconditionally invalidates if the signature verification is successful. The application invalidation list 422 and the OS invalidation list 423 may be updated with the application invalidation list and the OS invalidation list received from the activation list issuing device 250.

(5)上記の実施の形態において、切替制御部106から接続指示が出力されると、セキュアメモリ413に記憶されている各プログラムの検証を行っているが、検証のタイミングは、これに限るものではなく、携帯電話400の電源投入時、各プログラムの起動時などでもよい。
3.実施の形態3
以下に、本発明に係る実施の形態3について説明する。
(5) In the above embodiment, when a connection instruction is output from the switching control unit 106, each program stored in the secure memory 413 is verified. However, the verification timing is limited to this. Instead, it may be when the mobile phone 400 is turned on or when each program is started.
3. Embodiment 3
The third embodiment according to the present invention will be described below.

本実施の形態の携帯電話は、実施の形態2と同様に、携帯電話網及びインターネットを介して、無効化リスト発行装置と接続されている。
3.1無効化リスト発行装置
本実施の形態の無効化リスト発行装置は、実施の形態2における無効化リスト発行装置250と同様に、通信部、署名生成部、鍵記憶部、ハッシュ生成部、制御部、情報記憶部610、入力部及び表示部から構成される。
The mobile phone according to the present embodiment is connected to the invalidation list issuing device via the mobile phone network and the Internet as in the second embodiment.
3.1 Invalidation List Issuing Device The invalidation list issuance device according to the present embodiment is similar to the invalidation list issuance device 250 according to the second embodiment. The communication unit, the signature generation unit, the key storage unit, the hash generation unit, It comprises a control unit, an information storage unit 610, an input unit, and a display unit.

通信部、署名生成部、鍵記憶部、ハッシュ生成部、入力部及び表示部の構成及び動作は、無効化リスト発行装置250に含まれる通信部251、署名生成部252、鍵記憶部253、ハッシュ生成部254、入力部262及び表示部263とほぼ同様であり、ハッシュ生成部は、OS無効化リスト及びアプリ無効化リストに代わって、OSマトリクス無効化リスト(後述する)からOSダイジェストデータを生成し、アプリマトリクス無効化リスト(後述する)からアプリダイジェストデータを生成する。これらの各部については、説明を省略し、本実施の形態の特徴である。情報記憶部610及び制御部についてのみ説明する。   The configuration and operation of the communication unit, signature generation unit, key storage unit, hash generation unit, input unit, and display unit are the communication unit 251, signature generation unit 252, key storage unit 253, hash included in the invalidation list issuing device 250. Almost the same as the generation unit 254, the input unit 262, and the display unit 263, the hash generation unit generates OS digest data from the OS matrix invalidation list (described later) instead of the OS invalidation list and the application invalidation list. Then, application digest data is generated from an application matrix invalidation list (described later). The description of these units is omitted, and is a feature of the present embodiment. Only the information storage unit 610 and the control unit will be described.

(1)情報記憶部610
情報記憶部610は、図58に示すように、アプリ発行鍵マトリクス601、OS発行鍵マトリクス602、アプリ無効化情報604、606・・・、アプリマトリクス無効化リスト611及びOSマトリクス無効化リスト621を記憶している。
<アプリ発行鍵マトリクス601及びOS発行鍵マトリクス602>
アプリ発行鍵マトリクス601は、図58に示すように4行×4列の行列の各行列要素として、16個の発行鍵Key_11、Key_12、Key_13・・・を配置したものである。各発行鍵は、一例として擬似乱数を用いて生成される、64ビット長の鍵データである。
(1) Information storage unit 610
As shown in FIG. 58, the information storage unit 610 stores an application issue key matrix 601, an OS issue key matrix 602, application invalidation information 604, 606..., An application matrix invalidation list 611, and an OS matrix invalidation list 621. I remember it.
<Application issue key matrix 601 and OS issue key matrix 602>
As shown in FIG. 58, the application issuance key matrix 601 has 16 issuance keys Key_11, Key_12, Key_13... Arranged as matrix elements of a 4 × 4 matrix. Each issuance key is 64-bit key data generated using a pseudo random number as an example.

アプリ発行鍵マトリクス601は、縦方向に上から順に行番号「1」、「2」、「3」、「4」を配置し、横方向に左から順に、列番号「1」、「2」、「3」、「4」を配置している。
行番号「1」、列番号「1」と対応する行列要素661は、発行鍵Key_11であり、行番号「1」、列番号「2」と対応する行列要素662は、発行鍵Key_12である。行番号「1」、列番号「3」と対応する行列要素663は、発行鍵Key_13であり、行番号「1」、列番号「4」と対応する行列要素664は、発行鍵Key_14である。
In the application issuance key matrix 601, row numbers “1”, “2”, “3”, “4” are arranged in the vertical direction from the top, and column numbers “1”, “2” are arranged in the horizontal direction from the left. , “3”, “4” are arranged.
The matrix element 661 corresponding to the row number “1” and the column number “1” is the issue key Key_11, and the matrix element 662 corresponding to the row number “1” and the column number “2” is the issue key Key_12. The matrix element 663 corresponding to the row number “1” and the column number “3” is the issue key Key_13, and the matrix element 664 corresponding to the row number “1” and the column number “4” is the issue key Key_14.

同様に、行番号「2」、列番号「1」〜「4」の行列要素665〜668は、それぞれ、発行鍵Key_21、Key_22、Key_23、Key_24である。行番号「3」、列番号「1」〜「4」の行列要素669〜672は、発行鍵Key_31、Key_32、Key_33、Key_34である。行番号「4」、列番号「1」〜「4」の行列要素673〜676は、Key_41、Key_42、Key_43、Key_44である。   Similarly, the matrix elements 665 to 668 having the row number “2” and the column numbers “1” to “4” are the issue keys Key_21, Key_22, Key_23, and Key_24, respectively. The matrix elements 669 to 672 having the row number “3” and the column numbers “1” to “4” are the issuance keys Key_31, Key_32, Key_33, and Key_34. The matrix elements 673-676 of the row number “4” and the column numbers “1” to “4” are Key_41, Key_42, Key_43, and Key_44.

本実施の形態において、各セキュアアプリケーションには、アプリ発行鍵マトリクス601の各列から1個ずつ、計4個の発行鍵が割り当てられている。4個の発行鍵の組み合わせは、セキュアアプリケーションごとに異なる。
一例として、携帯電話において実行される音楽復号プログラム(後述する)には、アプリ発行鍵マトリクス601において、実線円677、678、679、680で囲まれている、発行鍵Key_11、Key_32、Key_23、Key_14が割り当てられている。また、音楽復号プログラムとは別のセキュアアプリケーション(アプリBと呼ぶ)には、点線円681、682、683、684で囲まれている、発行鍵Key_21、Key_32、Key_33、Key_44が割り当てられている。
In the present embodiment, a total of four issue keys are assigned to each secure application, one from each column of the application issue key matrix 601. The combination of the four issued keys is different for each secure application.
As an example, a music decryption program (described later) executed on a mobile phone includes an issue key Key_11, Key_32, Key_23, Key_14 surrounded by solid circles 677, 678, 679, and 680 in the application issue key matrix 601. Is assigned. Further, the issue key Key_21, Key_32, Key_33, and Key_44, which are surrounded by dotted circles 681, 682, 683, and 684, are assigned to a secure application (referred to as application B) different from the music decryption program.

OS発行鍵マトリクス602は、アプリ発行鍵マトリクス601と同様の構成であり、16個の発行鍵を4行×4列の行列の、行列要素として格納したものである。
<アプリ無効化情報604、606・・・>
アプリ無効化情報604、606・・・についての説明を容易にするために、アプリ固有鍵マトリクス及びOS固有鍵マトリクスについて先ず説明する。
The OS issuance key matrix 602 has the same configuration as that of the application issuance key matrix 601, and stores 16 issuance keys as matrix elements of a matrix of 4 rows × 4 columns.
<Application invalidation information 604, 606 ...>
In order to facilitate the description of the application invalidation information 604, 606..., First, the application unique key matrix and the OS unique key matrix will be described.

図59は、本実施の形態の携帯電話に記憶されている暗号化音楽復号プログラム591(後述する)に含まれるアプリ固有鍵マトリクス592及び暗号化セキュアOS596(後述する)に含まれるOS固有鍵マトリクス597である。
アプリ固有鍵マトリクス592は、暗号化音楽復号プログラム591を復号して生成される音楽復号プログラムと1対1に対応しており、音楽復号プログラムに割り当てられた4個の発行鍵を含んでいる。アプリ固有鍵マトリクス592は、4つの鍵情報901、902、903、904から構成される。各鍵情報は、列番号と行番号と発行鍵を含んでおり、鍵情報901は、アプリ発行鍵マトリクス601の1列目の行列要素から音楽復号プログラムに割り当てられた発行鍵Key_11と、アプリ発行鍵マトリクス601上でKey_11と対応する行番号「1」と列番号「1」とを含んでいる。鍵情報902は、アプリ発行鍵マトリクス601の2列目の行列要素から音楽復号プログラムに割り当てられた発行鍵Key_32と、アプリ発行鍵マトリクス601上でKey_32と対応する行番号「3」と列番号「2」とを含んでいる。鍵情報903は、アプリ発行鍵マトリクス601の3列目の行列要素から音楽復号プログラムに割り当てられた発行鍵Key_23と、アプリ発行鍵マトリクス601上でKey_23と対応する行番号「2」と列番号「3」とを含んでいる。鍵情報904は、アプリ発行鍵マトリクス601の4列目の行列要素から音楽復号プログラムに割り当てられた発行鍵Key_14と、アプリ発行鍵マトリクス601上でKey_14と対応する行番号「1」と列番号「4」とを含んでいる。
FIG. 59 shows an application unique key matrix 592 included in an encrypted music decryption program 591 (described later) and an OS unique key matrix included in an encrypted secure OS 596 (described later) stored in the mobile phone according to the present embodiment. 597.
The application unique key matrix 592 has a one-to-one correspondence with the music decryption program generated by decrypting the encrypted music decryption program 591, and includes four issuance keys assigned to the music decryption program. The application unique key matrix 592 includes four pieces of key information 901, 902, 903, and 904. Each key information includes a column number, a row number, and an issuance key. The key information 901 includes an issuance key Key_11 assigned to the music decryption program from the matrix element in the first column of the application issuance key matrix 601, and an application issuance. The key matrix 601 includes a row number “1” and a column number “1” corresponding to Key_11. The key information 902 includes the issue key Key_32 assigned to the music decryption program from the matrix element in the second column of the application issue key matrix 601, the row number “3” corresponding to the Key_32 on the application issue key matrix 601, and the column number “ 2 ”. The key information 903 includes the issue key Key_23 assigned to the music decryption program from the matrix element in the third column of the application issue key matrix 601, the row number “2” corresponding to the Key_23 on the application issue key matrix 601, and the column number “ 3 ”. The key information 904 includes the issue key Key_14 assigned to the music decryption program from the matrix element in the fourth column of the application issue key matrix 601, the row number “1” corresponding to the Key_14 on the application issue key matrix 601, and the column number “ 4 ”.

OS固有鍵マトリクス597は、アプリ固有鍵マトリクスと同様の構成であり、鍵情報906、907、908、909から構成され、各鍵情報は、列番号、行番号発行鍵を含む。
本実施の形態に記憶されている暗号化セキュアOS596を復号して生成されるセキュアOSには、OS発行鍵マトリクス602の各列から1個ずつ、計4個の発行鍵が割り当てられている。この4個の発行鍵の組み合わせは、オペレーティングシステムごとに異なる。
The OS unique key matrix 597 has the same configuration as that of the application unique key matrix, and includes key information 906, 907, 908, and 909. Each key information includes a column number and a row number issuance key.
The secure OS generated by decrypting the encrypted secure OS 596 stored in this embodiment is assigned four issue keys, one from each column of the OS issue key matrix 602. The combination of the four issuance keys differs for each operating system.

鍵情報906〜909は、それぞれ、OS固有鍵マトリクス602の各列から、セキュアOSに割り当てられた固有鍵と固有鍵に対応するOS固有鍵マトリクス602上の列番号と行番号とを含んでいる。
アプリ無効化情報604、606・・・は、無効化されたアプリケーションのアプリ固有鍵マトリクスの各鍵情報から列番号及び行番号を抽出したものである。
Each of the key information 906 to 909 includes a unique key assigned to the secure OS from each column of the OS unique key matrix 602 and a column number and a row number on the OS unique key matrix 602 corresponding to the unique key. .
The application invalidation information 604, 606... Is obtained by extracting the column number and the row number from each key information of the application unique key matrix of the invalidated application.

一例として、アプリ無効化情報604は、上述のアプリBと対応する。アプリ無効化情報604は、図58に示すように、4個の列番号「1」_931、「2」_932、「3」_933、「4」_934と、それぞれの列番号と対応する行番号935〜938から構成される。列番号「1」_931と行番号「2」_935は、アプリ発行鍵マトリクス601の1列目から、アプリBに割り当てられた発行鍵Key_21と対応している。列番号「2」_932と行番号「3」_936、プリ発行鍵マトリクス601の2列目から、アプリBに割り当てられた発行鍵Key_32と対応している。同様に、列番号「3」_933と行番号「3」_937は、発行鍵Key_33と対応しており、列番号「4」と行番号「4」は、発行鍵Key_44と対応している。   As an example, the application invalidation information 604 corresponds to the application B described above. As shown in FIG. 58, the application invalidation information 604 includes four column numbers “1” — 931, “2” — 932, “3” — 933, “4” — 934, and a row number 935 corresponding to each column number. To 938. Column number “1” — 931 and row number “2” — 935 correspond to issue key Key — 21 assigned to application B from the first column of application issue key matrix 601. Corresponding to the issue key Key_32 assigned to the application B from the second column of the column number “2” _932, the row number “3” _936, and the pre-issue key matrix 601. Similarly, the column number “3” _933 and the row number “3” _937 correspond to the issue key Key_33, and the column number “4” and the row number “4” correspond to the issue key Key_44.

また、具体的には図示していないが、情報記憶部610は、無効化されたオペレーティングシステムのOS固有鍵マトリクスの各鍵情報から列番号及び行番号を抽出したOS無効化情報を記憶している。
<アプリマトリクス無効化リスト611及びOSマトリクス無効化リスト621>
アプリマトリクス無効化リスト611は、図60に示すように、16個の行列要素911〜926を、4行×4列の行列状に配置して構成される。説明の便宜上、i行j列目の行列要素に格納される行列要素を変数Mijを用いて表現する。
Although not specifically illustrated, the information storage unit 610 stores OS invalidation information obtained by extracting the column number and the row number from each key information of the OS unique key matrix of the invalidated operating system. Yes.
<Application Matrix Invalidation List 611 and OS Matrix Invalidation List 621>
As shown in FIG. 60, the application matrix invalidation list 611 is configured by arranging 16 matrix elements 911 to 926 in a 4 × 4 matrix. For convenience of explanation, a matrix element stored in a matrix element in the i-th row and j-th column is expressed using a variable Mij.

変数Mijは、アプリ発行鍵マトリクス601上のi行j列目の発行鍵を用いて、暗号化音楽復号プログラム591を初めとする暗号化アプリケーションを復号するための復号鍵に暗号化アルゴリズムE2を施して生成されたものである。図中のEnc(Key_ij,復号鍵)は、復号鍵を、発行鍵Key_ijを用いて暗号化して生成されたものであることを示している。例えば、行番号「1」、列番号「1」の行列要素911である変数M11は、アプリ発行鍵マトリクス601上の、行番号「1」、列番号「1」の行列要素661の発行鍵Key_11を用いて、復号鍵を暗号化したものである。   The variable Mij applies the encryption algorithm E2 to the decryption key for decrypting the encrypted application including the encrypted music decryption program 591 using the issue key in the i-th row and j-th column on the application issue key matrix 601. Is generated. Enc (Key_ij, decryption key) in the figure indicates that the decryption key is generated by encryption using the issuance key Key_ij. For example, the variable M11 that is the matrix element 911 having the row number “1” and the column number “1” is the issue key Key_11 of the matrix element 661 having the row number “1” and the column number “1” on the application issue key matrix 601. Is used to encrypt the decryption key.

ここで、アプリマトリクス無効化リスト611は、情報記憶部610に記憶されているアプリ無効化情報が、アプリ無効化情報604のみである場合に生成されたものである。このとき、アプリ無効化情報604に含まれる行番号及び列番号と対応する行列要素M21、M32、M33及びM44は、復号鍵に変わってダミーデータ「0000」を、発行鍵を用いて暗号化したものである。   Here, the application matrix invalidation list 611 is generated when the application invalidation information stored in the information storage unit 610 is only the application invalidation information 604. At this time, the matrix elements M21, M32, M33, and M44 corresponding to the row number and the column number included in the application invalidation information 604 encrypted the dummy data “0000” using the issue key instead of the decryption key. Is.

OSマトリクス無効化リスト621は、アプリマトリクス無効化リスト611と同様の構成であり、16個の行列要素を4行×4列の行列状に配置したものである。i行j列目の行列要素は、暗号化セキュアOS596を含む各種の暗号化オペレーティングシステムを復号するための復号鍵を、OS発行鍵マトリクス602のi行j列目に配置された発行鍵を用いて暗号化したものである。ただし、OS無効化情報に含まれる行番号及び列番号と対応する行列要素は、前記復号鍵に代わって、ダミーデータを暗号化したものである。   The OS matrix invalidation list 621 has the same configuration as that of the application matrix invalidation list 611, and 16 matrix elements are arranged in a matrix of 4 rows × 4 columns. The matrix element in the i-th row and j-th column uses a decryption key for decrypting various encrypted operating systems including the encrypted secure OS 596, using the issue key arranged in the i-th row and j-th column of the OS issue key matrix 602. Is encrypted. However, the matrix element corresponding to the row number and the column number included in the OS invalidation information is obtained by encrypting dummy data instead of the decryption key.

また、具体的には図示していないが、アプリマトリクス無効化リスト611及びOSマトリクス無効化リストには、その新旧を示すリストIDが含まれている。
(2)制御部
制御部は、インターネットを介して、携帯電話から、リスト要求を受信する。リスト要求を受信すると、情報記憶部610から、OSマトリクス無効化リスト621及びアプリマトリクス無効化リスト611を読み出し、ハッシュ制御部、署名生成部によって生成された署名を付加した署名付OSマトリクス無効化リストと署名付アプリマトリクス無効化リストとを携帯電話へ送信する。これは、実施の形態2の制御部257による、署名付OS無効化リスト及び署名付アプリ無効化リストの生成及び送信と同様であるので、詳細な説明は省略する。
Although not specifically shown, the application matrix invalidation list 611 and the OS matrix invalidation list include list IDs indicating the new and old.
(2) Control unit The control unit receives a list request from a mobile phone via the Internet. When the list request is received, the OS matrix invalidation list 621 and the application matrix invalidation list 611 are read from the information storage unit 610, and the signed OS matrix invalidation list to which the signature generated by the hash control unit and the signature generation unit is added. And the signed application matrix invalidation list are transmitted to the mobile phone. This is the same as the generation and transmission of the signed OS invalidation list and signed application invalidation list by the control unit 257 of the second embodiment, and detailed description thereof will be omitted.

また、制御部は、入力部を介して、操作者により新たなアプリ無効化情報の入力及びアプリマトリクス無効化リストの生成の指示を受け付ける。受け付けた指示に従って、新たにアプリマトリクス無効化リストを生成する。
また、新たなOS無効化情報の入力及びOSマトリクス無効化リストの生成の指示を受け付ける。受け付けた指示に従って、新たにOSマトリクス無効化リストを生成する。
In addition, the control unit receives an instruction to input new application invalidation information and generate an application matrix invalidation list by the operator via the input unit. In accordance with the received instruction, a new application matrix invalidation list is generated.
Also, it receives an input of new OS invalidation information and an instruction to generate an OS matrix invalidation list. In accordance with the received instruction, a new OS matrix invalidation list is generated.

以下に図61に示すフローチャートを用いて、アプリマトリクス無効化リストの生成の動作について説明する。なお、本実施の形態では、アプリ発行鍵マトリクス601及びアプリマトリクス無効化リストは、16個の要素を4×4の行列状に配置して構成されるが、これに限るものではない。フローチャートにおいては、より一般的にp行n列の場合について説明している。(p、nは1以上の整数)
先ず、p×n個の各行列要素M11、M12・・・Mpnに復号鍵を代入する(ステップS721)。列番号を格納する変数j及び行番号を格納する変数iを0で初期化する(ステップS722)。
The operation for generating the application matrix invalidation list will be described below using the flowchart shown in FIG. In the present embodiment, the application issue key matrix 601 and the application matrix invalidation list are configured by arranging 16 elements in a 4 × 4 matrix, but the present invention is not limited to this. In the flowchart, the case of p rows and n columns is more generally described. (P and n are integers of 1 or more)
First, a decryption key is substituted into p × n matrix elements M11, M12... Mpn (step S721). A variable j for storing the column number and a variable i for storing the row number are initialized with 0 (step S722).

次に、アプリ無効化情報を読み出し(ステップS723)、変数jに1加算する(ステップS724)。読み出したアプリ無効化情報の列番号jと対応する行番号を抽出し、抽出した行番号を変数iに代入する(ステップS726)。
次に、行列要素Mijにダミーデータ「0000」を代入する(ステップS727)。次に、変数j=nであるか否かを判断する(ステップS729)。j=nでないと判断すると(ステップS729のNO)、ステップS724に戻って、j=nになるまでステップS724〜729を繰り返す。
Next, the application invalidation information is read (step S723), and 1 is added to the variable j (step S724). The row number corresponding to the column number j of the read application invalidation information is extracted, and the extracted row number is substituted into the variable i (step S726).
Next, dummy data “0000” is substituted into the matrix element Mij (step S727). Next, it is determined whether or not the variable j = n (step S729). If it is determined that j is not n (NO in step S729), the process returns to step S724, and steps S724 to 729 are repeated until j = n.

変数j=nであると判断した場合(ステップS729のYES)、情報記憶部610に記憶されているアプリ無効化情報全てを読み出し終わっているか否かを判断し(ステップS731)、読み出し終えていなければ(ステップS731のNO)、ステップS722に戻り、次のアプリ無効化情報についても、ステップS722〜731の処理を繰り返す。   If it is determined that the variable j = n (YES in step S729), it is determined whether all of the application invalidation information stored in the information storage unit 610 has been read (step S731), and the reading must be completed. If (NO in step S731), the process returns to step S722, and the processing in steps S722 to 731 is repeated for the next application invalidation information.

全てのアプリ無効化情報を読み出し終えていると判断すると(ステップS731のYES)、変数iに0を代入し(ステップS734)、変数jに0を代入する(ステップS736)。次に、変数iに1加算し(ステップS737)、変数jに1加算する(ステップS739)。
アプリ発行鍵マトリクス601のi行j列目の発行鍵Key_ijを読み出す(ステップS741)。読み出した発行鍵Key_ijを用いて、行列要素Mijに暗号化アルゴリズムE2を施して、Enc(Key_ij,Mij)を生成し、生成したEnc(Key_ij,Mij)をMijに代入する(ステップS742)。
If it is determined that all application invalidation information has been read (YES in step S731), 0 is substituted for variable i (step S734), and 0 is substituted for variable j (step S736). Next, 1 is added to the variable i (step S737), and 1 is added to the variable j (step S739).
The issuance key Key_ij in the i-th row and j-th column of the application issuance key matrix 601 is read (step S741). Using the read issuance key Key_ij, the matrix element Mij is subjected to the encryption algorithm E2 to generate Enc (Key_ij, Mij), and the generated Enc (Key_ij, Mij) is substituted into Mij (step S742).

変数j=nであれば(ステップS743のYES)、ステップS744に処理を移し、変数j=nでなければ(ステップS743のNO)、ステップS739へ戻り、変数j=nになるまで、ステップS739〜743の処理を繰り返す。
次に、変数i=pであれば(ステップS744のYES)、アプリマトリクス無効化リストの生成を終了する。
If variable j = n (YES in step S743), the process proceeds to step S744. If variable j = n (NO in step S743), the process returns to step S739, and step S739 is performed until variable j = n. Repeat the process of ˜743.
Next, if the variable i = p (YES in step S744), the generation of the application matrix invalidation list is terminated.

変数i=pでなければ(ステップS744のNO)、ステップS736に戻り、i=pになるまで、ステップS736〜744の処理を繰り返す。
なお、OSマトリクス無効化リストについても、OS発行鍵マトリクスとOS無効化情報を用いて、同様の手順で生成する。
3.2携帯電話
本実施の形態の携帯電話は、実施の形態2の携帯電話400と類似した構成である。従って、ここでは、実施の形態2と同様の部分の説明は省略し、本実施の形態の特徴部分についてのみ説明する。
If the variable is not i = p (NO in step S744), the process returns to step S736, and the processes in steps S736 to 744 are repeated until i = p.
The OS matrix invalidation list is also generated in the same procedure using the OS issue key matrix and the OS invalidation information.
3.2 Mobile Phone The mobile phone according to the present embodiment has a configuration similar to that of the mobile phone 400 according to the second embodiment. Therefore, description of the same part as Embodiment 2 is abbreviate | omitted here, and only the characteristic part of this Embodiment is demonstrated.

(1)セキュアメモリ613
セキュアメモリ613には、一例として、図62に示すように暗号化音楽復号プログラム591及び暗号化セキュアOS596を記憶している。
暗号化音楽復号プログラム591は、実施の形態2の音楽復号プログラム446と同様の音楽復号の手順を含む音楽復号プログラムに、暗号化アルゴリズムE3を施して、生成されたものである。また、暗号化音楽復号プログラム591は、ヘッダ部分に、音楽復号プログラムに固有のアプリ固有鍵マトリクス592と無効フラグ593を含んでいる。アプリ固有鍵マトリクス592については、上記において、述べたとおりである。無効フラグ593は、前記音楽復号プログラムが無効であるか否かを示すフラグであり「0」であれば、有効であることを、「1」であれば無効であることを示している。
(1) Secure memory 613
As an example, the secure memory 613 stores an encrypted music decryption program 591 and an encrypted secure OS 596 as shown in FIG.
The encrypted music decryption program 591 is generated by applying an encryption algorithm E3 to a music decryption program including the same music decryption procedure as the music decryption program 446 of the second embodiment. The encrypted music decryption program 591 includes an application unique key matrix 592 and an invalid flag 593 unique to the music decryption program in the header portion. The application unique key matrix 592 is as described above. The invalid flag 593 is a flag indicating whether or not the music decryption program is invalid. If it is “0”, it is valid, and if it is “1”, it is invalid.

暗号化セキュアOS596は、実施の形態2のセキュアOS441と同様のオペレーティング機能を有するセキュアOSに、暗号化アルゴリズムE3を施して生成されたものである。暗号化セキュアOS596は、前記セキュアOSに固有のOS固有鍵マトリクス597及び無効フラグ598をヘッダ部分に含んでいる。OS固有鍵マトリクス597については、上記において、述べたとおりである。   The encrypted secure OS 596 is generated by applying an encryption algorithm E3 to a secure OS having the same operating function as the secure OS 441 of the second embodiment. The encrypted secure OS 596 includes an OS unique key matrix 597 and an invalid flag 598 unique to the secure OS in the header portion. The OS unique key matrix 597 is as described above.

無効フラグ598は、セキュアOSが無効であるか否かを示すフラグであり「0」であれば、有効であることを、「1」であれば無効であることを示している。
(2)メモリ保護部571
メモリ保護部571は、図62に示すように無効化リスト記憶部572、無効化リスト更新部575、アプリ検証部578、アプリ無効化部579、OS検証部581、OS無効化部582及び暗号・復号部586から構成される。
The invalid flag 598 is a flag indicating whether or not the secure OS is invalid. If the flag is “0”, the invalid flag 598 indicates that the secure OS is valid, and “1” indicates that the secure OS is invalid.
(2) Memory protection unit 571
As shown in FIG. 62, the memory protection unit 571 includes an invalidation list storage unit 572, an invalidation list update unit 575, an application verification unit 578, an application invalidation unit 579, an OS verification unit 581, an OS invalidation unit 582, and an encryption / The decoding unit 586 is configured.

無効化リスト記憶部572は、アプリマトリクス無効化リスト573及びOSマトリクス無効化リスト574を記憶している。アプリマトリクス無効化リスト573及びOSマトリクス無効化リスト574は、無効化リスト発行装置の情報記憶部610に記憶されているアプリマトリクス無効化リスト611及びOSマトリクス無効化リストと同様の構成である。   The invalidation list storage unit 572 stores an application matrix invalidation list 573 and an OS matrix invalidation list 574. The application matrix invalidation list 573 and the OS matrix invalidation list 574 have the same configuration as the application matrix invalidation list 611 and the OS matrix invalidation list stored in the information storage unit 610 of the invalidation list issuing device.

無効化リスト更新部575の動作は、実施の形態2の無効化リスト更新部424と同様であり、アプリ無効化リスト及びOS無効化リストに代わって、アプリマトリクス無効化リスト及びOSマトリクス無効化リストを更新する。
アプリ無効化部579及びOS無効化部582の動作は、実施の形態2のアプリ無効化部429及びOS無効化部432と同様であるので、ここでは、改めて説明しない。
The operation of the invalidation list update unit 575 is the same as that of the invalidation list update unit 424 of the second embodiment. Instead of the application invalidation list and the OS invalidation list, the application matrix invalidation list and the OS matrix invalidation list are used. Update.
The operations of the application invalidation unit 579 and the OS invalidation unit 582 are the same as those of the application invalidation unit 429 and the OS invalidation unit 432 according to the second embodiment, and thus will not be described again here.

<アプリ検証部578及びOS検証部581>
アプリ検証部578は、暗号化音楽復号プログラム591に含まれるアプリ固有鍵マトリクス592及び、無効化リスト記憶部572に記憶されているアプリマトリクス無効化リスト573を用いて、暗号化音楽復号プログラム591の復号鍵を生成する。正しく復号鍵を生成することができた場合、音楽復号プログラムが有効であると判定し、生成できなかった場合、音楽復号プログラムが無効であると判断する。上記の、音楽復号プログラムの検証の詳細な手順については、後に説明する。
<Application Verification Unit 578 and OS Verification Unit 581>
The application verifying unit 578 uses the application unique key matrix 592 included in the encrypted music decryption program 591 and the application matrix invalidation list 573 stored in the invalidation list storage unit 572 to use the encrypted music decryption program 591. Generate a decryption key. If the decryption key can be correctly generated, it is determined that the music decryption program is valid. If the decryption key cannot be generated, it is determined that the music decryption program is invalid. The detailed procedure for verifying the music decoding program will be described later.

有効であると判断すると、暗号・復号部586へ生成した復号鍵を出力し、暗号化音楽復号プログラム176の復号を指示する。
無効であると判断すると、アプリ無効化部579へ無効化を指示する。
OS検証部581は、アプリ検証部578と同様にして、暗号化セキュアOS596を復号して生成されるセキュアOSが有効であるか無効であるかを判定する。ここでは、アプリ固有鍵マトリクス592、アプリマトリクス無効化リスト573に代わって、OS固有鍵マトリクス597、OSマトリクス無効化リスト574を用いる。
If it is determined to be valid, the generated decryption key is output to the encryption / decryption unit 586, and the decryption of the encrypted music decryption program 176 is instructed.
If it is determined to be invalid, the application invalidation unit 579 is instructed to invalidate.
Similarly to the application verification unit 578, the OS verification unit 581 determines whether the secure OS generated by decrypting the encrypted secure OS 596 is valid or invalid. Here, instead of the application unique key matrix 592 and the application matrix invalidation list 573, an OS unique key matrix 597 and an OS matrix invalidation list 574 are used.

<暗号・復号部586>
暗号・復号部586は、OS検証部581から暗号化セキュアOS596の復号鍵を受け取り、復号を指示される。復号を指示されると、受け取った復号鍵を用いて、セキュアメモリ613上の暗号化セキュアOS596に、復号アルゴリズムD3を施してセキュアOSを生成する。
<Encryption / Decryption Unit 586>
The encryption / decryption unit 586 receives the decryption key of the encrypted secure OS 596 from the OS verification unit 581 and is instructed to decrypt. When the decryption is instructed, the secure OS is generated by applying the decryption algorithm D3 to the encrypted secure OS 596 on the secure memory 613 using the received decryption key.

また、アプリ検証部578から暗号化音楽復号プログラム591の復号鍵を受け取り、復号を指示される。受け取った復号鍵を用いて、暗号化音楽復号プログラム591に復号アルゴリズムD3を施して音楽復号プログラムを生成する。
ここで、D3は、暗号化アルゴリズムE3によって生成された暗号文を復号するアルゴリズムであり、一例として、DES、AES(Advanced Encryption Standard)などを用いる。
Also, the decryption key of the encrypted music decryption program 591 is received from the application verification unit 578, and decryption is instructed. Using the received decryption key, the decryption algorithm D3 is applied to the encrypted music decryption program 591 to generate a music decryption program.
Here, D3 is an algorithm for decrypting the ciphertext generated by the encryption algorithm E3, and DES, AES (Advanced Encryption Standard), or the like is used as an example.

また、切替制御部576から出力される、セキュアメモリ613とバス130との切断を指示する切断指示を検出する。切断指示を検出すると、受け取った復号鍵によって、音楽復号プログラム及びセキュアOSを暗号化して暗号化音楽復号プログラム591及び暗号化セキュアOS596を生成する。
(3)メモリ保護部571による検証動作
メモリ保護部571による、セキュアメモリ613上のプログラムの検証動作について、図63のフローチャートを用いて説明する。
In addition, a disconnection instruction output from the switching control unit 576 for instructing disconnection between the secure memory 613 and the bus 130 is detected. When the disconnection instruction is detected, the encrypted music decryption program 591 and the encrypted secure OS 596 are generated by encrypting the music decryption program and the secure OS with the received decryption key.
(3) Verification Operation by Memory Protection Unit 571 The verification operation of the program on the secure memory 613 by the memory protection unit 571 will be described with reference to the flowchart of FIG.

メモリ保護部571は、接続指示を受け取る(ステップS701)。接続指示を受け取ると、無効化リスト更新部575は、インターネットを介して無効化リスト発行装置から、最新のアプリマトリクス無効化リストとOSマトリクス無効化リストとを取得し、無効化リスト記憶部572に記憶されているアプリマトリクス無効化リスト573及びOSマトリクス無効化リスト574を更新する(ステップS702)。無効化リスト更新部575によるステップS702の処理は、実施の形態2の無効化リスト更新部424によるステップS672〜679(図49)の処理と同様であり、OS無効化リストをOSマトリクス無効化リストに置き換え、アプリ無効化リストをアプリマトリクス無効化リストに置き換えればよい。   The memory protection unit 571 receives a connection instruction (step S701). Upon receiving the connection instruction, the invalidation list update unit 575 acquires the latest application matrix invalidation list and OS matrix invalidation list from the invalidation list issuing device via the Internet, and stores them in the invalidation list storage unit 572. The stored application matrix invalidation list 573 and OS matrix invalidation list 574 are updated (step S702). The processing in step S702 by the invalidation list update unit 575 is the same as the processing in steps S672 to 679 (FIG. 49) by the invalidation list update unit 424 of the second embodiment, and the OS invalidation list is converted into an OS matrix invalidation list. And the application invalidation list may be replaced with the application matrix invalidation list.

次に、OS検証部581は、セキュアOSの検証を行い(ステップS703)、セキュアOSが有効であると判定すると(ステップS706のYES)、暗号・復号部586へ暗号化セキュアOS596の復号を指示し、暗号・復号部586は、暗号化セキュアOS596を復号して、セキュアOSを生成する(ステップS707)。
セキュアOSが無効であると判定すると(ステップS706のNO)、OS無効化部582へ指示して、無効フラグ598を「1」に設定する(ステップS709)。
Next, the OS verification unit 581 verifies the secure OS (step S703), and determines that the secure OS is valid (YES in step S706), instructs the encryption / decryption unit 586 to decrypt the encrypted secure OS 596. Then, the encryption / decryption unit 586 decrypts the encrypted secure OS 596 to generate a secure OS (step S707).
If it is determined that the secure OS is invalid (NO in step S706), the OS invalidation unit 582 is instructed to set the invalid flag 598 to “1” (step S709).

次に、アプリ検証部578は、音楽復号プログラムが有効であるか否かを検証する(ステップS711)。有効であると判定されると(ステップS712のYES)、暗号・復号部586は、暗号化音楽復号プログラム591を復号して音楽復号プログラムを生成する(ステップS713)。
無効であると判断されると(ステップS712のNO)、アプリ無効化部579は、無効フラグ593を「1」に設定する(ステップS716)。
Next, the application verification unit 578 verifies whether or not the music decryption program is valid (step S711). If it is determined to be valid (YES in step S712), the encryption / decryption unit 586 decrypts the encrypted music decryption program 591 to generate a music decryption program (step S713).
If determined to be invalid (NO in step S712), the application invalidation unit 579 sets the invalid flag 593 to “1” (step S716).

(4)音楽復号プログラムの検証
以下に、図64のフローチャートを用いて、アプリ検証部578による音楽復号プログラムの検証処理について説明する。これは、図63のステップS711の詳細である。本実施の形態では、アプリマトリクス無効化リスト573は、4行×4列の行列を構成しており、アプリ固有鍵マトリクス592は、4個の鍵情報を含んで構成されているが、ここでは、より一般的に、アプリマトリクス無効化リスト573がn行p列のマトリクスを構成しており、アプリ固有鍵マトリクス592がp個の鍵情報から構成される場合について説明する。
(4) Verification of Music Decoding Program The following describes the music decoding program verification processing by the application verification unit 578 with reference to the flowchart of FIG. This is the detail of step S711 in FIG. In this embodiment, the application matrix invalidation list 573 forms a matrix of 4 rows × 4 columns, and the application unique key matrix 592 includes 4 pieces of key information. More generally, a case will be described in which the application matrix invalidation list 573 constitutes a matrix of n rows and p columns, and the application unique key matrix 592 is constituted of p pieces of key information.

アプリ検証部578は、アプリ固有鍵マトリクス573を読み出す(ステップS731)。説明の便宜上、行番号を示す変数iと列番号を示す変数jとを導入して説明する。
アプリ検証部578は、変数jに1を代入する(ステップS732)。アプリ固有鍵マトリクス592の、列番号jと対応する行番号を、変数iに代入する(ステップS733)。
The application verification unit 578 reads the application unique key matrix 573 (step S731). For convenience of explanation, a variable i indicating a row number and a variable j indicating a column number will be introduced for explanation.
The application verification unit 578 substitutes 1 for the variable j (step S732). The row number corresponding to the column number j in the application unique key matrix 592 is substituted into the variable i (step S733).

次に、アプリマトリクス無効化リスト573から、行列要素Mijを読み出す(ステップS736)。アプリ固有鍵マトリクス592から発行鍵Key_ijを抽出し、抽出した発行鍵Key_ijを用いて、読み出した行列要素Mijに復号アルゴリズムD2を施して、復号する(ステップS737)。復号結果が「0000」でなければ(ステップS739のNO)、音楽復号プログラムが有効であると判定し(ステップS741)、復号結果つまり暗号化音楽復号プログラム591の復号鍵を、暗号・復号部586へ出力する(ステップS742)。   Next, the matrix element Mij is read from the application matrix invalidation list 573 (step S736). The issue key Key_ij is extracted from the application unique key matrix 592, and the read matrix element Mij is decrypted by applying the decryption algorithm D2 using the extracted issue key Key_ij (step S737). If the decryption result is not “0000” (NO in step S739), it is determined that the music decryption program is valid (step S741), and the decryption result, that is, the decryption key of the encrypted music decryption program 591 is used as the encryption / decryption unit 586. (Step S742).

処理結果が「0000」であれば(ステップS739のYES)、次に、変数j=pであるか否かを判断し、j=pでなければ(ステップS744のNO)、変数jに1加算し(ステップS747)、ステップS733へ戻る。
変数j=pであれば(ステップS744のYES)、音楽復号プログラムが無効であると判定する(ステップS746)。
If the processing result is “0000” (YES in step S739), it is next determined whether or not the variable j = p. If j = p is not satisfied (NO in step S744), 1 is added to the variable j. (Step S747), the process returns to step S733.
If variable j = p (YES in step S744), it is determined that the music decoding program is invalid (step S746).

なお、ステップS703のOS検証部581によるセキュアOSの検証は、図61のフローチャートのアプリ固有鍵マトリクスをOS固有鍵マトリクスに置き換え、アプリマトリクス無効化リストをOSマトリクス無効化リストに置き換えたものであるので、説明を省略する。
3.3まとめ・効果
以上、説明してきたように、実施の形態3において、携帯電話のセキュアメモリ613上の暗号化音楽復号プログラム591及び暗号化セキュアOS596は、それぞれに固有のアプリ固有鍵マトリクス592、OS固有鍵マトリクス597を含んでいる。
Note that the verification of the secure OS by the OS verification unit 581 in step S703 is performed by replacing the application unique key matrix in the flowchart of FIG. 61 with the OS unique key matrix and replacing the application matrix revocation list with the OS matrix revocation list. Therefore, explanation is omitted.
3.3 Summary / Effects As described above, in the third embodiment, the encrypted music decryption program 591 and the encrypted secure OS 596 on the secure memory 613 of the mobile phone each have a unique application unique key matrix 592. , OS unique key matrix 597 is included.

メモリ保護部571は、アプリマトリクス無効化リスト573及びアプリ固有鍵マトリクス592により音楽復号プログラムが有効であるか否かを判定する。有効である場合にのみ、アプリマトリクス無効化リスト573から、復号鍵を生成することが可能である。
セキュアOSについても、同様に、OSマトリクス無効化リスト574及びOS固有鍵マトリクスを用いて、有効か否かを判定する。
The memory protection unit 571 determines whether or not the music decryption program is valid based on the application matrix invalidation list 573 and the application unique key matrix 592. Only when it is valid, a decryption key can be generated from the application matrix invalidation list 573.
Similarly, the secure OS is also determined to be valid using the OS matrix invalidation list 574 and the OS unique key matrix.

アプリケーションの製造メーカーにおいて、複数のアプリケーションを同一の暗号鍵を用いて同一の方法で暗号化して出荷している場合について考える。
図58のアプリ発行鍵マトリクス601を構成する16個の鍵のうち、各アプリケーションには、各列から1個ずつ、合計4個の発行鍵が割り当てられる。このとき、異なるアプリケーションに割り当てられる発行鍵が4個とも一致することがないように割り当てられる。一例として、本実施の形態の音楽復号プログラムには、発行鍵Key_11、Key_32、Key_23、Key_14が割り当てられており、これらの発行鍵は、暗号化音楽復号プログラム591のアプリ固有鍵マトリクス592に含まれる。
Consider a case where an application manufacturer ships a plurality of applications encrypted by the same method using the same encryption key.
Of the 16 keys constituting the application issuance key matrix 601 in FIG. 58, a total of 4 issuance keys are assigned to each application, one from each column. At this time, the four issuance keys assigned to different applications are assigned so as not to match. As an example, the music decryption program of this embodiment is assigned issuance keys Key_11, Key_32, Key_23, and Key_14, and these issuance keys are included in the application unique key matrix 592 of the encrypted music decryption program 591. .

音楽復号プログラムと同一の製造メーカーから出荷されるアプリケーション(アプリBと呼ぶ)には、発行鍵Key_21、Key_32、Key_33、Key_44が割り当てられており、暗号化アプリBのアプリ発行鍵マトリクスには、これらの4個の発行鍵が含まれる。
ここで、出荷後にアプリBが無効化すべきプログラムであることが判明すると、無効化リスト発行装置には、アプリ無効化情報604が追加される。アプリ無効化情報604は、アプリBに割り当てられた4個の発行鍵と対応する列番号と行番号から構成されている。アプリ無効化情報604に基づいて生成されたアプリマトリクス無効化リスト611は、図60に示すように、行列要素M21、M32、M33及びM44にダミーデータを含んでいるため、暗号化アプリBに割り当てられた4個の発行鍵では、復号鍵を生成することができない。
Issuing keys Key_21, Key_32, Key_33, and Key_44 are assigned to an application (referred to as application B) shipped from the same manufacturer as the music decryption program, and the application issuing key matrix of the encrypted application B includes these keys. These four issuance keys are included.
Here, when it is determined that the application B is a program to be invalidated after shipment, the application invalidation information 604 is added to the invalidation list issuing device. The application invalidation information 604 is composed of four issue keys assigned to the application B and corresponding column numbers and row numbers. The application matrix invalidation list 611 generated based on the application invalidation information 604 includes dummy data in the matrix elements M21, M32, M33, and M44, as shown in FIG. With the four issued keys, a decryption key cannot be generated.

図58に示すように、音楽復号プログラムにもKey_32が割り当てられているが、図64のフローチャートを用いて説明した検証動作によると、その他の発行鍵によって、復号鍵を生成することができる。
このように、各アプリケーションに複数の発行鍵を割り当てておき、アプリ無効化リストと発行鍵とを用いて、復号鍵を生成する構成であれば、同一の方法で暗号化されていても、無効化すべきアプリケーションだけを無効化することができる。
As shown in FIG. 58, Key_32 is also assigned to the music decryption program. However, according to the verification operation described with reference to the flowchart of FIG. 64, a decryption key can be generated using another issue key.
In this way, if a plurality of issuance keys are assigned to each application and a decryption key is generated using the application revocation list and the issuance key, the application is invalidated even if encrypted using the same method. Only applications that should be enabled can be disabled.

さらに、暗号・復号部586は、セキュアメモリ613とバスとを切断する際にセキュアOS及び音楽復号プログラムを初めとするアプリケーションを再度暗号化する。従って、通常メモリ上のプログラムがCPUを使用している間、セキュアメモリ613上のプログラムをより確実に保護することができる。また、このような構成の場合メモリ保護部は、物理的にバスとセキュアメモリ613とを切断しなくてもよい。   Further, the encryption / decryption unit 586 re-encrypts the secure OS and the application including the music decryption program when the secure memory 613 and the bus are disconnected. Therefore, the program on the secure memory 613 can be more reliably protected while the program on the normal memory uses the CPU. In such a configuration, the memory protection unit may not physically disconnect the bus and the secure memory 613.

3.4変形例
(1)実施の形態3において、メモリ保護部571は、切替制御部106から、接続指示を受ける度に、通信制御部を介して、最新のOSマトリクス無効化リスト及びアプリマトリクス無効化リストを取得して、これらを更新し、セキュアメモリ613上の各プログラムを検証している。しかし、OSマトリクス無効化リスト及びアプリマトリクス無効化リストの更新、セキュアメモリ613上の各プログラムの検証を行うタイミングは、これに限るものではない。
3.4 Modifications (1) In the third embodiment, the memory protection unit 571 receives the connection instruction from the switching control unit 106 and receives the latest OS matrix invalidation list and application matrix via the communication control unit. The invalidation list is acquired, these are updated, and each program on the secure memory 613 is verified. However, the timing for updating the OS matrix invalidation list and the application matrix invalidation list and verifying each program on the secure memory 613 is not limited to this.

一例として、携帯電話の起動時でもよいし、1日に1回というように、定期的に行っても良い。また、起動時には、OSマトリクス無効化リスト及びアプリマトリクス無効化リストの更新を行い、起動時以降に接続指示を受け取った際に、プログラムの検証を行うとしても良い。
また、各プログラムを起動する際、例えば、通常OSからセキュアOSへの切替処理の際には、セキュアOSの検証を行い、セキュアOSが音楽復号プログラムを起動する際に音楽復号プログラムの検証を行うとしてもよい。
As an example, the cellular phone may be activated or may be performed periodically, such as once a day. Further, at the time of activation, the OS matrix invalidation list and the application matrix invalidation list may be updated, and the program may be verified when a connection instruction is received after the activation.
Also, when starting each program, for example, when switching from the normal OS to the secure OS, the secure OS is verified, and when the secure OS starts the music decryption program, the music decryption program is verified. It is good.

また、メモリ保護部571から無効化リスト発行装置へリスト要求を送信し、最新のOSマトリクス無効化リスト及びアプリマトリクス無効化リストを取得しているが、新たに無効化すべきプログラムが判明し、OSマトリクス無効化リスト及びアプリマトリクス無効化リストを作成しなおした際に、無効化リスト発行装置から携帯電話へ送信されるとしてもよい。   Further, a list request is transmitted from the memory protection unit 571 to the invalidation list issuing device, and the latest OS matrix invalidation list and application matrix invalidation list are acquired. When the matrix invalidation list and the application matrix invalidation list are created again, they may be transmitted from the invalidation list issuing device to the mobile phone.

(2)携帯電話は、インターネットを介して、最新のOSマトリクス無効化リスト及びアプリマトリクス無効化リストを取得しているが、メモリカードなどの記録媒体から取得しても良い。
(3)これまで、本発明の1つの実施の形態として携帯電話について説明してきたが、以下に説明するようなLANを構成する通信機器であるとしてもよい。
(2) Although the mobile phone acquires the latest OS matrix invalidation list and application matrix invalidation list via the Internet, it may be obtained from a recording medium such as a memory card.
(3) Although the cellular phone has been described as an embodiment of the present invention, it may be a communication device that constitutes a LAN as described below.

LANを構成する機器のうちいずれかひとつが、最新の無効化リストを取得し、他の機器に配布するとしても良い。
一例として、図65に示すような、ホームネットワークを形成する機器である。ホームネットワークは、PC(Personal Computer)650、ノートPC651、DVDプレーヤー652、ホームサーバ653、電子レンジ654をバスによって接続して構成される。
Any one of the devices constituting the LAN may acquire the latest invalidation list and distribute it to other devices.
As an example, it is a device forming a home network as shown in FIG. The home network is configured by connecting a PC (Personal Computer) 650, a notebook PC 651, a DVD player 652, a home server 653, and a microwave oven 654 by a bus.

各機器は、通常のオペレーティングシステムやアプリケーションからは、直接アクセスすることができないセキュアメモリを備えており、セキュアメモリ上にロードして実行する各種のアプリケーションやオペレーティングシステムの有効性を検証する機能を有する。
ホームサーバ653は、インターネット20と接続されており、定期的に無効化リスト発行装置250へ、アプリ無効化リスト及びOS無効化リストを要求する。インターネットを介して、無効化リスト発行装置250から最新のアプリ無効化リスト及びOS無効化リストを取得する。取得した無効化リストを、バスを介して、ホームネットワークを構成する各機器へ出力する。
4.実施の形態4
本発明の実施の形態4について、以下に説明する。
Each device includes a secure memory that cannot be directly accessed from a normal operating system or application, and has a function of verifying the effectiveness of various applications and operating systems that are loaded onto the secure memory and executed.
The home server 653 is connected to the Internet 20 and periodically requests the invalidation list issuing device 250 for an application invalidation list and an OS invalidation list. The latest application invalidation list and OS invalidation list are acquired from the invalidation list issuing device 250 via the Internet. The acquired invalidation list is output to each device constituting the home network via the bus.
4). Embodiment 4
Embodiment 4 of the present invention will be described below.

4.1携帯電話の構成
本実施の形態の携帯電話は、実施の形態1の携帯電話100と同様に、デバッガIF、CPU102、MMU、二次記憶部、切替制御部、割込コントローラ、入力部、表示部、通常メモリ、共有メモリ、セキュアメモリ713、メモリ保護部701、入出力部、暗号処理デバイス、無線通信制御部、マイク、スピーカ、通信部、アンテナ、バッファ、符号処理部、D/A変換部から構成され、各回路はバスに接続されている。
4.1 Configuration of Mobile Phone Similar to the mobile phone 100 of the first embodiment, the mobile phone of the present embodiment includes a debugger IF, a CPU 102, an MMU, a secondary storage unit, a switching control unit, an interrupt controller, and an input unit. , Display unit, normal memory, shared memory, secure memory 713, memory protection unit 701, input / output unit, cryptographic processing device, wireless communication control unit, microphone, speaker, communication unit, antenna, buffer, code processing unit, D / A The circuit is composed of a conversion unit, and each circuit is connected to a bus.

本実施の形態の携帯電話において、メモリ保護部701及びセキュアメモリ713以外の各部の構成及び動作は、実施の形態1と同様であるので、説明を省略し、ここでは、本実施の形態の特徴部分についてのみ説明する。
(1)セキュアメモリ713
セキュアメモリ713は、図66に示すように、音楽復号プログラム704、通信鍵生成プログラム706などのセキュアアプリケーション及びセキュアOS707を記憶している。
In the mobile phone of this embodiment, the configuration and operation of each unit other than the memory protection unit 701 and the secure memory 713 are the same as those in Embodiment 1, and thus the description thereof is omitted. Here, the features of this embodiment are described. Only the part will be described.
(1) Secure memory 713
As shown in FIG. 66, the secure memory 713 stores a secure application such as a music decryption program 704 and a communication key generation program 706, and a secure OS 707.

音楽復号プログラム704は、実施の形態1の音楽復号プログラム176と同様の音楽復号の処理手順を含むセキュアアプリケーションである。
通信鍵生成プログラム706は、携帯電話がインターネットを介してコンテンツの送受信を行う際の暗号鍵を生成するセキュアアプリケーションである。
セキュアOS707は、実施の形態1のセキュアOS171と同様のオペレーティングシステムである。
The music decryption program 704 is a secure application including the same music decryption processing procedure as the music decryption program 176 of the first embodiment.
The communication key generation program 706 is a secure application that generates an encryption key when the mobile phone transmits / receives content via the Internet.
The secure OS 707 is an operating system similar to the secure OS 171 of the first embodiment.

ここで、セキュアメモリ713上の各プログラムは、セキュアメモリ上に起動されると、自身のアクセス情報をアクセス管理部702へ出力する。アクセス情報とは、各プログラムがアクセス可能なメモリ領域のアドレスである。
(2)メモリ保護部701
メモリ保護部701は、図66に示すようにアクセス管理部702と信号監視部703とを含んで構成される。
Here, each program on the secure memory 713 outputs its own access information to the access management unit 702 when started on the secure memory. The access information is an address of a memory area that can be accessed by each program.
(2) Memory protection unit 701
The memory protection unit 701 includes an access management unit 702 and a signal monitoring unit 703 as shown in FIG.

アクセス管理部702は、セキュアメモリ713上の各プログラムからアクセス情報を受け取り、受け取ったアクセス情報を該当するプログラムと対応付けて記憶している。また、各プログラムごとに不正アクセスの回数を計数するカウンタを備えている。
信号監視部703は、予め、各プログラムの不正アクセスの許される回数(許容回数)を記憶している。信号監視部703は、セキュアメモリ713とCPUとの間のバス上の信号を監視し、CPUのアクセス対象となっているセキュアメモリ713上のアドレスを検出する。
The access management unit 702 receives access information from each program on the secure memory 713 and stores the received access information in association with the corresponding program. Each program is provided with a counter that counts the number of unauthorized accesses.
The signal monitoring unit 703 stores in advance the number of times unauthorized access of each program is permitted (allowable number). The signal monitoring unit 703 monitors a signal on the bus between the secure memory 713 and the CPU, and detects an address on the secure memory 713 that is an access target of the CPU.

次に、アクセス管理部702から、現在実行中のプログラムのアクセス情報を読み出し、読み出したアクセス情報と検出したアドレスとを比較する。検出したアドレスが、読み出したアクセス情報の示す記憶領域に含まれていれば、そのまま、監視を続ける。
含まれていなければ、アクセス管理部702が該当するプログラムと対応付けて記憶しているカウンタに1加算する。次に、カウンタと記憶している許容回数とを比較する。カウンタが許容回数以下であれば、そのまま監視を続ける。
Next, the access information of the program currently being executed is read from the access management unit 702, and the read access information is compared with the detected address. If the detected address is included in the storage area indicated by the read access information, monitoring is continued as it is.
If not included, the access management unit 702 adds 1 to the counter stored in association with the corresponding program. Next, the counter is compared with the stored allowable number of times. If the counter is less than the allowable number of times, monitoring is continued as it is.

カウンタが許容回数を超えていれば、該当するプログラムが不正であると判定する。
ここで、不正であると判定されたプログラムが音楽復号プログラム704であった場合、信号監視部703は、強制的に、音楽復号プログラム704の実行を中止し、セキュアOS707にCPU102の実行権を移す。
不正であると判定されたプログラムがその他のセキュアアプリケーションである場合も同様である。
If the counter exceeds the allowable number of times, it is determined that the corresponding program is invalid.
If the program determined to be illegal is the music decryption program 704, the signal monitoring unit 703 forcibly stops the execution of the music decryption program 704 and transfers the execution right of the CPU 102 to the secure OS 707. .
The same applies when the program determined to be illegal is another secure application.

不正であると判定されたプログラムがセキュアOS707である場合、信号監視部703は、強制的に、セキュアOS707の実行を中止し、CPU102及びMMUをクリアし、切替制御部へ切替指示を出力する。
4.2まとめ・効果
以上説明してきたように、本発明の携帯電話は、セキュアメモリ713にロードされている各プログラムの動作を監視し、不正の動作を繰り返すプログラムの実行を中止する。このようにすることで、万一、セキュアメモリ713中のプログラムに欠陥があった場合や、実行途中で不正な改ざんが加えられた場合でも、これらのプログラムの実行を停止することができる。
If the program determined to be illegal is the secure OS 707, the signal monitoring unit 703 forcibly stops the execution of the secure OS 707, clears the CPU 102 and the MMU, and outputs a switching instruction to the switching control unit.
4.2 Summary / Effects As described above, the mobile phone of the present invention monitors the operation of each program loaded in the secure memory 713 and stops executing a program that repeats an illegal operation. In this way, even if a program in the secure memory 713 has a defect or an unauthorized alteration is made during execution, the execution of these programs can be stopped.

4.3実施の形態4の変形例
(1)上記の実施の形態では、メモリ保護部701は、信号監視部703により、バス上の信号を監視することで不正な動作を検出しているが、これに代わって、定期的にCPUのプログラムカウンタ値を監視するとしても良い。
(2)上記の実施の形態では、セキュアメモリ713上の各プログラムが、起動時に、各プログラムごとに異なるアクセス情報をアクセス管理部702出力し、信号監視部703は、これらのアクセス情報を基に、各プログラムの動作を監視しているが、予め、アクセス管理部702が、セキュアメモリ713上のアクセス禁止領域を示す情報を記憶しているとしてもよい。この場合、いずれのプログラムが実行中であっても、禁止領域にアクセスしようとすると、信号監視部は、CPU102によるプログラム実行を中止し、CPU102及びMMUをクリアし、切替制御部へ切替指示を出力する。
4.3 Modification of Embodiment 4 (1) In the above embodiment, the memory protection unit 701 detects an illegal operation by monitoring a signal on the bus by the signal monitoring unit 703. Instead of this, the program counter value of the CPU may be periodically monitored.
(2) In the above embodiment, each program on the secure memory 713 outputs different access information for each program at the time of activation, and the signal monitoring unit 703 is based on the access information. Although the operation of each program is monitored, the access management unit 702 may store information indicating the access prohibited area on the secure memory 713 in advance. In this case, when any program is being executed, if the attempt is made to access the prohibited area, the signal monitoring unit stops the program execution by the CPU 102, clears the CPU 102 and the MMU, and outputs a switching instruction to the switching control unit. To do.

(2)本実施の形態において、メモリ保護部701は、実施の形態2において説明したように、無効化リスト記憶部、アプリ検証部、アプリ無効化部、OS検証部、OS無効化部を備えており、切替制御部から接続指示を受けると、セキュアメモリ上の各プログラムが有効であるか否かを判定するとしてもよい。
この構成において、信号監視部703は、動作途中に不正な動作を行うプログラムを発見し、そのプログラムの動作を停止させると共に、無効化リスト記憶部の記憶しているOS無効化リスト又はアプリ無効化リストに、不正動作を行ったプログラムと対応するセキュアOSID又はアプリIDを追加する。
(2) In the present embodiment, as described in the second embodiment, the memory protection unit 701 includes an invalidation list storage unit, an application verification unit, an application invalidation unit, an OS verification unit, and an OS invalidation unit. When a connection instruction is received from the switching control unit, it may be determined whether each program on the secure memory is valid.
In this configuration, the signal monitoring unit 703 finds a program that performs an illegal operation during the operation, stops the operation of the program, and disables the OS invalidation list or application invalidation stored in the invalidation list storage unit. A secure OSID or application ID corresponding to the program that performed the illegal operation is added to the list.

このようにすることで、新たに発見された無効なプログラムを、再度、実行することがなくなる。
5.実施の形態
本発明の実施の形態5について以下に説明する。
実施の形態5の携帯電話750は、2枚のメモリカードを装着する。メモリカードのうち一方には、OS(オペレーティングシステム)及び、各種のアプリケーションが記憶されており、携帯電話750は、これらのプログラムを読み出して実行する。説明の便宜上このメモリカードを通常メモリカード800と呼ぶ。
By doing in this way, the newly discovered invalid program will not be executed again.
5. Embodiment 5 Embodiment 5 of the present invention will be described below.
The cellular phone 750 of the fifth embodiment has two memory cards. One of the memory cards stores an OS (operating system) and various applications, and the mobile phone 750 reads and executes these programs. For convenience of explanation, this memory card is called a normal memory card 800.

もう一方のメモリカードには、保護されるべき処理を行うプログラムが暗号化されて記憶されている。各プログラムは、プログラム部分とデータ部分とから構成される。説明の便宜上、このメモリカードをセキュアメモリカード820と呼ぶ。
携帯電話750は、セキュアメモリカード820上の各プログラムが、他のプログラムのプログラム部分を読み出すことは許可するが、他のプログラムのデータ部分を読み出すことを禁止する。
The other memory card stores an encrypted program for performing processing to be protected. Each program is composed of a program part and a data part. For convenience of explanation, this memory card is referred to as a secure memory card 820.
The cellular phone 750 permits each program on the secure memory card 820 to read the program portion of the other program, but prohibits reading the data portion of the other program.

5.1 セキュアメモリカード820
セキュアメモリカード820は、図67に示すように、入出力部821及び情報記憶部830から構成される。
セキュアメモリカード820は、具体的にはマイクロプロセッサ、RAM及びROMを含んで構成されるコンピュータシステムであり、前記RAM、ROMにはコンピュータプログラムが記憶されている。前記マイクロプロセッサが前記コンピュータプログラムに従って動作することにより、セキュアメモリカード820は、その機能の一部を達成する。
5.1 Secure memory card 820
As shown in FIG. 67, the secure memory card 820 includes an input / output unit 821 and an information storage unit 830.
Specifically, the secure memory card 820 is a computer system including a microprocessor, a RAM, and a ROM, and computer programs are stored in the RAM and the ROM. The secure memory card 820 achieves a part of its functions by the microprocessor operating according to the computer program.

入出力部821は、外部機器との間で情報の入出力を行う。
情報記憶部830は、セキュアID850、暗号化音楽復号プログラム831、暗号化鍵生成プログラム841などを記憶している。
セキュアID850は、セキュアメモリカード820に固有の情報であり、セキュアメモリカード820がセキュアな処理を行うプログラムを格納していることを示している。
The input / output unit 821 inputs / outputs information to / from an external device.
The information storage unit 830 stores a secure ID 850, an encrypted music decryption program 831, an encryption key generation program 841, and the like.
The secure ID 850 is information unique to the secure memory card 820, and indicates that the secure memory card 820 stores a program for performing secure processing.

暗号化音楽復号プログラム831は、ID832「A」、暗号化復号プログラム834及び暗号化復号データ836を含む。ID832「A」は、暗号化音楽復号プログラム831に固有の識別情報である。
暗号化復号プログラム834は、音楽データを復号する手順を含む復号プログラムを暗号化して生成されたものであり、暗号化復号データ836は、復号プログラムが復号の処理に使用するパラメータなどのデータを暗号化したものである。
The encrypted music decryption program 831 includes an ID 832 “A”, an encryption / decryption program 834, and encrypted decryption data 836. ID 832 “A” is identification information unique to the encrypted music decryption program 831.
The encryption / decryption program 834 is generated by encrypting a decryption program including a procedure for decrypting music data. The encryption / decryption data 836 encrypts data such as parameters used by the decryption program for decryption processing. It has become.

暗号化鍵生成プログラム841は、ID842「B」、暗号化生成プログラム844、暗号化鍵データ846を含んで構成される。
ID842「B」は、暗号化鍵生成プログラム841に固有の識別情報である。暗号化生成プログラム844は、暗号鍵を生成する手順を含む生成プログラムを暗号化したものであり、暗号化鍵データ846は、前記生成プログラムの使用するパラメータなどのデータを暗号化したものである。
The encryption key generation program 841 includes an ID 842 “B”, an encryption generation program 844, and encryption key data 846.
The ID 842 “B” is identification information unique to the encryption key generation program 841. The encryption generation program 844 is an encryption of a generation program including a procedure for generating an encryption key, and the encryption key data 846 is an encryption of data such as parameters used by the generation program.

5.2 通常メモリカード800
通常メモリカード800は、図68に示すように、入出力部801と情報記憶部802とを含んで構成される。
入出力部801は、情報記憶部802と外部機器との間で、各種のデータの入出力を行う。
5.2 Normal memory card 800
The normal memory card 800 includes an input / output unit 801 and an information storage unit 802 as shown in FIG.
The input / output unit 801 inputs and outputs various types of data between the information storage unit 802 and the external device.

情報記憶部802は、音楽再生プログラム808を初めとする各種のアプリケーション及びOS806を記憶している。情報記憶部802に記憶されているプログラムは、それぞれのプログラムが実行する処理の手順を含むコード部とデータ部とから構成される。また、それぞれのプログラムに固有のプログラムIDを有している。一例として、OS806は、プログラムID「OS」を有しており、音楽再生プログラム808は、プログラムID「E」を有している。   The information storage unit 802 stores various applications such as a music playback program 808 and an OS 806. The program stored in the information storage unit 802 is composed of a code part and a data part including a procedure of processing executed by each program. Each program has a unique program ID. As an example, the OS 806 has a program ID “OS”, and the music playback program 808 has a program ID “E”.

5.3 携帯電話750
携帯電話750は、図68に示すように、デバッガIF751、CPU752、MMU753、割込コントローラ757、入力部758、表示部759、メモリ761、メモリ保護部764、入出力部765、入出力部766、無線通信制御部768、通信部771、アンテナ772、マイク769、スピーカ770、バッファ773、符号処理部774、D/A変換部776をバス760によって接続して構成される。
5.3 Mobile phone 750
68, the mobile phone 750 includes a debugger IF 751, a CPU 752, an MMU 753, an interrupt controller 757, an input unit 758, a display unit 759, a memory 761, a memory protection unit 764, an input / output unit 765, an input / output unit 766, A wireless communication control unit 768, a communication unit 771, an antenna 772, a microphone 769, a speaker 770, a buffer 773, a code processing unit 774, and a D / A conversion unit 776 are connected by a bus 760.

デバッガIF751、MMU753、割込コントローラ757、入力部758、表示部759、無線通信制御部768、通信部771、アンテナ772、マイク769、スピーカ770、バッファ773、符号処理部774D/A変換部776の動作及び構成は実施の形態1と同様であるのでここでは説明を省略する。また、メモリ761は、各種のデータ及びプログラムを記憶しており、CPU752は、メモリ761、通常メモリカード800及びセキュアメモリカード820に記憶されているプログラムに含まれる命令を1個ずつフェッチし、フェッチした命令を解読し実行する。   Debugger IF 751, MMU 753, interrupt controller 757, input unit 758, display unit 759, wireless communication control unit 768, communication unit 771, antenna 772, microphone 769, speaker 770, buffer 773, code processing unit 774 D / A conversion unit 776 Since the operation and configuration are the same as those of the first embodiment, description thereof is omitted here. The memory 761 stores various data and programs, and the CPU 752 fetches instructions included in the programs stored in the memory 761, the normal memory card 800, and the secure memory card 820 one by one. Decode and execute the command.

以下に、本実施の形態の特徴部分であるメモリ保護部764、入出力部765、入出力部766について説明する。
(1)入出力部765及び入出力部766
入出力部765及び入出力部766は、2枚のメモリカードのいずれかと接続され、メモリカードとメモリ保護部764との間で、情報の入出力を行う。
Hereinafter, the memory protection unit 764, the input / output unit 765, and the input / output unit 766, which are features of this embodiment, will be described.
(1) Input / output unit 765 and input / output unit 766
The input / output unit 765 and the input / output unit 766 are connected to one of the two memory cards, and input / output information between the memory card and the memory protection unit 764.

(2)メモリ保護部764
メモリ保護部764は、図69に示すように、復号部781、復号鍵記憶部782、アクセス制御部783、鍵記憶部784、メモリ情報記憶部785及びID検出部786から構成される。
(2−1)鍵記憶部784
鍵記憶部784は、暗号化音楽復号プログラム831の復号鍵及び暗号化鍵生成プログラム841の復号鍵をそれぞれのプログラムのIDと対応付けて記憶している。
(2) Memory protection unit 764
As shown in FIG. 69, the memory protection unit 764 includes a decryption unit 781, a decryption key storage unit 782, an access control unit 783, a key storage unit 784, a memory information storage unit 785, and an ID detection unit 786.
(2-1) Key storage unit 784
The key storage unit 784 stores the decryption key of the encrypted music decryption program 831 and the decryption key of the encryption key generation program 841 in association with the ID of each program.

(2−2)復号部781及び復号鍵記憶部782
復号部781は、アクセス制御部783のから、復号指示及び暗号文を受け取る。復号指示を受け取ると、復号鍵記憶部782から復号鍵を読み出し、読み出した復号鍵を用いて、暗号化データを復号し、平文を生成する。生成した平文をCPU752へ出力する。
ここで復号部781が復号する暗号化データは、セキュアメモリカード820に記憶されている暗号化音楽復号プログラム831、暗号化鍵生成プログラム841を構成する暗号化データである。
(2-2) Decryption unit 781 and decryption key storage unit 782
The decryption unit 781 receives the decryption instruction and the ciphertext from the access control unit 783. When the decryption instruction is received, the decryption key is read from the decryption key storage unit 782, and the encrypted data is decrypted using the read decryption key to generate plain text. The generated plaintext is output to the CPU 752.
Here, the encrypted data decrypted by the decryption unit 781 is encrypted data constituting the encrypted music decryption program 831 and the encryption key generation program 841 stored in the secure memory card 820.

復号鍵記憶部782は、復号部781の使用する復号鍵を1個だけ格納している。
(2−3)メモリ情報記憶部785
メモリ情報記憶部785は、図70に示すように、セキュアメモリ情報テーブル811及び通常メモリ情報テーブル861を記憶している。
セキュアメモリ情報テーブル811は、複数のセキュアメモリ情報812、813・・・から構成される。各セキュアメモリ情報は、プログラムID、コードアドレス及びデータアドレスを含む。
The decryption key storage unit 782 stores only one decryption key used by the decryption unit 781.
(2-3) Memory information storage unit 785
As shown in FIG. 70, the memory information storage unit 785 stores a secure memory information table 811 and a normal memory information table 861.
The secure memory information table 811 includes a plurality of secure memory information 812, 813,. Each secure memory information includes a program ID, a code address, and a data address.

プログラムIDは、セキュアメモリカード820に記憶されている各プログラムのIDである。コードアドレスは、セキュアメモリカード820内に記憶されている暗号化アプリケーションのプログラム部分の格納されている領域を示すアドレスである。データアドレスは、暗号化アプリケーションのデータ部分が格納されている領域を示すアドレスである。   The program ID is an ID of each program stored in the secure memory card 820. The code address is an address indicating an area where the program portion of the encrypted application stored in the secure memory card 820 is stored. The data address is an address indicating an area in which the data portion of the encrypted application is stored.

具体的には、セキュアメモリ情報812は、プログラムIDとして、暗号化音楽復号プログラム831のID「A」832と、コードアドレスとして、暗号化復号プログラム834の記憶されているアドレス「A000〜A111」と、データアドレスとして、暗号化復号データ836の記憶されているアドレス「A222〜A333」を含んでいる。
セキュアメモリ情報813は、プログラムIDとして、暗号化鍵生成プログラム841のID「B」842と、コードアドレスとして、暗号化生成プログラム844の記憶されているアドレス「A444〜A555」と、データアドレスとして、暗号化鍵データ846の記憶されているアドレス「A666〜A777」を含んでいる。
Specifically, the secure memory information 812 includes an ID “A” 832 of the encrypted music decryption program 831 as a program ID and an address “A000 to A111” stored in the encryption / decryption program 834 as a code address. The data addresses include addresses “A222 to A333” in which the encrypted / decrypted data 836 is stored.
The secure memory information 813 includes an ID “B” 842 of the encryption key generation program 841 as a program ID, an address “A444 to A555” stored as an encryption generation program 844 as a code address, and a data address as The address “A666 to A777” where the encryption key data 846 is stored is included.

通常メモリ情報テーブル861は、複数の通常メモリ情報862、863・・・を含んで構成され、各通常メモリ情報は、プログラムID、コードアドレス及びデータアドレスを含む。
プログラムIDは、通常メモリカード800上に記憶されているプログラムのIDであり、コードアドレスは、プログラムIDと対応するプログラムのプログラム部分が記憶されている領域を示すアドレスであり、データアドレスは、データ部分が記憶されている領域のアドレスである。
The normal memory information table 861 includes a plurality of normal memory information 862, 863..., And each normal memory information includes a program ID, a code address, and a data address.
The program ID is an ID of a program normally stored on the memory card 800, the code address is an address indicating the area where the program portion of the program corresponding to the program ID is stored, and the data address is data This is the address of the area where the part is stored.

具体的に、通常メモリ情報862は、通常メモリカード800上に記憶されているOS806と対応しており、通常メモリ情報863は、音楽再生プログラム808と対応している。
(2−4)ID検出部786
ID検出部786は、CPU752のプログラムカウンタ(以下PC)を常時監視しており、CPU752が、セキュアメモリカード820上のプログラムを実行している間は、CPU752が実行中のプログラムを示すプログラムIDを記憶している。
Specifically, the normal memory information 862 corresponds to the OS 806 stored on the normal memory card 800, and the normal memory information 863 corresponds to the music playback program 808.
(2-4) ID detection unit 786
The ID detection unit 786 constantly monitors a program counter (hereinafter referred to as a PC) of the CPU 752, and while the CPU 752 is executing a program on the secure memory card 820, a program ID indicating a program being executed by the CPU 752 is displayed. I remember it.

以下に、図71のフローチャートを用いて、ID検出部786の動作について説明する。なお、説明の便宜上ステップS801から説明を開始する。このとき、CPU752は、通常メモリカード800又はメモリ761上に記憶されているプログラムを実行している。
ID検出部786は、PCを監視し(ステップS801)、メモリ情報記憶部785の記憶しているセキュアメモリ情報テーブル811及び通常メモリ情報テーブル861に含まれる、各プログラムのコードアドレスと、PCの示すアドレスとを比較することにより、PCの示すアドレスがセキュアメモリカード820上のアドレスであるか否かを判断する(ステップS802)。
The operation of the ID detection unit 786 will be described below using the flowchart of FIG. For convenience of description, the description starts from step S801. At this time, the CPU 752 is executing a program stored on the normal memory card 800 or the memory 761.
The ID detection unit 786 monitors the PC (step S801), shows the code address of each program included in the secure memory information table 811 and the normal memory information table 861 stored in the memory information storage unit 785, and the PC By comparing with the address, it is determined whether or not the address indicated by the PC is an address on the secure memory card 820 (step S802).

セキュアメモリカード820上のアドレスでなければ(ステップS802のNO)、PCの監視を継続する。
セキュアメモリカード820上のアドレスであると判断すると(ステップS802のYES)、次に、PCから検出したアドレスと対応するセキュアメモリ情報をセキュアメモリ情報テーブル811から選択し、選択したセキュアメモリ情報に含まれるプログラムIDを抽出する(ステップS803)。抽出したプログラムIDを記憶する(ステップS804)。次に、アクセス制御部783へ、セキュアメモリカード820上のプログラムの実行が開始されることを示すセキュアアクセス通知を出力する(ステップS805)。
If the address is not on the secure memory card 820 (NO in step S802), PC monitoring is continued.
If it is determined that the address is on the secure memory card 820 (YES in step S802), then the secure memory information corresponding to the address detected from the PC is selected from the secure memory information table 811 and included in the selected secure memory information. The program ID is extracted (step S803). The extracted program ID is stored (step S804). Next, a secure access notification indicating that execution of the program on the secure memory card 820 is started is output to the access control unit 783 (step S805).

次に、PCを監視し(ステップS806)、PCに格納されているアドレスがセキュアメモリカード820上のアドレスであるか否かを判断する(ステップS807)。
セキュアメモリカード820上のアドレスであると判断すると(ステップS807のYES)、PCから検出したアドレスと対応するセキュアメモリ情報をセキュアメモリ情報テーブル811から選択し、選択したセキュアメモリ情報に含まれるプログラムIDを抽出する(ステップS809)。抽出したプログラムIDとID検出部786自身の記憶しているプログラムIDとを比較する。両者が一致していれば(ステップS811のYES)、ステップS806へ戻って、PCの監視を続ける。
Next, the PC is monitored (step S806), and it is determined whether or not the address stored in the PC is an address on the secure memory card 820 (step S807).
If it is determined that the address is on the secure memory card 820 (YES in step S807), secure memory information corresponding to the address detected from the PC is selected from the secure memory information table 811 and the program ID included in the selected secure memory information is selected. Is extracted (step S809). The extracted program ID is compared with the program ID stored in the ID detection unit 786 itself. If they match (YES in step S811), the process returns to step S806 to continue monitoring the PC.

両者が一致していない場合(ステップS811のNO)、記憶しているプログラムIDを抽出したプログラムIDに書き換え(ステップS812)、ステップS806へ戻る。
ステップS807において、セキュアメモリカード820上のアドレスでないと判断すると(ステップS807のNO)、ID検出部786自身の記憶しているプログラムIDを消去し(ステップS814)、ステップS801へ戻る。
If they do not match (NO in step S811), the stored program ID is rewritten to the extracted program ID (step S812), and the process returns to step S806.
If it is determined in step S807 that the address is not on the secure memory card 820 (NO in step S807), the program ID stored in the ID detection unit 786 itself is deleted (step S814), and the process returns to step S801.

(2−5)アクセス制御部783
アクセス制御部783は、予め、セキュアメモリカード820に書き込まれているセキュアIDを記憶している。
入出力部765及び入出力部766を介して、メモリカードが装着されたことを検出する。メモリカードの装着を検出すると、メモリカードに書き込まれているデータを検索する。記憶しているセキュアIDと同一のセキュアID850を検出した場合、そのメモリカードがセキュアメモリカード820であることを検知する。ここでは、入出力部265が、通常メモリカード800と接続されており、セキュアメモリカード820がセキュアメモリカード820と接続されている場合を想定する。
(2-5) Access control unit 783
The access control unit 783 stores a secure ID written in the secure memory card 820 in advance.
It is detected through the input / output unit 765 and the input / output unit 766 that a memory card is inserted. When it is detected that the memory card is inserted, the data written in the memory card is searched. When the same secure ID 850 as the stored secure ID is detected, it is detected that the memory card is the secure memory card 820. Here, it is assumed that the input / output unit 265 is connected to the normal memory card 800 and the secure memory card 820 is connected to the secure memory card 820.

アクセス制御部783は、入出力部765を介して通常メモリカード800の装着を検出すると、入出力部765を介して、通常メモリカード800に記憶されている情報をサーチし、通常メモリ情報テーブルを生成し、生成した通常メモリ情報テーブルをメモリ情報記憶部785へ格納する。
また、入出力部766を介して、セキュアメモリカード820の装着を検出すると、入出力部766を介して、セキュアメモリカード820に記憶されている情報をサーチし、セキュアメモリ情報テーブルを生成し、生成したセキュアメモリ情報テーブルをメモリ情報記憶部785に書き込む。
When the access control unit 783 detects the attachment of the normal memory card 800 via the input / output unit 765, the access control unit 783 searches the information stored in the normal memory card 800 via the input / output unit 765, and stores the normal memory information table. The generated normal memory information table is stored in the memory information storage unit 785.
Further, when the installation of the secure memory card 820 is detected via the input / output unit 766, information stored in the secure memory card 820 is searched via the input / output unit 766, and a secure memory information table is generated. The generated secure memory information table is written into the memory information storage unit 785.

アクセス制御部783は、CPU752が通常メモリカード800へアクセスする際に、CPU752から出力される信号(以下アクセス信号と呼ぶ)を、そのまま通常メモリカード800へ仲介し、また、通常メモリカード800から、出力されるデータを受け取り、受け取ったデータをCPU752へ出力する。
CPU752がセキュアメモリカード820へアクセスする際には、アクセス信号からアクセス先のアドレスを抽出し、抽出したアドレスによって、セキュアメモリカード820データの読み出し又読み出しの禁止を行う。このような、アクセス制御部783の動作について、図71、72に示すフローチャートを用いて、詳細に説明する。なお、説明の便宜上、ステップS821から説明を始める。このとき、CPU752は、通常メモリカード800又はメモリ761上のプログラムを実行している。
When the CPU 752 accesses the normal memory card 800, the access control unit 783 mediates a signal output from the CPU 752 (hereinafter referred to as an access signal) to the normal memory card 800 as it is, and from the normal memory card 800, The output data is received, and the received data is output to the CPU 752.
When the CPU 752 accesses the secure memory card 820, the access destination address is extracted from the access signal, and reading or reading of the secure memory card 820 data is prohibited by the extracted address. The operation of the access control unit 783 will be described in detail with reference to the flowcharts shown in FIGS. For convenience of description, the description starts from step S821. At this time, the CPU 752 is executing a program on the normal memory card 800 or the memory 761.

アクセス制御部783は、CPU752と通常メモリカード800との間で、データの入出力を仲介する(ステップS821)。
ID検出部786から、セキュアメモリカード820上のプログラムの実行が開始されることを示すセキュアアクセス通知を受け取る(ステップS805)。
セキュアアクセス通知を受け取ると、アクセス制御部783は、デバッガIF751を無効化し(ステップS823)、ID検出部786に記憶されているプログラムIDを読み出す(ステップS824)。読み出したプログラムIDと対応する復号鍵を鍵記憶部784から読み出し(ステップS826)、読み出した復号鍵を復号鍵記憶部782へ書き込む(ステップS827)。
The access control unit 783 mediates data input / output between the CPU 752 and the normal memory card 800 (step S821).
A secure access notification indicating that the execution of the program on the secure memory card 820 is started is received from the ID detection unit 786 (step S805).
Upon receiving the secure access notification, the access control unit 783 invalidates the debugger IF 751 (step S823), and reads the program ID stored in the ID detection unit 786 (step S824). The decryption key corresponding to the read program ID is read from the key storage unit 784 (step S826), and the read decryption key is written to the decryption key storage unit 782 (step S827).

次に、CPU752から出力されるアクセス信号を受け取り、受け取ったアクセス信号から、アクセス先のアドレスを検出する(ステップS829)。
アクセス先のアドレスを検出すると、ID検出部786からプログラムIDを読み出す(ステップS831)。プログラムIDを読み出すと(ステップS832のYES)、コードアドレス又はデータアドレスに検出したアクセス先アドレスを含むセキュアメモリ情報を、セキュアメモリ情報テーブル811から選択し、選択したセキュアメモリ情報からプログラムIDを抽出する(ステップS834)。
Next, the access signal output from the CPU 752 is received, and the access destination address is detected from the received access signal (step S829).
When the access destination address is detected, the program ID is read from the ID detection unit 786 (step S831). When the program ID is read (YES in step S832), secure memory information including the access destination address detected in the code address or data address is selected from the secure memory information table 811, and the program ID is extracted from the selected secure memory information. (Step S834).

抽出したプログラムIDとID検出部786から読み出したプログラムIDとを比較し、両者が一致していれば(ステップS836のYES)、ステップS844へ処理を移す。
両者が一致していない場合(ステップS836のNO)、アクセス制御部783は、さらに、検出したアドレスが、選択したセキュアメモリ情報のコードアドレスに含まれているのか、データアドレスに含まれているのかを判定する(ステップS838)。データアドレスに含まれていると判定した場合(ステップS838のNO)、アクセスが許可できないことを示すエラー通知をCPU752へ出力し、ステップS829へ戻る。
The extracted program ID is compared with the program ID read from the ID detection unit 786. If the two match (YES in step S836), the process proceeds to step S844.
If the two do not match (NO in step S836), the access control unit 783 further determines whether the detected address is included in the code address of the selected secure memory information or the data address. Is determined (step S838). If it is determined that the data address is included (NO in step S838), an error notification indicating that access cannot be permitted is output to the CPU 752, and the process returns to step S829.

コードアドレスに含まれると判定した場合(ステップS838のYES)、抽出したプログラムIDと対応する復号鍵を、鍵記憶部784から読み出し、復号鍵記憶部782の記憶している復号鍵を、読み出した復号鍵に変更する(ステップS842)。
次に、入出力部766を介して検出したアドレスに該当する記憶領域に記憶されている情報を読み出す(ステップS844)。読み出した情報の復号を復号部781へ指示し(ステップS846)、ステップS829へ戻る。
If it is determined that it is included in the code address (YES in step S838), the decryption key corresponding to the extracted program ID is read from the key storage unit 784, and the decryption key stored in the decryption key storage unit 782 is read. The decryption key is changed (step S842).
Next, the information stored in the storage area corresponding to the address detected via the input / output unit 766 is read (step S844). The decoding unit 781 is instructed to decode the read information (step S846), and the process returns to step S829.

ステップS832において、ID検出部786に記憶されているプログラムIDが存在しない場合(ステップS832のNO)、アクセス制御部783は、復号鍵記憶部782に記憶されている復号鍵を消去し(ステップS851)、デバッガIF751を有効にし(ステップS852)ステップS821へ戻る。
5.4 まとめ・効果
以上、説明してきたように、本発明の携帯電話は、通常メモリカード及びセキュアメモリカードに記憶されているプログラムを実行する。セキュアメモリカードに記憶されているプログラは予め暗号化されている。
In step S832, when the program ID stored in the ID detection unit 786 does not exist (NO in step S832), the access control unit 783 deletes the decryption key stored in the decryption key storage unit 782 (step S851). ), The debugger IF 751 is enabled (step S852), and the process returns to step S821.
5.4 Summary / Effects As described above, the mobile phone of the present invention executes a program stored in a normal memory card and a secure memory card. The program stored in the secure memory card is encrypted in advance.

メモリ保護部764は、CPU752がセキュアメモリカード820に記憶されているプログラムを実行する際に、実行中のプログラムによって、アクセスを許可する領域と、禁止する領域とを管理している。
音楽復号プログラムが実行される場合を例に説明すると、CPU752は、暗号化音楽復号プログラム831に含まれる暗号化音楽復号プログラム831の記憶されている領域と、暗号化鍵生成プログラムの暗号化生成プログラム844の記憶されている領域にアクセスすることはできるが、暗号化鍵生成プログラムの暗号化鍵データ846の記憶されている領域にはアクセスできない。
When the CPU 752 executes a program stored in the secure memory card 820, the memory protection unit 764 manages an area where access is permitted and an area where access is prohibited by the program being executed.
The case where the music decryption program is executed will be described as an example. The CPU 752 includes an area where the encrypted music decryption program 831 included in the encrypted music decryption program 831 is stored, and an encryption generation program of the encryption key generation program. The area 844 stored can be accessed, but the area stored the encryption key data 846 of the encryption key generation program cannot be accessed.

このようにして、セキュアメモリカード820上の各アプリケーションは、他のアプリケーションから、自身のデータ部にアクセスされ、不正にデータを読み出し、変更されることを回避できる。
また、セキュアメモリカード820に記憶されている情報は、暗号化されているため、セキュアメモリカード820上のプログラム以外のプログラムをCPU752が実行している途中に、セキュアメモリカード820にアクセスした場合でも、解読することができない。従って、セキュアメモリカード820上のデータを不正なアクセスから保護することができる。
5.5 実施の形態5に関する変形例
上記の実施の形態では、セキュアメモリカード820上のセキュアアプリケーションの実行中にCPU752が、他のアプリケーションのデータ部分にアクセスしようとした場合、アクセス制御部783は、CPU752にエラー通知を出力しているが、実施の形態4の場合と同様に、他のプログラム、例えばOS806にCPU752の実行権を移すとしても良い。この場合、アクセス制御部783は、復号鍵記憶部782に記憶されている復号鍵を消去し、OS806の記憶されているアドレスをCPU782のプログラムカウンタに設定する。
6. その他の変形例
以上、実施の形態1〜5によって、本発明について説明してきたが、本発明は、これらの実施の形態に限定されるものではなく、以下のような場合も含む。
In this way, each application on the secure memory card 820 can be prevented from being illegally read and changed by accessing its own data part from other applications.
Further, since the information stored in the secure memory card 820 is encrypted, even when the secure memory card 820 is accessed while the CPU 752 is executing a program other than the program on the secure memory card 820. Can't decipher. Therefore, the data on the secure memory card 820 can be protected from unauthorized access.
5.5 Modification Regarding Embodiment 5 In the above embodiment, when the CPU 752 tries to access the data portion of another application while the secure application on the secure memory card 820 is being executed, the access control unit 783 Although the error notification is output to the CPU 752, the execution right of the CPU 752 may be transferred to another program such as the OS 806 as in the case of the fourth embodiment. In this case, the access control unit 783 deletes the decryption key stored in the decryption key storage unit 782, and sets the address stored in the OS 806 in the program counter of the CPU 782.
6). Other Modifications Although the present invention has been described above with reference to the first to fifth embodiments, the present invention is not limited to these embodiments, and includes the following cases.

(1)本発明は、上記の実施の形態1〜3及び変形例を実行する方法であってもよい。
(2)また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプログラムからなるデジタル信号であるとしてもよい。
また、本発明は、前記コンピュータプログラム又は前記デジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD―ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu−ray Disc)、半導体メモリなどに記録したものとしてもよい。また、これらの記録媒体に記録されている前記コンピュータプログラム又は前記デジタル信号であるとしてもよい。
(1) The present invention may be a method for executing the above-described first to third embodiments and modifications.
(2) Further, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.
The present invention also provides a computer-readable recording medium such as a flexible disk, hard disk, CD-ROM, MO, DVD, DVD-ROM, DVD-RAM, BD (Blu-ray Disc). ), Recorded in a semiconductor memory or the like. Further, the present invention may be the computer program or the digital signal recorded on these recording media.

また、本発明は、前記コンピュータプログラム又は前記デジタル信号を、電気通信回線、無線又は有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしてもよい。
また、本発明は、マイクロプロセッサとメモリとを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしてもよい。
Further, the present invention may transmit the computer program or the digital signal via an electric communication line, a wireless or wired communication line, a network represented by the Internet, a data broadcast, or the like.
The present invention may be a computer system including a microprocessor and a memory, wherein the memory stores the computer program, and the microprocessor operates according to the computer program.

また、前記プログラム又は前記デジタル信号を前記記録媒体に記録して移送することにより、又は前記プログラム又は前記デジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。
(3)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。
In addition, the program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like, and is executed by another independent computer system. It is good.
(3) The above embodiment and the above modifications may be combined.

本発明を構成する各装置及び記録媒体は、保護される必要のある情報を取り扱う産業、例えば、映像及び音声を含むコンテンツの作成、配給に係る産業、及び、これらの情報を取り扱う電器機器を製造し、販売する産業において、経営的に、また継続的及び反復的に使用することができる。また、本発明を構成する各装置及び記録媒体は、電器機器製造産業において、経営的に、また継続的及び反復的に、製造し、販売することができる。   Each apparatus and recording medium constituting the present invention manufactures industries that handle information that needs to be protected, such as industries that create and distribute contents including video and audio, and electrical equipment that handles these information. And can be used in the selling industry in a management, continuous and repetitive manner. In addition, each device and recording medium constituting the present invention can be manufactured and sold in the electric appliance manufacturing industry in a management manner, continuously and repeatedly.

図1は、実施の形態1の携帯電話100の使用例を示す。FIG. 1 shows an example of use of the mobile phone 100 of the first embodiment. 図2は、携帯電話100及びメモリカード300の構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of the mobile phone 100 and the memory card 300. 図3は、二次記憶部104に記憶されている情報の一例を示す。FIG. 3 shows an example of information stored in the secondary storage unit 104. 図4は、通常メモリ111に記憶されている情報の一例を示す。FIG. 4 shows an example of information stored in the normal memory 111. 図5は、アプリ管理表166の詳細を示す。FIG. 5 shows details of the application management table 166. 図6は、セキュアメモリ113に記憶されている情報の一例を示す。FIG. 6 shows an example of information stored in the secure memory 113. 図7は、セキュアアプリ管理表186の詳細を示す。FIG. 7 shows details of the secure application management table 186. 図8は、通常メモリ111及びセキュアメモリ113に記憶されているプログラムの関連を示したブロック図である。FIG. 8 is a block diagram showing the relationship between programs stored in the normal memory 111 and the secure memory 113. 通常OS151及びセキュアメモリ113の取り扱うコマンドのデータ構成を示す。The data structure of the command which normal OS151 and the secure memory 113 handle is shown. 通常OS151の動作を示すフローチャートである。5 is a flowchart showing the operation of a normal OS 151. セキュアOS171の動作を示すフローチャートである。3 is a flowchart showing the operation of a secure OS 171. 音楽復号デーモン156の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the music decoding daemon 156. 通常OS151からセキュアOS171への切替処理を示したフローチャートである。6 is a flowchart showing a process for switching from a normal OS 151 to a secure OS 171. セキュアOS171から通常OS151への切替処理を示したフローチャートである。5 is a flowchart showing a switching process from a secure OS 171 to a normal OS 151. 携帯電話100の動作を示したフローチャートである。3 is a flowchart showing the operation of the mobile phone 100. 音楽復号プログラムの登録処理における各プログラムの動作を示したフローチャートである。It is the flowchart which showed the operation | movement of each program in the registration process of a music decoding program. 音楽復号プログラムの登録処理における各プログラムの動作を示したフローチャートである。図16から続く。It is the flowchart which showed the operation | movement of each program in the registration process of a music decoding program. Continuing from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図18から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図19から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図20から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図21から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図22から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. Continuing from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図23から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図24から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. It continues from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図25から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. Continuing from FIG. 音楽復号プログラム176への処理依頼における各プログラムの動作を示したフローチャートである。図26から続く。It is the flowchart which showed the operation | movement of each program in the processing request to the music decoding program 176. Continuing from FIG. 通常OS151の実行中における、通常入出力デバイス132による割込発生時の処理を示すフローチャートである。図21ステップS239の詳細である。7 is a flowchart showing processing when an interrupt is generated by the normal input / output device 132 during execution of the normal OS 151. FIG. 21 shows details of step S239. セキュアOS171実行中における、通常入出力デバイス132による割込発生時の処理を示すフローチャートである。7 is a flowchart illustrating processing when an interrupt is generated by the normal input / output device 132 during execution of the secure OS 171. 通常OS151の実行中における、セキュアデバイス133による割込発生時の処理を示すフローチャートである。図23ステップS287の詳細である。10 is a flowchart illustrating processing when an interrupt is generated by the secure device 133 during execution of the normal OS 151. FIG. 23 shows details of step S287. 通常OS151の実行中における、セキュアデバイス133による割込発生時の処理を示すフローチャートである。図30から続く。10 is a flowchart illustrating processing when an interrupt is generated by the secure device 133 during execution of the normal OS 151. It continues from FIG. 通常OS151の実行中における、暗号処理デバイス117による割込発生時の処理を示すフローチャートである。図27ステップS337の詳細である。10 is a flowchart showing processing when an interrupt is generated by the cryptographic processing device 117 during execution of the normal OS 151. FIG. 27 shows details of step S337. 通常OS151の実行中における、暗号処理デバイス117による割込発生時の処理を示すフローチャートである。図32から続く。10 is a flowchart showing processing when an interrupt is generated by the cryptographic processing device 117 during execution of the normal OS 151. It continues from FIG. 通常OS151の実行中における、暗号処理デバイス117による割込発生時の処理を示すフローチャートである。図33から続く。10 is a flowchart showing processing when an interrupt is generated by the cryptographic processing device 117 during execution of the normal OS 151. It continues from FIG. 音楽復号プログラム176の削除処理を示したフローチャートである。It is the flowchart which showed the deletion process of the music decoding program 176. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。In the operation of the mobile phone 100, a command exchange between programs is shown. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。In the operation of the mobile phone 100, a command exchange between programs is shown. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。図37から続く。In the operation of the mobile phone 100, a command exchange between programs is shown. It continues from FIG. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。図38から続く。In the operation of the mobile phone 100, a command exchange between programs is shown. It continues from FIG. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。図39から続く。In the operation of the mobile phone 100, a command exchange between programs is shown. It continues from FIG. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。図40から続く。In the operation of the mobile phone 100, a command exchange between programs is shown. It continues from FIG. 携帯電話100の動作において、プログラム間のコマンドの受け渡しを示す。図41から続く。In the operation of the mobile phone 100, a command exchange between programs is shown. It continues from FIG. 通常メモリ111に記憶されている情報の一例を示す。An example of information stored in the normal memory 111 is shown. 携帯電話100の起動時の動作を示すフローチャートである。4 is a flowchart showing an operation when the mobile phone 100 is activated. セキュアメモリ113に記憶されている情報の一例を示す。An example of information stored in the secure memory 113 is shown. MMU制御プログラム184により形成される論理メモリ空間の一例を示す。An example of a logical memory space formed by the MMU control program 184 is shown. 実施の形態1の変形例における、各プログラム間の関連を示すブロック図である。FIG. 10 is a block diagram showing a relationship between programs in a modification of the first embodiment. 実施の形態1の変形例において、通常OS151及びセキュアOS171が有するセキュアデバイスドライバ管理表231の構成を示す。In the modification of Embodiment 1, the structure of the secure device driver management table 231 which the normal OS 151 and the secure OS 171 have is shown. 実施の形態2の携帯電話400の使用例を示す。The usage example of the mobile phone 400 of Embodiment 2 is shown. 無効化リスト発行装置250の構成を示すブロック図である。3 is a block diagram showing a configuration of an invalidation list issuing device 250. FIG. 携帯電話400に含まれるメモリ保護部414及びセキュアメモリ413の構成を示すブロック図である。4 is a block diagram showing a configuration of a memory protection unit 414 and a secure memory 413 included in a mobile phone 400. FIG. メモリ保護部414の動作を示すフローチャートである。10 is a flowchart showing the operation of the memory protection unit 414. メモリ保護部414の動作を示すフローチャートである。図52から続く。10 is a flowchart showing the operation of the memory protection unit 414. Continuing from FIG. 実施の形態2の変形例におけるメモリ保護部454及びセキュアメモリ453の構成を示すブロック図である。FIG. 22 is a block diagram showing configurations of a memory protection unit 454 and a secure memory 453 in a modification example of the second embodiment. セキュアOS証明書の詳細を示す。Details of the secure OS certificate are shown. 実施の形態2の変形例において、音楽復号プログラム476の備えるアプリ証明書501、メーカー証明書511、CA証明書521の構成及び関連を示す。In the modification of Embodiment 2, the structure and relationship of the application certificate 501, the manufacturer certificate 511, and the CA certificate 521 provided in the music decryption program 476 are shown. OS無効化リストの構成の一例を示す。An example of a structure of OS invalidation list is shown. 実施の形態3における無効化リスト発行装置の情報記憶部610に記憶されている情報の一例を示す。An example of the information memorize | stored in the information storage part 610 of the invalidation list issuing apparatus in Embodiment 3 is shown. アプリ固有鍵マトリクス592及びOS固有鍵マトリクス597の構成を示す。The configurations of the application unique key matrix 592 and the OS unique key matrix 597 are shown. アプリマトリクス無効化リスト611の詳細な構成を示す。The detailed structure of the application matrix invalidation list 611 is shown. アプリマトリクス無効化リストの生成の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the production | generation of an application matrix invalidation list. 実施の形態3の携帯電話の備えるメモリ保護部571及びセキュアメモリ613の構成を示すブロック図である。FIG. 10 is a block diagram illustrating configurations of a memory protection unit 571 and a secure memory 613 included in a mobile phone according to a third embodiment. メモリ保護部571による検証動作を示すフローチャートである。5 is a flowchart showing a verification operation by a memory protection unit 571. アプリ検証部578による音楽復号プログラム592の検証動作を示すフローチャートである。21 is a flowchart showing a verification operation of a music decryption program 592 by an application verification unit 578. 実施の形態3の変形例のホームネットワークの構成を示す構成図である。FIG. 10 is a configuration diagram illustrating a configuration of a home network according to a modification of the third embodiment. 実施の形態4の携帯電話を構成するメモリ保護部701及びセキュアメモリ713の構成を示すブロック図である。FIG. 10 is a block diagram illustrating configurations of a memory protection unit 701 and a secure memory 713 that constitute a mobile phone according to a fourth embodiment. 実施の形態5において、セキュアメモリカード820の構成及びセキュアメモリカード820に記憶されている情報の一例を示す。In the fifth embodiment, an example of the configuration of the secure memory card 820 and information stored in the secure memory card 820 is shown. 実施の形態5の携帯電話750及び携帯電話750に装着される通常メモリカード800及びセキュアメモリカード820の構成を示すブロック図である。FIG. 10 is a block diagram showing configurations of a mobile phone 750 and a normal memory card 800 and a secure memory card 820 that are attached to the mobile phone 750 of the fifth embodiment. メモリ保護部764の構成を示すブロック図である。7 is a block diagram showing a configuration of a memory protection unit 764. FIG. セキュアメモリテーブル811及び通常メモリテーブル861の構成を示す。The configurations of the secure memory table 811 and the normal memory table 861 are shown. アクセス制御部783及びID検出部786の動作を示すフローチャートである。10 is a flowchart showing operations of an access control unit 783 and an ID detection unit 786. アクセス制御部783動作を示すフローチャートである。図71から続く。It is a flowchart which shows operation | movement of the access control part 783. It continues from FIG.

符号の説明Explanation of symbols

10 携帯電話網
15 基地局
20 インターネット
100 携帯電話
101 デバッガIF
102 CPU
103 MMU
104 二次記憶部
106 切替制御部
107 割込コントローラ
108 入力部
109 表示部
111 通常メモリ
112 共有メモリ
113 セキュアメモリ
114 メモリ保護部
116 入出力部
117 暗号処理デバイス
118 無線通信制御部
119 マイク
120 スピーカ
121 通信部
122 アンテナ
123 バッファ
124 符号処理部
126 D/A変換部
130 バス
131 アクセス部
132 通常入出力デバイス
133 セキュア入出力デバイス
300 メモリカード
10 mobile phone network 15 base station 20 internet 100 mobile phone 101 debugger IF
102 CPU
103 MMU
104 Secondary storage unit 106 Switching control unit 107 Interrupt controller 108 Input unit 109 Display unit 111 Normal memory 112 Shared memory 113 Secure memory 114 Memory protection unit 116 Input / output unit 117 Cryptographic processing device 118 Wireless communication control unit 119 Microphone 120 Speaker 121 Communication unit 122 Antenna 123 Buffer 124 Code processing unit 126 D / A conversion unit 130 Bus 131 Access unit 132 Normal input / output device 133 Secure input / output device 300 Memory card

Claims (61)

保護対象のセキュアリソースの利用が許可されるセキュアモードと、保護対象外の通常リソースの利用のみが許可される通常モードとを切り替えて、プログラムを実行するデータ処理装置であって、
前記通常リソースを利用する1つ以上の処理手順から構成される通常プログラムを記憶している通常記憶手段と、
前記セキュアリソースを利用する1つ以上の処理手順から構成され、少なくとも前記通常プログラムを呼び出す呼出命令を含むセキュアプログラムを記憶しているセキュア記憶手段と、
セキュアモードにおいて、次に実行すべき命令が、前記呼出命令であるか否かを判断する判断手段と、
セキュアモードにおいて、前記呼出命令であると判断される場合に、当該呼出命令により呼び出される前記通常プログラムを示す識別情報を出力する出力手段と、
前記呼出命令であると判断される場合に、セキュアリソースを保護して、セキュアモードから通常モードに切り替える切替手段と、
通常モードにおいて、前記識別情報を受け取る受取手段と、
通常モードにおいて、受け取った前記識別情報により示される前記通常プログラムを前記通常記憶手段から読み出す読出手段と、
通常モードにおいて、読み出した通常プログラムに従って動作する処理手段と
を備えることを特徴とするデータ処理装置。
A data processing apparatus that executes a program by switching between a secure mode in which use of a secure resource to be protected is permitted and a normal mode in which only use of a normal resource that is not protected is permitted,
Normal storage means for storing a normal program composed of one or more processing procedures using the normal resource;
Secure storage means configured to store one or more processing procedures using the secure resource and storing a secure program including at least a calling instruction for calling the normal program;
A determination means for determining whether or not an instruction to be executed next in the secure mode is the call instruction;
An output means for outputting identification information indicating the normal program called by the call instruction when determined to be the call instruction in the secure mode;
Switching means for protecting the secure resource and switching from the secure mode to the normal mode when it is determined that the call instruction is provided;
Receiving means for receiving the identification information in a normal mode;
A reading means for reading out the normal program indicated by the received identification information from the normal storage means in the normal mode;
A data processing apparatus comprising: processing means that operates in accordance with the read normal program in the normal mode.
前記切替手段は、前記セキュアプログラムを制御するセキュアオペレーティングシステムを中断させ、前記通常プログラムを制御する通常オペレーティングシステムを起動することにより、セキュアモードから通常モードに切り替える
ことを特徴とする請求項1に記載のデータ処理装置。
The switching unit switches from a secure mode to a normal mode by interrupting a secure operating system that controls the secure program and starting a normal operating system that controls the normal program. Data processing equipment.
前記データ処理装置は、セキュアモード及び通常モードの両方において、アクセスが許可される共有記憶領域を備え、
前記出力手段は、セキュアモードにおいて、前記識別情報を前記共有記憶領域に書き込むことにより、前記識別情報を出力し、
前記受取手段は、通常モードにおいて、前記共有記憶領域から前記識別情報を読み出すことにより、前記識別情報を受け取る
ことを特徴とする請求項2に記載のデータ処理装置。
The data processing apparatus includes a shared storage area to which access is permitted in both the secure mode and the normal mode,
The output means outputs the identification information in the secure mode by writing the identification information to the shared storage area.
The data processing apparatus according to claim 2, wherein the receiving unit receives the identification information by reading the identification information from the shared storage area in a normal mode.
前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出す
ことを特徴とする請求項3に記載のデータ処理装置。
The reading means stores the identification information and position information indicating the position of the normal program in the normal storage means in association with each other, and from the position indicated by the position information corresponding to the received identification information. The data processing apparatus according to claim 3, wherein the normal program is read out.
前記通常プログラムを構成する1つの処理手順は、ライブラリを構成する複数の関数を含み、他の処理手順は、前記複数の関数のうちのいずれかを呼び出し、
前記処理手段は、前記他の処理手順に従って動作する場合に、当該他の処理手順により呼び出される関数に従って動作する
ことを特徴とする請求項3に記載のデータ処理装置。
One processing procedure constituting the normal program includes a plurality of functions constituting a library, and the other processing procedure calls one of the plurality of functions,
The data processing apparatus according to claim 3, wherein when the processing unit operates according to the other processing procedure, the processing unit operates according to a function called by the other processing procedure.
前記データ処理装置は、さらに、
セキュアモードにおいて、前記セキュアプログラムの前記セキュア記憶手段への書き込みを示す書込指示を受け取る指示取得手段と、
セキュアモードにおいて、前記書込指示を取得した場合に、前記セキュア記憶手段に前記セキュアプログラムを書き込み、前記書込みが終了したことを示す書込終了情報を出力するセキュアロード手段とを含み、
前記切替手段は、さらに、前記書込終了情報が出力された場合、セキュアモードから通常モードへ切り替え、
前記データ処理装置は、さらに、通常モードにおいて、前記書込終了情報を受け取り、前記通常記憶手段に前記通常プログラムを書き込む通常ロード手段とを含むことを特徴とする請求項2に記載のデータ処理装置。
The data processing device further includes:
In secure mode, instruction acquisition means for receiving a write instruction indicating writing to the secure storage means of the secure program;
A secure load means for writing the secure program to the secure storage means and outputting write end information indicating that the writing is completed when the write instruction is acquired in a secure mode;
The switching means further switches from the secure mode to the normal mode when the writing end information is output,
3. The data processing apparatus according to claim 2, further comprising normal load means for receiving the write end information and writing the normal program in the normal storage means in the normal mode. .
前記読出手段は、さらに、通常モードにおいて、前記通常ロード手段により前記通常プログラムが前記通常記憶手段に書き込まれた場合に、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶する
ことを特徴とする請求項6に記載のデータ処理装置。
In the normal mode, the reading means further includes position information indicating the identification information and the location of the normal program in the normal storage means when the normal program is written into the normal storage means by the normal load means. The data processing apparatus according to claim 6, which is stored in association with each other.
前記データ処理装置は、さらに、
セキュアモードにおいて、前記セキュアプログラムの削除を指示する削除指示を取得する削除指示取得手段と、
前記削除指示を取得した場合に、セキュアモードにおいて、前記セキュアプログラムを前記セキュア記憶手段から削除し、前記削除が終了したことを示す削除終了情報を出力するセキュア削除手段とを含み、
前記切替手段は、さらに、前記削除終了情報が出力された場合、セキュアモードから通常モードへ切り替え、
前記データ処理装置は、さらに、
通常モードにおいて、前記削除終了情報を取得し、前記通常記憶手段から前記通常プログラムを削除する通常削除手段を含む
ことを特徴とする請求項6に記載のデータ処理装置。
The data processing device further includes:
In the secure mode, a deletion instruction acquisition means for acquiring a deletion instruction for instructing deletion of the secure program;
A secure deletion unit that deletes the secure program from the secure storage unit and outputs deletion end information indicating that the deletion is completed in the secure mode when the deletion instruction is acquired;
The switching means further switches from the secure mode to the normal mode when the deletion end information is output,
The data processing device further includes:
The data processing apparatus according to claim 6, further comprising: a normal deletion unit that acquires the deletion end information and deletes the normal program from the normal storage unit in a normal mode.
前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出す
ことを特徴とする請求項2に記載のデータ処理装置。
The reading means stores the identification information and position information indicating the position of the normal program in the normal storage means in association with each other, and from the position indicated by the position information corresponding to the received identification information. The data processing apparatus according to claim 2, wherein the normal program is read out.
前記データ処理装置は、さらに、
前記処理手段を含む当該データ処理装置の備える1以上のデバイスを初期化する初期化手順及び前記セキュアオペレーティングシステムを起動する起動手順を含むブートプログラムを記憶しているブートプログラム記憶手段と、
前記ブートプログラム記憶手段から、前記ブートプログラムを読み出し、読み出した前記ブートプログラムに従って、前記デバイスを初期化し、初期化の完了後に、セキュアオペレーティングシステムを起動する初期化手段とを備える
ことを特徴とする請求項2に記載のデータ処理装置。
The data processing device further includes:
Boot program storage means for storing a boot program including an initialization procedure for initializing one or more devices included in the data processing apparatus including the processing means and a startup procedure for starting the secure operating system;
And an initialization unit configured to initialize the device in accordance with the boot program read out from the boot program storage unit and start a secure operating system after the initialization is completed. Item 3. A data processing apparatus according to Item 2.
前記データ処理装置は、さらに、
通常モードにおいて、前記処理手段による処理結果と前記セキュアプログラムを示すセキュア識別情報とを出力する通常出力手段を含み、
前記切替手段は、さらに、前記処理結果が出力された場合、通常モードからセキュアモードへ切り替え、
前記データ処理装置は、さらに、
セキュアモードにおいて、前記処理結果と前記セキュア識別情報とを受け取るセキュア受取手段と、
受け取った前記セキュア識別情報に対応する前記セキュアプログラムを前記通常記憶手段から読み出すセキュア読出手段とを含み、
前記処理手段は、さらに、セキュアモードにおいて、前記処理結果を用いて、前記セキュアプログラムに従って動作する
ことを特徴とする請求項2に記載のデータ処理装置。
The data processing device further includes:
In normal mode, including normal output means for outputting a processing result by the processing means and secure identification information indicating the secure program,
The switching means further switches from the normal mode to the secure mode when the processing result is output,
The data processing device further includes:
Secure reception means for receiving the processing result and the secure identification information in secure mode;
A secure reading means for reading out the secure program corresponding to the received secure identification information from the normal storage means,
The data processing apparatus according to claim 2, wherein the processing unit further operates according to the secure program using the processing result in the secure mode.
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースと前記処理手段とを切断する
ことを特徴とする請求項2に記載のデータ処理装置。
The data processing apparatus according to claim 2, wherein the switching unit disconnects the secure resource and the processing unit when switching from the secure mode to the normal mode.
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記セキュアリソースに保持されているセキュア情報を暗号化する
ことを特徴とする請求の範囲2に記載のデータ処理装置。
The data processing apparatus according to claim 2, wherein the switching unit encrypts secure information held in the secure resource when switching from the secure mode to the normal mode.
前記セキュアリソースに保持されている前記セキュア情報は、セキュアモードにおいて実行され、命令コード部分とデータ部分とスタック部分から構成されるプログラムを含んでおり、
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記命令コード部分を暗号化する
ことを特徴とする請求の範囲13に記載のデータ処理装置。
The secure information held in the secure resource is executed in a secure mode, and includes a program composed of an instruction code part, a data part, and a stack part,
The data processing apparatus according to claim 13, wherein the switching means encrypts the instruction code portion when switching from the secure mode to the normal mode.
前記セキュアリソースに保持されている前記セキュア情報は、セキュアモードにおいて実行され、命令コード部分とデータ部分とスタック部分から構成されるプログラムを含んでおり、
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記データ部分を暗号化する
ことを特徴とする請求の範囲13に記載のデータ処理装置。
The secure information held in the secure resource is executed in a secure mode, and includes a program composed of an instruction code part, a data part, and a stack part,
The data processing apparatus according to claim 13, wherein the switching means encrypts the data portion when switching from the secure mode to the normal mode.
前記セキュアリソースに保持されている前記セキュア情報は、セキュアモードにおいて実行され、命令コード部分とデータ部分とスタック部分から構成されるプログラムを含んでおり、
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記スタック部分を暗号化する
ことを特徴とする請求の範囲13に記載のデータ処理装置。
The secure information held in the secure resource is executed in a secure mode, and includes a program composed of an instruction code part, a data part, and a stack part,
The data processing apparatus according to claim 13, wherein the switching unit encrypts the stack part when switching from the secure mode to the normal mode.
前記データ処理装置は、さらに、前記処理手段の動作を監視し、操作するデバッグ装置からデバッグ操作信号を受け付けるデバッグ受付手段を含み、
前記切替手段は、セキュアモードから通常モードに切り替える際に、前記処理手段と前記デバッグ受付手段とを接続し、通常モードからセキュアモードに切り替える際に、前記処理手段と前記デバッグ受付手段とを切断する
ことを特徴とする請求項2に記載のデータ処理装置。
The data processing device further includes a debug receiving unit that receives a debug operation signal from a debug device that monitors and operates the operation of the processing unit,
The switching unit connects the processing unit and the debug receiving unit when switching from the secure mode to the normal mode, and disconnects the processing unit and the debug receiving unit when switching from the normal mode to the secure mode. The data processing apparatus according to claim 2.
前記読出手段は、前記識別情報と前記通常記憶手段における前記通常プログラムの存在位置を示す位置情報とを対応付けて記憶しており、受け取った前記識別情報に対応する位置情報により示される存在位置から前記通常プログラムを読み出す
ことを特徴とする請求項1に記載のデータ処理装置。
The reading means stores the identification information and position information indicating the position of the normal program in the normal storage means in association with each other, and from the position indicated by the position information corresponding to the received identification information. The data processing apparatus according to claim 1, wherein the normal program is read out.
第1オペレーティングシステムと第2オペレーティングシステムとを切り替え、各オペレーティングシステムにおいて生成されるプロセスを実行状態、実行待ち状態、休止状態のいずれかに遷移させてプロセスを実行し管理する前記データ処理装置であって、
前記第1オペレーティングシステムにおいて、第1プロセスを生成する第1生成手段と、
前記第2オペレーティングシステムにおいて、前記第1プロセスと対応する第2プロセスを生成する第2生成手段と、
前記第1オペレーティングシステムにおいて、前記第1プロセスの状態遷移を検出する第1検出手段と、
前記第1オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第1出力手段と、
前記第1オペレーティングシステムを前記第2オペレーティングシステムに切り替えるOS切替手段と、
前記第2オペレーティングシステムにおいて、前記遷移情報を取得する第2取得手段と、
取得した前記遷移情報に従って、前記第2プロセスの状態を遷移させる第2遷移手段と
を備えることを特徴とする請求項1に記載のデータ処理装置。
The data processing device that switches between a first operating system and a second operating system, and that transitions a process generated in each operating system to an execution state, an execution waiting state, or a hibernation state to execute and manage the process. And
First generation means for generating a first process in the first operating system;
In the second operating system, second generation means for generating a second process corresponding to the first process;
First detection means for detecting a state transition of the first process in the first operating system;
A first output means for outputting transition information indicating the detected state transition in the first operating system;
OS switching means for switching the first operating system to the second operating system;
In the second operating system, second acquisition means for acquiring the transition information;
The data processing apparatus according to claim 1, further comprising: a second transition unit that transitions the state of the second process according to the acquired transition information.
前記データ処理装置は、さらに、
前記第2オペレーティングシステムにおいて、前記第2プロセスの状態遷移を検出する第2検出手段と、
前記第2オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第2出力手段とを含み、
前記OS切替手段は、さらに、前記第2オペレーティングシステムを前記第1オペレーティングシステムに切り替え、
前記データ処理装置は、さらに、
前記第1オペレーティングシステムにおいて、前記遷移情報を取得する第1取得手段と、
取得した前記遷移情報に従って、前記第1プロセスの状態を遷移させる第1遷移手段とを含むことを特徴とする請求項19に記載のデータ処理装置。
The data processing device further includes:
In the second operating system, second detection means for detecting a state transition of the second process;
A second output means for outputting transition information indicating the detected state transition in the second operating system;
The OS switching means further switches the second operating system to the first operating system,
The data processing device further includes:
In the first operating system, first acquisition means for acquiring the transition information;
20. The data processing apparatus according to claim 19, further comprising first transition means for transitioning the state of the first process according to the acquired transition information.
前記データ処理装置は、第1オペレーティングシステム及び第2オペレーティングシステムの両方において、アクセス可能な共有記憶領域を備え、
前記第1出力手段は、前記共有記憶領域に前記遷移情報を書き込むことにより、前記遷移情報を出力し、
前記第2取得手段は、前記共有記憶領域から前記遷移情報を読み出すことによって、前記遷移情報を取得する
ことを特徴とする請求項20に記載のデータ処理装置。
The data processing apparatus includes a shared storage area accessible in both the first operating system and the second operating system,
The first output means outputs the transition information by writing the transition information in the shared storage area,
The data processing apparatus according to claim 20, wherein the second acquisition unit acquires the transition information by reading the transition information from the shared storage area.
前記第2出力手段は、前記共有記憶領域に前記遷移情報を書き込むことにより、前記遷移情報を出力し、
前記第1取得手段は、前記共有記憶領域から前記遷移情報を読み出すことによって、前記遷移情報を取得する
ことを特徴とする請求項21に記載のデータ処理装置。
The second output means outputs the transition information by writing the transition information in the shared storage area,
The data processing apparatus according to claim 21, wherein the first acquisition unit acquires the transition information by reading the transition information from the shared storage area.
前記データ処理装置は、前記第2オペレーティングシステムにおいて管理されて動作するデバイスを含み、
前記第2プロセスは、前記デバイスの駆動を制御するデバイス駆動プログラムであり、
前記第2検出手段は、前記デバイスの動作に伴う前記第2プロセスの状態遷移を検出する
ことを特徴とする請求項22に記載のデータ処理装置。
The data processing device includes a device managed and operated in the second operating system,
The second process is a device driving program for controlling driving of the device;
The data processing apparatus according to claim 22, wherein the second detection unit detects a state transition of the second process accompanying an operation of the device.
前記第1オペレーティングシステムにおいて、前記第1プロセスが、休止状態から実行状態に遷移した場合、
前記データ処理装置は、前記デバイスへの処理依頼の重複を回避する排他処理を行う前記第1プロセスに従って動作し、
前記第1オペレーティングシステムにおいて、前記第1出力手段は、前記排他処理が終了した後に前記遷移情報を出力する
ことを特徴とする請求項23に記載のデータ処理装置。
In the first operating system, when the first process transitions from a sleep state to an execution state,
The data processing apparatus operates according to the first process for performing exclusive processing to avoid duplication of processing requests to the device,
24. The data processing apparatus according to claim 23, wherein in the first operating system, the first output means outputs the transition information after the exclusion process is completed.
前記データ処理装置は、さらに、
第1オペレーティングシステム及び第2オペレーティングシステムにおいて、割込の発生を検出する割込検出手段と、
前記第1オペレーティングシステムにおいて、割込が検出された場合、割込発生要因を調査する割込調査手段と、
前記第1オペレーティングシステムにおいて、割込調査手段により、前記デバイスによる割込であると判断された場合、前記第1プロセスを休止状態から実行状態に遷移させる割込遷移手段と
を含むことを特徴とする請求項23に記載のデータ処理装置。
The data processing device further includes:
Interrupt detection means for detecting occurrence of an interrupt in the first operating system and the second operating system;
In the first operating system, when an interrupt is detected, an interrupt investigation means for investigating an interrupt occurrence factor;
The first operating system includes interrupt transition means for transitioning the first process from a sleep state to an execution state when the interrupt investigation means determines that the interrupt is caused by the device. The data processing apparatus according to claim 23.
前記データ処理装置は、さらに、
前記第2オペレーティングシステムにおいて、割込が検出された場合、割込の検出を示す割込通知情報を出力する通知手段を含み、
前記OS切替手段は、前記第2オペレーティングシステムを前記第1オペレーティングシステムに切り替え、
前記第1取得手段は、さらに、前記第1オペレーティングシステムにおいて、前記割込通知情報を取得し、
前記割込調査手段は、さらに、第1オペレーティングシステムにおいて、前記割込通知情報を取得した場合、割込発生要因を調査する
ことを特徴とする請求項25に記載のデータ処理装置。
The data processing device further includes:
A notification means for outputting interrupt notification information indicating detection of an interrupt when an interrupt is detected in the second operating system;
The OS switching means switches the second operating system to the first operating system;
The first acquisition means further acquires the interrupt notification information in the first operating system,
The data processing apparatus according to claim 25, wherein the interrupt investigation unit further investigates an interrupt occurrence factor when the interrupt notification information is acquired in the first operating system.
前記通知手段は、割込が検出された場合、前記割込検出手段に対して、割込の検出を停止させ、
前記第1取得手段は、前記割込通知情報を取得した場合、前記割込検出手段に対して、前記停止を解除する
ことを特徴とする請求項26に記載のデータ処理装置。
The notification means, when an interrupt is detected, causes the interrupt detection means to stop detecting an interrupt,
27. The data processing apparatus according to claim 26, wherein the first acquisition unit cancels the stop with respect to the interrupt detection unit when the interrupt notification information is acquired.
プログラムに従って動作する前記データ処理装置であって、
複数の処理手順から構成されるプログラムを記憶している記憶手段と、
前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する正当性判断手段と、
不正なものであると判断される場合に、前記プログラムを無効化する無効化手段と
を備えることを特徴とする請求項1に記載のデータ処理装置。
The data processing device that operates according to a program,
Storage means for storing a program comprising a plurality of processing procedures;
Correctness determination means for determining whether or not the program stored in the storage means is illegal;
The data processing apparatus according to claim 1, further comprising: an invalidating unit that invalidates the program when it is determined to be illegal.
前記正当性判断手段は、
前記記憶手段に記憶されている前記プログラムを示すプログラム識別情報を取得するプログラム情報取得部と、
無効化されたプログラムを示す無効化識別情報を取得する無効化情報取得部と、
取得した前記プログラム識別情報と取得した前記無効化識別情報とが一致するか否かを判断する判断部とを含み、
一致すると判断される場合に、前記プログラムが不正であると決定する
ことを特徴とする請求項28に記載のデータ処理装置。
The validity judgment means includes
A program information acquisition unit for acquiring program identification information indicating the program stored in the storage unit;
A revocation information acquisition unit that acquires revocation identification information indicating a revoked program;
A determination unit that determines whether the acquired program identification information and the acquired invalidation identification information match,
29. The data processing apparatus according to claim 28, wherein when it is determined that they match, the program is determined to be invalid.
前記プログラム情報取得部は、
前記プログラムを示すプログラム識別情報を記憶している識別情報記憶部と、
前記識別情報記憶部から前記プログラム識別情報を読み出すことにより取得する読出部とを含み、
前記無効化情報取得部は、
無効化されたプログラムを示す無効化識別情報を記憶している無効化情報記憶部と、
前記無効化情報記憶部から前記無効化識別情報を読み出すことにより取得する読出部とを含む
ことを特徴とする請求項29に記載のデータ処理装置。
The program information acquisition unit
An identification information storage unit storing program identification information indicating the program;
A reading unit that is obtained by reading the program identification information from the identification information storage unit,
The invalidation information acquisition unit
A revocation information storage unit that stores revocation identification information indicating a revoked program;
30. The data processing apparatus according to claim 29, further comprising: a reading unit that is acquired by reading the invalidation identification information from the invalidation information storage unit.
前記正当性判断手段は、前記プログラムに割り当てられた公開鍵の正当性を証明する公開鍵証明書に基づいて、前記プログラムが不正なものであるか否かを判断する
ことを特徴とする請求項28に記載のデータ処理装置。
The legitimacy judging means judges whether or not the program is illegal based on a public key certificate proving the legitimacy of a public key assigned to the program. 28. A data processing apparatus according to 28.
前記正当性判断手段は、
前記公開鍵を識別する公開鍵識別情報を含む前記公開鍵証明書を記憶している証明書記憶部と、
前記公開鍵証明書から前記公開鍵識別情報を取得する公開鍵情報取得部と、
無効化された公開鍵を示す無効化識別情報を記憶している無効化情報記憶部と、
前記無効化情報記憶部から無効化識別情報を読み出す無効化情報読出部と、
取得した前記公開鍵識別情報と読み出した前記無効化識別情報とが一致するか否かを判断する判断部とを含み、
一致すると判断される場合に、前記プログラムが不正であると決定する
ことを特徴とする請求項31に記載のデータ処理装置。
The validity judgment means includes
A certificate storage unit storing the public key certificate including public key identification information for identifying the public key;
A public key information acquisition unit for acquiring the public key identification information from the public key certificate;
A revocation information storage unit that stores revocation identification information indicating a revoked public key;
An invalidation information reading unit for reading invalidation identification information from the invalidation information storage unit;
A determination unit that determines whether or not the acquired public key identification information and the read invalidation identification information match,
The data processing apparatus according to claim 31, wherein when it is determined that they match, the program is determined to be invalid.
前記正当性判断手段は、さらに、
外部から最新の無効化識別情報を取得し、取得した無効化識別情報を前記無効化情報記憶部に書き込む更新部を含む
ことを特徴とする請求項32に記載のデータ処理装置。
The legitimacy judging means further includes:
The data processing apparatus according to claim 32, further comprising: an update unit that acquires the latest invalidation identification information from outside and writes the acquired invalidation identification information in the invalidation information storage unit.
前記更新部は、前記記憶手段へのアクセス要求を検出する度に、最新の無効化識別情報を取得する
ことを特徴とする請求項33に記載のデータ処理装置。
The data processing apparatus according to claim 33, wherein the update unit acquires the latest invalidation identification information each time an access request to the storage unit is detected.
前記更新部は、CRL(Certificate Revocation List)発行装置から、ネットワークを介して、前記無効化識別情報を受信し、CRL発行装置から、ネットワーク及びサーバ装置を介して、前記無効化識別情報を受信し、又は記録媒体から前記無効化識別情報を読み出すことにより、取得する
ことを特徴とする請求項33に記載のデータ処理装置。
The updating unit receives the invalidation identification information from a CRL (Certificate Revocation List) issuing device via a network, and receives the invalidation identification information from the CRL issuing device via a network and a server device. The data processing apparatus according to claim 33, wherein the data processing apparatus is obtained by reading the invalidation identification information from a recording medium.
前記更新部は、さらに、外部から、前記最新の無効化識別情報に対してデジタル署名を施して生成された署名データを取得し、取得した署名データに署名検証を施し、署名検証が成功した場合に、取得した前記無効化識別情報を前記無効化情報記憶部に書き込む
ことを特徴とする請求項33に記載のデータ処理装置。
The update unit further obtains signature data generated by applying a digital signature to the latest invalidation identification information from the outside, performs signature verification on the acquired signature data, and the signature verification is successful The data processing apparatus according to claim 33, wherein the acquired invalidation identification information is written into the invalidation information storage unit.
前記正当性判断手段は、
少なくとも当該公開鍵に対してデジタル署名を施して生成された署名データを含む前記公開鍵証明書を記憶している証明書記憶部と、
前記証明書記憶部から前記公開鍵証明書を取得する公開鍵証明書取得部と、
取得した前記公開鍵証明書に含まれる署名データに、署名検証を施すことにより、取得した前記公開鍵証明書が正しいものであるか否かを検証する検証部とを含み、
前記公開鍵証明書が正しいものでないと判断される場合に、前記プログラムが不正であると決定する
ことを特徴とする請求項31に記載のデータ処理装置。
The validity judgment means includes
A certificate storage unit storing at least the public key certificate including signature data generated by applying a digital signature to the public key;
A public key certificate acquisition unit for acquiring the public key certificate from the certificate storage unit;
A verification unit that verifies whether the acquired public key certificate is correct by performing signature verification on the signature data included in the acquired public key certificate,
The data processing apparatus according to claim 31, wherein if it is determined that the public key certificate is not correct, the program is determined to be invalid.
前記正当性判断手段は、少なくとも2個の公開鍵の正当性をそれぞれ証明する少なくとも2個の公開鍵証明書を用いて、前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する
ことを特徴とする請求項28に記載のデータ処理装置。
Whether the program stored in the storage means is illegal by using the at least two public key certificates respectively certifying the validity of at least two public keys. The data processing apparatus according to claim 28, wherein:
前記2個の公開鍵は、前記プログラムに割り当てられた第1公開鍵及び前記データ処理装置又は前記プログラムの動作を制御するオペレーティングシステムに割り当てられた第2公開鍵であり、
前記正当性判断手段は、
権威のある認証機関の秘密鍵を用いて、少なくとも前記第2公開鍵に対してデジタル署名を施して生成された第2署名データと、前記第2公開鍵とを含む第2公開鍵証明書と、
前記データ処理装置又は前記オペーティングシステムの秘密鍵を用いて、少なくとも前記第1公開鍵に対してデジタル署名を施して生成された第1署名データと、前記第1公開鍵とを含む第1公開鍵証明書とを記憶している証明書記憶部と、
前記証明書記憶部から前記第1公開鍵証明書及び前記第2公開鍵証明書を取得する公開鍵証明書取得部と、
取得した前記第2公開鍵証明書に含まれる第2署名データに、前記認証機関の公開鍵を用いて、署名検証を施すことにより、取得した前記第2公開鍵証明書が正しいものであるか否かを検証し、
正しいと判定された場合に、前記第2公開鍵証明書から前記第2公開鍵を取得し、
取得した前記第1公開鍵証明書に含まれる第1署名データに、取得した前記第2公開鍵を用いて、署名検証を施すことにより、取得した前記第1公開鍵証明書が正しいものであるか否かを検証する検証部とを含み、
前記第2公開鍵証明書が正しいものでないと判断される場合及び前記第1公開鍵証明書が正しいものでないと判断される場合に、前記プログラムが不正であると決定する
ことを特徴とする請求項38に記載のデータ処理装置。
The two public keys are a first public key assigned to the program and a second public key assigned to an operating system that controls the operation of the data processing device or the program,
The validity judgment means includes
A second public key certificate including a second signature data generated by applying a digital signature to at least the second public key using a private key of an authoritative certification authority, and the second public key; ,
A first signature data generated by applying a digital signature to at least the first public key using a secret key of the data processing apparatus or the operating system; and a first public key including the first public key. A certificate storage unit storing a public key certificate;
A public key certificate acquisition unit for acquiring the first public key certificate and the second public key certificate from the certificate storage unit;
Whether the obtained second public key certificate is correct by performing signature verification on the second signature data included in the obtained second public key certificate using the public key of the certification authority. Whether or not
If it is determined to be correct, obtain the second public key from the second public key certificate;
The obtained first public key certificate is correct by performing signature verification on the first signature data included in the obtained first public key certificate using the obtained second public key. And a verification unit for verifying whether or not
The program is determined to be invalid when it is determined that the second public key certificate is not correct and when it is determined that the first public key certificate is not correct. 39. A data processing apparatus according to item 38.
前記正当性判断手段は、前記記憶手段へのアクセス要求を検出する度に、前記判断をする
ことを特徴とする請求項28に記載のデータ処理装置。
The data processing apparatus according to claim 28, wherein the validity judgment unit makes the judgment each time an access request to the storage unit is detected.
前記正当性判断手段は、前記記憶手段に記憶されているプログラムへのアクセス要求を検出する度に、前記判断をする
ことを特徴とする請求項40に記載のデータ処理装置。
41. The data processing apparatus according to claim 40, wherein the validity determination unit makes the determination each time an access request to a program stored in the storage unit is detected.
前記正当性判断手段は、当該データ処理装置へ電力供給が開始された直後に、前記判断をする
ことを特徴とする請求項28に記載のデータ処理装置。
The data processing apparatus according to claim 28, wherein the validity judgment unit makes the judgment immediately after power supply to the data processing apparatus is started.
暗号化されたプログラムを復号して実行する前記データ処理装置であって、
前記記憶手段は、前記プログラムに代えて、プログラム鍵を用いて、前記プログラムに暗号化アルゴリズムが施されて生成された暗号化プログラムを記憶しており、
前記正当性判断手段は、
p個の暗号鍵から選択されたm個の暗号鍵を記憶している暗号鍵記憶部と、
前記m個の暗号鍵のそれぞれを用いて、前記プログラム鍵及び所定の検知情報のいずれかが暗号化されて生成されたm個の暗号化情報を、m個の前記暗号鍵に対応づけて記憶している暗号化情報記憶部と、
前記m個の暗号鍵のそれぞれを用いて、対応する暗号化情報に復号アルゴリズムを施して、m個の復号情報を生成する復号部と、
生成されたm個の復号情報の全てが、前記検知情報であるか否かを判断する判断部とを含み、
生成されたm個の復号情報の全てが、前記検知情報であると判断される場合に、前記プログラムが不正なものであると決定する
ことを特徴とする請求項28に記載のデータ処理装置。
A data processing apparatus for decrypting and executing an encrypted program,
The storage means stores an encrypted program generated by applying an encryption algorithm to the program using a program key instead of the program,
The validity judgment means includes
an encryption key storage unit storing m encryption keys selected from the p encryption keys;
Using each of the m encryption keys, m encryption information generated by encrypting either the program key or the predetermined detection information is stored in association with the m encryption keys. An encrypted information storage unit,
Using each of the m encryption keys, a decryption unit that applies a decryption algorithm to the corresponding encryption information to generate m decryption information;
A determination unit that determines whether all of the m pieces of decrypted information generated are the detection information;
The data processing apparatus according to claim 28, wherein when all of the generated m pieces of decoding information are determined to be the detection information, the program is determined to be invalid.
前記p個の暗号鍵は、n行m列(p=n×m)の第1行列の各要素位置に配されており、前記第1行列の各列から1個の暗号鍵が選択されることにより、前記第1行列からm個の暗号鍵が選択され、
前記暗号鍵記憶部は、前記第1行列において、各暗号鍵が配された要素位置を、各暗号鍵に対応付けて記憶しており、
前記暗号化情報記憶部は、n行m列の第2行列において、各暗号化情報に対応する暗号鍵が配されている要素位置と同じ要素位置において、当該暗号化情報を記憶しており、
復号部は、前記暗号鍵記憶部から、暗号鍵と対応する要素位置を読み出し、前記暗号化情報記憶部の第2行列において、前記読み出した要素位置と同じ要素位置に配されている暗号化情報を読み出し、読み出した前記暗号鍵を用いて、読み出した前記暗号化情報に復号アルゴリズムを施す
ことを特徴とする請求項43に記載のデータ処理装置。
The p encryption keys are arranged at each element position of the first matrix of n rows and m columns (p = n × m), and one encryption key is selected from each column of the first matrix. Thus, m encryption keys are selected from the first matrix,
The encryption key storage unit stores the element position where each encryption key is arranged in the first matrix in association with each encryption key,
The encryption information storage unit stores the encryption information at the same element position as the element position where the encryption key corresponding to each encryption information is arranged in the second matrix of n rows and m columns,
The decryption unit reads the element position corresponding to the encryption key from the encryption key storage unit, and the encrypted information arranged in the same element position as the read element position in the second matrix of the encryption information storage unit 44. The data processing apparatus according to claim 43, wherein a decryption algorithm is applied to the read encrypted information using the read encryption key.
前記データ処理装置であって、
データを記憶するためのメモリ手段と、
複数の処理手順から構成されるプログラムに従って動作するプロセッサと、
前記メモリ手段と前記プロセッサとの間に配置され、前記プロセッサから出力される前記メモリ手段宛の転送データが転送制限条件を満たしているか否かを判断し、転送制限条件を満たしていると判断する場合に、前記メモリ手段への転送データの転送を抑制し、転送制限条件を満たしていないと判断する場合に、前記メモリ手段への転送データの転送を行う監視手段と
を備えることを特徴とする請求項1に記載のデータ処理装置。
The data processing device,
Memory means for storing data;
A processor that operates according to a program composed of a plurality of processing procedures;
It is arranged between the memory means and the processor, and determines whether or not the transfer data addressed to the memory means output from the processor satisfies a transfer restriction condition, and determines that the transfer restriction condition is satisfied. And a monitoring unit that suppresses transfer of transfer data to the memory unit and transfers transfer data to the memory unit when it is determined that the transfer restriction condition is not satisfied. The data processing apparatus according to claim 1.
前記監視手段は、複数のアプリケーションプログラム毎に、転送制限条件を記憶しており、前記プロセッサにより実行されるアプリケーションプログラム毎に、転送制限条件を選択し、選択した転送制限条件を用いる
ことを特徴とする請求項45に記載のデータ処理装置。
The monitoring unit stores a transfer restriction condition for each of a plurality of application programs, selects a transfer restriction condition for each application program executed by the processor, and uses the selected transfer restriction condition. The data processing apparatus according to claim 45.
前記転送制限条件は、前記メモリ手段内の所定の記憶空間を示すアドレス範囲情報であり、
前記監視手段は、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、前記転送データの転送を抑制する
ことを特徴とする請求項46に記載のデータ処理装置。
The transfer restriction condition is address range information indicating a predetermined storage space in the memory means,
The said monitoring means extracts address information from the said transfer data, and when the extracted address information is contained in the said address range information, it suppresses transfer of the said transfer data. Data processing device.
前記転送制限条件は、前記メモリ手段内の所定の記憶空間へのアクセス回数の上限を示す制限回数であり、
前記監視手段は、過去における前記記憶空間へのアクセスの累積回数を記憶しており、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、前記累積回数に1を加算し、加算して得られた加算後回数が、前記制限回数を超える場合に、前記転送データの転送を抑制する
ことを特徴とする請求項46に記載のデータ処理装置。
The transfer restriction condition is a limit number indicating an upper limit of the number of accesses to a predetermined storage space in the memory means,
The monitoring unit stores the cumulative number of accesses to the storage space in the past, extracts address information from the transfer data, and the accumulated address information is included when the extracted address information is included in the address range information. 47. The data processing device according to claim 46, wherein when the number of times after addition obtained by adding 1 to the number of times exceeds the limit number of times, transfer of the transfer data is suppressed.
前記監視手段は、前記プロセッサに接続されるバス上において転送される前記転送データが転送制限条件を満たしているか否かを判断する
ことを特徴とする請求項46に記載のデータ処理装置。
The data processing apparatus according to claim 46, wherein the monitoring unit determines whether or not the transfer data transferred on a bus connected to the processor satisfies a transfer restriction condition.
前記メモリ手段は、暗号鍵を用いて、前記プロセッサにより実行されている現プログラムとは異なるアプリケーションプログラムのコード部分とデータ部分とがそれぞれ暗号化されて生成された暗号化コード及び暗号化データを記憶しており、
前記転送制限条件は、前記メモリ手段内において前記暗号化データが格納されている記憶空間を示すアドレス範囲情報であり、
前記監視手段は、前記暗号化コード及び暗号化データを復号するための復号鍵を記憶しており、前記転送データからアドレス情報を抽出し、抽出したアドレス情報が、前記暗号化コードが格納されている記憶空間を示すアドレス範囲内にある場合に、前記復号鍵を用いて、前記転送データにより示される記憶空間に存在する暗号化コードを復号して復号コードを生成し、生成した復号コードを前記プロセッサへ転送し、抽出したアドレス情報が、前記アドレス範囲情報に含まれる場合に、転送データの転送を抑制する
ことを特徴とする請求項46に記載のデータ処理装置。
The memory means stores an encryption code and encrypted data generated by encrypting a code part and a data part of an application program different from the current program being executed by the processor, using an encryption key. And
The transfer restriction condition is address range information indicating a storage space in which the encrypted data is stored in the memory means,
The monitoring means stores a decryption key for decrypting the encryption code and encrypted data, extracts address information from the transfer data, and the extracted address information stores the encryption code. A decryption code is generated by using the decryption key to decrypt an encrypted code existing in the storage space indicated by the transfer data, and generating the decrypted code. 47. The data processing apparatus according to claim 46, wherein transfer of transfer data is suppressed when address information transferred and extracted to a processor is included in the address range information.
前記監視手段は、さらに、転送制限条件を満たしていると判断する場合に、前記プロセッサにより実行中の前記プログラムを識別する識別情報をプログラム無効化リストに追加する
ことを特徴とする請求項46に記載のデータ処理装置。
The monitoring unit further adds identification information for identifying the program being executed by the processor to the program invalidation list when determining that the transfer restriction condition is satisfied. The data processing apparatus described.
前記データ処理装置であって、
データを記憶するためのメモリ手段と、
複数の処理手順から構成されるプログラムに従って動作し、次に実行対象となる命令のアドレスが格納されているプログラムカウンタを備えるプロセッサと、
前記プログラムカウンタに格納されているアドレスが、所定のアドレス範囲内に含まれるか否かを判断し、所定のアドレス範囲内に含まれると判断する場合に、前記プロセッサに対して、プログラムカウンタに所定の値を格納するように指示する監視手段とを備え、
前記プロセッサは、前記指示を受け取ると、プログラムカウンタに前記所定の値を格納する
ことを特徴とする請求項1に記載のデータ処理装置。
The data processing device,
Memory means for storing data;
A processor comprising a program counter that operates according to a program composed of a plurality of processing procedures and stores the address of an instruction to be executed next;
It is determined whether or not an address stored in the program counter is included in a predetermined address range, and when it is determined that the address is included in a predetermined address range, a predetermined value is stored in the program counter for the processor. Monitoring means for instructing to store the value of
The data processing apparatus according to claim 1, wherein the processor stores the predetermined value in a program counter when the instruction is received.
保護対象のセキュアリソースの利用が許可されるセキュアモードと、保護対象外の通常リソースの利用のみが許可される通常モードとを切り替えて、プログラムを実行するデータ処理装置において用いられるデータ処理方法であって、
前記データ処理装置は、前記通常リソースを利用する1つ以上の処理手順から構成される通常プログラムを記憶している通常記憶手段と、前記セキュアリソースを利用する1つ以上の処理手順から構成され、少なくとも前記通常プログラムを呼び出す呼出命令を含むセキュアプログラムを記憶しているセキュア記憶手段とを備え、
前記データ処理方法は、
セキュアモードにおいて、次に実行すべき命令が、前記呼出命令であるか否かを判断する判断ステップと、
セキュアモードにおいて、前記呼出命令であると判断される場合に、当該呼出命令により呼び出される前記通常プログラムを示す識別情報を出力する出力ステップと、
前記呼出命令であると判断される場合に、セキュアリソースを保護して、セキュアモードから通常モードに切り替える切替ステップと、
通常モードにおいて、前記識別情報を受け取る受取ステップと、
通常モードにおいて、受け取った前記識別情報により示される前記通常プログラムを前記通常記憶手段から読み出す読出ステップと、
通常モードにおいて、読み出した通常プログラムに従って動作する処理ステップと
を含むことを特徴とするデータ処理方法。
This is a data processing method used in a data processing apparatus that executes a program by switching between a secure mode in which use of a secure resource to be protected is permitted and a normal mode in which only use of a normal resource that is not protected is permitted. And
The data processing apparatus includes a normal storage unit that stores a normal program including one or more processing procedures that use the normal resource, and one or more processing procedures that use the secure resource, Secure storage means storing a secure program including at least a calling instruction for calling the normal program,
The data processing method includes:
A determination step of determining whether an instruction to be executed next in the secure mode is the call instruction;
An output step of outputting identification information indicating the normal program called by the call instruction when the call instruction is determined in the secure mode;
A switching step of switching from the secure mode to the normal mode when protecting the secure resource when determined to be the call instruction;
A receiving step for receiving the identification information in a normal mode;
In a normal mode, a reading step of reading out the normal program indicated by the received identification information from the normal storage means;
And a processing step that operates according to the read normal program in the normal mode.
第1オペレーティングシステムと第2オペレーティングシステムとを切り替え、各オペレーティングシステムにおいて生成されるプロセスを実行状態、実行待ち状態、休止状態のいずれかに遷移させてプロセスを実行し管理する前記データ処理方法であって、
前記第1オペレーティングシステムにおいて、第1プロセスを生成する第1生成ステップと、
前記第2オペレーティングシステムにおいて、前記第1プロセスと対応する第2プロセスを生成する第2生成ステップと、
前記第1オペレーティングシステムにおいて、前記第1プロセスの状態遷移を検出する第1検出ステップと、
前記第1オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第1出力ステップと、
前記第1オペレーティングシステムを前記第2オペレーティングシステムに切り替えるOS切替ステップと、
前記第2オペレーティングシステムにおいて、前記遷移情報を取得する第2取得ステップと、
取得した前記遷移情報に従って、前記第2プロセスの状態を遷移させる第2遷移ステップと
を含むことを特徴とする請求項53に記載のデータ処理方法。
In the data processing method, the first operating system and the second operating system are switched, and a process generated in each operating system is changed to one of an execution state, an execution waiting state, and a dormant state to execute and manage the process. And
A first generation step of generating a first process in the first operating system;
A second generation step of generating a second process corresponding to the first process in the second operating system;
A first detection step of detecting a state transition of the first process in the first operating system;
A first output step for outputting transition information indicating the detected state transition in the first operating system;
An OS switching step of switching the first operating system to the second operating system;
A second acquisition step of acquiring the transition information in the second operating system;
54. The data processing method according to claim 53, further comprising: a second transition step for transitioning the state of the second process according to the acquired transition information.
プログラムに従って動作する前記データ処理装置において用いられる前記データ処理方法であって、
前記データ処理装置は、複数の処理手順から構成されるプログラムを記憶している記憶手段を備え、
前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する正当性判断ステップと、
不正なものであると判断される場合に、前記プログラムを無効化する無効化ステップと
を含むことを特徴とする請求項53に記載のデータ処理方法。
The data processing method used in the data processing apparatus that operates according to a program,
The data processing apparatus includes a storage unit that stores a program including a plurality of processing procedures.
A legitimacy determining step of determining whether or not the program stored in the storage means is illegal;
54. The data processing method according to claim 53, further comprising: an invalidating step of invalidating the program when it is determined to be illegal.
前記データ処理装置において用いられるデータ処理方法であって、
前記データ処理装置は、データを記憶するためのメモリ手段と複数の処理手順から構成されるプログラムに従って動作するプロセッサとを備え、
前記データ処理方法は、
前記メモリ手段と前記プロセッサとの間において、前記プロセッサから出力される前記メモリ手段宛の転送データが転送制限条件を満たしているか否かを判断し、転送制限条件を満たしていると判断する場合に、前記メモリ手段への転送データの転送を抑制し、転送制限条件を満たしていないと判断する場合に、前記メモリ手段への転送データの転送を行う監視ステップ
を含むことを特徴とする請求項53に記載のデータ処理方法。
A data processing method used in the data processing apparatus,
The data processing device comprises a memory means for storing data and a processor that operates according to a program comprising a plurality of processing procedures,
The data processing method includes:
When determining whether or not the transfer data addressed to the memory means output from the processor satisfies a transfer restriction condition between the memory means and the processor, and determines that the transfer restriction condition is satisfied 54. The method further comprises a monitoring step of transferring transfer data to the memory means when it is judged that transfer data transfer to the memory means is suppressed and a transfer restriction condition is not satisfied. The data processing method described in 1.
保護対象のセキュアリソースの利用が許可されるセキュアモードと、保護対象外の通常リソースの利用のみが許可される通常モードとを切り替えて、プログラムを実行するデータ処理装置において用いられるデータ処理プログラムであって、
前記データ処理装置は、前記通常リソースを利用する1つ以上の処理手順から構成される通常プログラムを記憶している通常記憶手段と、前記セキュアリソースを利用する1つ以上の処理手順から構成され、少なくとも前記通常プログラムを呼び出す呼出命令を含むセキュアプログラムを記憶しているセキュア記憶手段とを備え、
前記データ処理プログラムは、
セキュアモードにおいて、次に実行すべき命令が、前記呼出命令であるか否かを判断する判断ステップと、
セキュアモードにおいて、前記呼出命令であると判断される場合に、当該呼出命令により呼び出される前記通常プログラムを示す識別情報を出力する出力ステップと、
前記呼出命令であると判断される場合に、セキュアリソースを保護して、セキュアモードから通常モードに切り替える切替ステップと、
通常モードにおいて、前記識別情報を受け取る受取ステップと、
通常モードにおいて、受け取った前記識別情報により示される前記通常プログラムを前記通常記憶手段から読み出す読出ステップと、
通常モードにおいて、読み出した通常プログラムに従って動作する処理ステップと
を含むことを特徴とするデータ処理プログラム。
A data processing program used in a data processing apparatus that executes a program by switching between a secure mode in which use of a secure resource to be protected is permitted and a normal mode in which only use of a normal resource that is not protected is permitted. And
The data processing apparatus includes a normal storage unit that stores a normal program including one or more processing procedures that use the normal resource, and one or more processing procedures that use the secure resource, Secure storage means storing a secure program including at least a calling instruction for calling the normal program,
The data processing program is
A determination step of determining whether an instruction to be executed next in the secure mode is the call instruction;
An output step of outputting identification information indicating the normal program called by the call instruction when the call instruction is determined in the secure mode;
A switching step of switching from the secure mode to the normal mode when protecting the secure resource when determined to be the call instruction;
A receiving step for receiving the identification information in a normal mode;
In a normal mode, a reading step of reading out the normal program indicated by the received identification information from the normal storage means;
And a processing step that operates in accordance with the read normal program in the normal mode.
第1オペレーティングシステムと第2オペレーティングシステムとを切り替え、各オペレーティングシステムにおいて生成されるプロセスを実行状態、実行待ち状態、休止状態のいずれかに遷移させてプロセスを実行し管理する前記データ処理プログラムであって、
前記第1オペレーティングシステムにおいて、第1プロセスを生成する第1生成ステップと、
前記第2オペレーティングシステムにおいて、前記第1プロセスと対応する第2プロセスを生成する第2生成ステップと、
前記第1オペレーティングシステムにおいて、前記第1プロセスの状態遷移を検出する第1検出ステップと、
前記第1オペレーティングシステムにおいて、検出された状態遷移を示す遷移情報を出力する第1出力ステップと、
前記第1オペレーティングシステムを前記第2オペレーティングシステムに切り替えるOS切替ステップと、
前記第2オペレーティングシステムにおいて、前記遷移情報を取得する第2取得ステップと、
取得した前記遷移情報に従って、前記第2プロセスの状態を遷移させる第2遷移ステップと
を含むことを特徴とする請求項57に記載のデータ処理プログラム。
The data processing program for switching between a first operating system and a second operating system, and executing and managing a process by changing a process generated in each operating system to one of an execution state, an execution wait state, and a hibernation state. And
A first generation step of generating a first process in the first operating system;
A second generation step of generating a second process corresponding to the first process in the second operating system;
A first detection step of detecting a state transition of the first process in the first operating system;
A first output step for outputting transition information indicating the detected state transition in the first operating system;
An OS switching step of switching the first operating system to the second operating system;
A second acquisition step of acquiring the transition information in the second operating system;
58. The data processing program according to claim 57, further comprising: a second transition step for transitioning the state of the second process according to the acquired transition information.
プログラムに従って動作する前記データ処理装置において用いられる前記データ処理プログラムであって、
前記データ処理装置は、複数の処理手順から構成されるプログラムを記憶している記憶手段を備え、
前記記憶手段に記憶されている前記プログラムが不正なものであるか否かを判断する正当性判断ステップと、
不正なものであると判断される場合に、前記プログラムを無効化する無効化ステップと
を含むことを特徴とする請求項57に記載のデータ処理プログラム。
The data processing program used in the data processing apparatus that operates according to a program,
The data processing apparatus includes a storage unit that stores a program including a plurality of processing procedures.
A legitimacy determining step of determining whether or not the program stored in the storage means is illegal;
58. The data processing program according to claim 57, further comprising: an invalidation step of invalidating the program when it is determined to be illegal.
前記データ処理装置において用いられるデータ処理プログラムであって、
前記データ処理装置は、データを記憶するためのメモリ手段と複数の処理手順から構成されるプログラムに従って動作するプロセッサとを備え、
前記データ処理プログラムは、
前記メモリ手段と前記プロセッサとの間において、前記プロセッサから出力される前記メモリ手段宛の転送データが転送制限条件を満たしているか否かを判断し、転送制限条件を満たしていると判断する場合に、前記メモリ手段への転送データの転送を抑制し、転送制限条件を満たしていないと判断する場合に、前記メモリ手段への転送データの転送を行う監視ステップ
を含むことを特徴とする請求項57に記載のデータ処理プログラム。
A data processing program used in the data processing device,
The data processing device comprises a memory means for storing data and a processor that operates according to a program comprising a plurality of processing procedures,
The data processing program is
When it is determined whether transfer data addressed to the memory means output from the processor satisfies a transfer restriction condition between the memory means and the processor, and it is determined that the transfer restriction condition is satisfied 58. The method further comprises a monitoring step of suppressing transfer of transfer data to the memory means and transferring transfer data to the memory means when it is determined that a transfer restriction condition is not satisfied. The data processing program described in 1.
前記データ処理プログラムは、
コンピュータ読み取り可能な記録媒体に記録されている
ことを特徴とする請求項57に記載のデータ処理プログラム。
The data processing program is
58. The data processing program according to claim 57, recorded on a computer-readable recording medium.
JP2004342650A 2003-11-28 2004-11-26 Data processing device Active JP4629416B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004342650A JP4629416B2 (en) 2003-11-28 2004-11-26 Data processing device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003399055 2003-11-28
JP2004342650A JP4629416B2 (en) 2003-11-28 2004-11-26 Data processing device

Publications (3)

Publication Number Publication Date
JP2005182774A true JP2005182774A (en) 2005-07-07
JP2005182774A5 JP2005182774A5 (en) 2007-11-15
JP4629416B2 JP4629416B2 (en) 2011-02-09

Family

ID=34797364

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004342650A Active JP4629416B2 (en) 2003-11-28 2004-11-26 Data processing device

Country Status (1)

Country Link
JP (1) JP4629416B2 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008046887A (en) * 2006-08-17 2008-02-28 Ntt Docomo Inc Os changeover apparatus and os changeover method
JP2008123482A (en) * 2006-10-18 2008-05-29 Matsushita Electric Ind Co Ltd Storage medium control method
JP2009093660A (en) * 2007-10-08 2009-04-30 ▲聯▼想(北京)有限公司 Method and client system for implementing online secure payment
JP2010541084A (en) * 2007-10-02 2010-12-24 インターナショナル・ビジネス・マシーンズ・コーポレーション Differentiate safety standards with secure kernel design
JP2012089138A (en) * 2010-10-21 2012-05-10 Arm Ltd Security countermeasure for object image displayed in non-secure domain
JP2013507698A (en) * 2009-10-15 2013-03-04 エフティーエス コンピューターテクニク ジーエムビーエイチ How to run safety-related and non-safety-related software components on a single hardware platform
US8402280B1 (en) 2009-10-15 2013-03-19 Nvidia Corporation System, method, and computer program product for buffering in association with audio/video digital rights management (DRM) processing
US8868925B2 (en) 2008-12-09 2014-10-21 Nvidia Corporation Method and apparatus for the secure processing of confidential content within a virtual machine of a processor
JP2015525934A (en) * 2012-07-24 2015-09-07 スプリント コミュニケーションズ カンパニー エル.ピー. Trusted security zone for accessing peripherals
JP2019160302A (en) * 2018-03-06 2019-09-19 ライン プラス コーポレーションLINE Plus Corporation Method and system for providing secure message
JP2021530009A (en) * 2018-06-27 2021-11-04 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Secure behavior for encrypted data

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272625A (en) * 1995-03-29 1996-10-18 Toshiba Corp Device and method for multiprogram execution control
JP2001022598A (en) * 1999-07-07 2001-01-26 Hitachi Ltd Computer system
JP2001256066A (en) * 2000-02-29 2001-09-21 Internatl Business Mach Corp <Ibm> Computer system, switching system of operating system, mounting method of operating system, switching method of operating system, storage medium and program transmitter
JP2001318787A (en) * 2000-05-08 2001-11-16 Toshiba Corp Microprocessor and multi-task execution method and multi-thread execution method using the same
JP2002182560A (en) * 2000-12-12 2002-06-26 Hitachi Ltd Information server device equipped with ciphering processing function
JP2002189633A (en) * 2000-12-21 2002-07-05 Nec Corp Method and device for protecting memory in virtual space
JP2002251326A (en) * 2001-02-22 2002-09-06 Hitachi Ltd Tamper-proof computer system
JP2002353960A (en) * 2001-05-30 2002-12-06 Fujitsu Ltd Code performing device and code distributing method
JP2003280756A (en) * 2002-03-25 2003-10-02 Seiko Epson Corp Debug means of information processor

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272625A (en) * 1995-03-29 1996-10-18 Toshiba Corp Device and method for multiprogram execution control
JP2001022598A (en) * 1999-07-07 2001-01-26 Hitachi Ltd Computer system
JP2001256066A (en) * 2000-02-29 2001-09-21 Internatl Business Mach Corp <Ibm> Computer system, switching system of operating system, mounting method of operating system, switching method of operating system, storage medium and program transmitter
JP2001318787A (en) * 2000-05-08 2001-11-16 Toshiba Corp Microprocessor and multi-task execution method and multi-thread execution method using the same
JP2002182560A (en) * 2000-12-12 2002-06-26 Hitachi Ltd Information server device equipped with ciphering processing function
JP2002189633A (en) * 2000-12-21 2002-07-05 Nec Corp Method and device for protecting memory in virtual space
JP2002251326A (en) * 2001-02-22 2002-09-06 Hitachi Ltd Tamper-proof computer system
JP2002353960A (en) * 2001-05-30 2002-12-06 Fujitsu Ltd Code performing device and code distributing method
JP2003280756A (en) * 2002-03-25 2003-10-02 Seiko Epson Corp Debug means of information processor

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008046887A (en) * 2006-08-17 2008-02-28 Ntt Docomo Inc Os changeover apparatus and os changeover method
JP2008123482A (en) * 2006-10-18 2008-05-29 Matsushita Electric Ind Co Ltd Storage medium control method
JP2010541084A (en) * 2007-10-02 2010-12-24 インターナショナル・ビジネス・マシーンズ・コーポレーション Differentiate safety standards with secure kernel design
JP2009093660A (en) * 2007-10-08 2009-04-30 ▲聯▼想(北京)有限公司 Method and client system for implementing online secure payment
US8868925B2 (en) 2008-12-09 2014-10-21 Nvidia Corporation Method and apparatus for the secure processing of confidential content within a virtual machine of a processor
US8402280B1 (en) 2009-10-15 2013-03-19 Nvidia Corporation System, method, and computer program product for buffering in association with audio/video digital rights management (DRM) processing
JP2013507698A (en) * 2009-10-15 2013-03-04 エフティーエス コンピューターテクニク ジーエムビーエイチ How to run safety-related and non-safety-related software components on a single hardware platform
JP2012089138A (en) * 2010-10-21 2012-05-10 Arm Ltd Security countermeasure for object image displayed in non-secure domain
JP2015525934A (en) * 2012-07-24 2015-09-07 スプリント コミュニケーションズ カンパニー エル.ピー. Trusted security zone for accessing peripherals
JP2019160302A (en) * 2018-03-06 2019-09-19 ライン プラス コーポレーションLINE Plus Corporation Method and system for providing secure message
US11881940B2 (en) 2018-03-06 2024-01-23 LINE Plus Corporation Method and system for providing secure message
JP7422490B2 (en) 2018-03-06 2024-01-26 ライン プラス コーポレーション Secure message provision method and system
JP2021530009A (en) * 2018-06-27 2021-11-04 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Secure behavior for encrypted data
JP7201300B2 (en) 2018-06-27 2023-01-10 インターナショナル・ビジネス・マシーンズ・コーポレーション Secure operation on encrypted data

Also Published As

Publication number Publication date
JP4629416B2 (en) 2011-02-09

Similar Documents

Publication Publication Date Title
KR101037006B1 (en) Data processing device
JP6067449B2 (en) Information processing apparatus and information processing program
JP4903188B2 (en) Method and apparatus for providing updatable key bindings for a trusted infrastructure partition (TPM)
US8555089B2 (en) Program execution apparatus, control method, control program, and integrated circuit
JP4886682B2 (en) Data processing device
JP5260081B2 (en) Information processing apparatus and control method thereof
JP4537908B2 (en) Processor, memory, computer system and system LSI
JP4795812B2 (en) Secure processor
JP4660188B2 (en) Protection from attacks in sleep
EP2062191B1 (en) System and method for securely restoring a program context from a shared memory
JP4629416B2 (en) Data processing device
WO2010041462A1 (en) Information processing device, information processing method, information processing program, and integrated circuit
CN107077428A (en) Protect using secret from operating system attack
JP2013519929A (en) Information processing apparatus, information processing system, software routine execution method, and remote authentication method
JP4706750B2 (en) Information processing system and information processing program
JP2016111446A (en) Memory controller, control method of memory controller, and memory system
JP2007310601A (en) Microcomputer and method for protecting its software
JP2005182774A5 (en)
JP5759827B2 (en) MEMORY SYSTEM, INFORMATION PROCESSING DEVICE, MEMORY DEVICE, AND MEMORY SYSTEM OPERATION METHOD
JP6987308B1 (en) Information processing equipment, information processing methods and information processing programs
JP2010146635A (en) Content recording/reproducing device, and content writing/reading method
JP5304304B2 (en) Security enhancement system, method, program, and USB memory
JP2004252852A (en) Information processor and information processing method
JP2011118504A (en) Storage device

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071002

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071002

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100727

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100924

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: 20101019

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131119

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4629416

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250