JP2018116669A - On-vehicle device, relay device, and computer programs - Google Patents
On-vehicle device, relay device, and computer programs Download PDFInfo
- Publication number
- JP2018116669A JP2018116669A JP2017068330A JP2017068330A JP2018116669A JP 2018116669 A JP2018116669 A JP 2018116669A JP 2017068330 A JP2017068330 A JP 2017068330A JP 2017068330 A JP2017068330 A JP 2017068330A JP 2018116669 A JP2018116669 A JP 2018116669A
- Authority
- JP
- Japan
- Prior art keywords
- data
- control program
- cpu
- relay
- repeater
- 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
Links
Images
Abstract
Description
本発明は、車載装置と、通信装置間の通信を中継する中継装置と、前記車載装置及び中継装置夫々で実行されるコンピュータプログラムとに関する。 The present invention relates to an in-vehicle device, a relay device that relays communication between communication devices, and a computer program that is executed in each of the in-vehicle device and the relay device.
車両に搭載される通信システムとして、電気機器の動作を制御する複数のECU(Electronic Control Unit)間の通信を中継装置が中継する通信システムがある。この通信システムでは、複数のECU夫々は通信装置として機能し、1つのECUは、中継装置を介して、他のECUと通信する。複数のECUは相互に通信することによって、複数の電気機器に協調動作を行わせることができる。中継装置は、1つのECUから受信したデータを他のECUに送信する。 As a communication system mounted on a vehicle, there is a communication system in which a relay device relays communication between a plurality of ECUs (Electronic Control Units) that control the operation of an electric device. In this communication system, each of a plurality of ECUs functions as a communication device, and one ECU communicates with another ECU via a relay device. A plurality of ECUs can cause a plurality of electric devices to perform a cooperative operation by communicating with each other. The relay device transmits data received from one ECU to another ECU.
中継装置には制御プログラムが記憶されている。中継装置では、CPU(Central Processing Unit)は、制御プログラムを実行することによって、通信を中継する中継処理を実行する。中継装置に記憶されている制御プログラムが改ざんされた場合、中継装置は適切にデータを送信しないため、電気機器が適正に動作しない虞がある。そこで、中継装置が起動した場合に、制御プログラムが適正であることを検証する必要がある。 A control program is stored in the relay device. In the relay device, a CPU (Central Processing Unit) executes a relay process for relaying communication by executing a control program. When the control program stored in the relay device is tampered with, the relay device does not transmit data properly, and thus there is a risk that the electrical device will not operate properly. Therefore, it is necessary to verify that the control program is appropriate when the relay device is activated.
特許文献1には、制御プログラムが適正であることを検証する技術が開示されている。この技術では、制御プログラムに関連する関連データを演算し、演算した関連データが、予め記憶されている複数の所定データの1つと一致するか否かと判定する。演算した関連データが複数の所定データの1つと一致する場合、制御プログラムが適正であると判定する。
車両における通信では複数のプロトコルが用いられている。このため、中継装置として、複数の第1通信装置間の通信を中継する第1中継機と、複数の第2通信装置間の通信を中継する第2中継機とを備える中継装置が考えられる。 A plurality of protocols are used for communication in vehicles. For this reason, a relay device provided with the 1st relay machine which relays communication between a plurality of 1st communication devices and the 2nd relay machine which relays communication between a plurality of 2nd communication devices can be considered as a relay device.
この中継装置では、例えば、複数の第1通信装置間で第1プロトコルに従った通信が行われ、複数の第2通信装置間で第2プロトコルに従った通信が行われる。また、第1中継機は第2中継機に接続されており、第1中継機及び第2中継機は、第1通信装置及び第2通信装置間の通信を中継する。 In this relay device, for example, communication according to the first protocol is performed between the plurality of first communication devices, and communication according to the second protocol is performed between the plurality of second communication devices. The first repeater is connected to the second repeater, and the first repeater and the second repeater relay communication between the first communication device and the second communication device.
第1中継機及び第2中継機を備える中継装置では、第1中継機及び第2中継機夫々にCPUが搭載されており、第1中継機のCPUが実行する制御プログラムは、第2中継機のCPUが実行する制御プログラムと異なる。この場合、これらの制御プログラム夫々について検証を行う必要がある。第1中継機及び第2中継機夫々の制御プログラムを検証する中継装置として、制御プログラムが適正であることを検証する検証機能を、第1中継機及び第2中継機夫々が有する中継装置が考えられる。
しかしながら、第1中継機及び第2中継機夫々が検証機能を有する場合、中継装置のサイズが大型であり、製造費用が嵩むという問題がある。
In the relay apparatus including the first relay machine and the second relay machine, the first relay machine and the second relay machine are each equipped with a CPU, and the control program executed by the CPU of the first relay machine is the second relay machine. This is different from the control program executed by the CPU. In this case, it is necessary to verify each of these control programs. As a relay device that verifies the control program of each of the first relay device and the second relay device, the relay device that each of the first relay device and the second relay device has a verification function that verifies that the control program is appropriate is considered. It is done.
However, when each of the first repeater and the second repeater has a verification function, there is a problem that the size of the repeater is large and the manufacturing cost increases.
このような問題がある車載装置は、中継装置に限定されない。第1制御プログラムに従って処理が実行される第1車載機と、第1制御プログラムとは異なる第2制御プログラムに従って処理が実行される第2車載機とを備える車載装置にも同様の問題がある。 The in-vehicle device having such a problem is not limited to the relay device. A vehicle-mounted device including a first vehicle-mounted device that executes processing according to the first control program and a second vehicle-mounted device that executes processing according to a second control program different from the first control program has the same problem.
本発明は斯かる事情に鑑みてなされたものであり、その目的とするところは、第1車載機及び第2車載機を備える小型で安価な車載装置と、第1中継機及び第2中継機を備える小型で安価な中継装置と、前記車載装置及び中継装置夫々で実行されるコンピュータプログラムとを提供することにある。 The present invention has been made in view of such circumstances, and an object thereof is to provide a small and inexpensive on-vehicle device including a first in-vehicle device and a second in-vehicle device, and a first repeater and a second repeater. And a small and inexpensive relay device, and a computer program executed by each of the in-vehicle device and the relay device.
本発明に係る車載装置は、第1制御プログラムに従って処理を実行する第1処理部と、該第1処理部を構成するハードウェアとは異なる他のハードウェアによって前記第1制御プログラムを検証する検証器とを有する第1車載機を備える車載装置において、第2制御プログラムに従って処理を実行する第2処理部を有する第2車載機と、前記第2制御プログラムに関連する関連データを演算する関連データ演算部とを備え、前記検証器は、前記関連データ演算部が演算した関連データが基準データと一致するか否かを判定する判定部を有することを特徴とする。 The in-vehicle device according to the present invention includes a first processing unit that executes processing according to a first control program, and verification that verifies the first control program by using different hardware than the hardware that configures the first processing unit. In a vehicle-mounted device including a first vehicle-mounted device having a device, a second vehicle-mounted device having a second processing unit that executes processing according to a second control program, and related data for calculating related data related to the second control program And a verification unit, wherein the verification unit includes a determination unit that determines whether the related data calculated by the related data calculation unit matches reference data.
本発明にあっては、第1車載機の検証器が、第2車載機の第2制御プログラムに関連する関連データが基準データと一致するか否かを判定することよって、第2制御プログラムを検証する。このため、第2車載機が第2制御プログラムの検証機能を有する必要がないので、装置は小型であり、製造費用が安価である。 In the present invention, the verifier of the first in-vehicle device determines whether or not the related data related to the second control program of the second in-vehicle device matches the reference data. Validate. For this reason, since the 2nd vehicle equipment does not need to have the verification function of a 2nd control program, an apparatus is small and manufacturing cost is cheap.
本発明に係る車載装置は、前記検証器では、前記他のハードウェアが検証プログラムを実行することによって、前記第1制御プログラムが検証されることを特徴とする。 The in-vehicle device according to the present invention is characterized in that, in the verification device, the first control program is verified by the other hardware executing the verification program.
本発明にあっては、第1処理部を構成するハードウェアとは異なる他のハードウェアが検証プログラムを実行することによって、第1制御プログラムが検証される。 In the present invention, the first control program is verified by executing the verification program by other hardware different from the hardware configuring the first processing unit.
本発明に係る車載装置は、前記第1車載機の前記検証器は、前記関連データ演算部と、乱数データを生成する乱数生成部と、該乱数生成部が生成した乱数データ、及び、所定データに基づいて、前記基準データを演算する基準データ演算部とを有し、前記第2車載機は、前記第2制御プログラム及び乱数データに基づいて、前記関連データを演算するための演算データを算出する算出部を有し、前記検証器の前記関連データ演算部は、前記算出部が算出した演算データに基づいて前記関連データを演算することを特徴とする。 In the in-vehicle apparatus according to the present invention, the verifier of the first in-vehicle apparatus includes the related data calculation unit, a random number generation unit that generates random number data, random number data generated by the random number generation unit, and predetermined data. And a reference data calculation unit for calculating the reference data, and the second in-vehicle device calculates calculation data for calculating the related data based on the second control program and random number data. And the related data calculation unit of the verifier calculates the related data based on the calculation data calculated by the calculation unit.
本発明にあっては、第1車載機の検証器は、乱数データを生成し、生成した乱数データと、所定データとに基づいて基準データを演算する。第2車載機は、検証器が生成した乱数データを取得し、取得した乱数データと第2制御プログラムとに基づいて演算データを算出する。検証器は、第2車載機が算出した演算データを取得し、取得した演算データに基づいて関連データを演算し、関連データが基準データと一致するか否かを判定する。 In the present invention, the verifier of the first in-vehicle device generates random number data, and calculates reference data based on the generated random number data and predetermined data. The second in-vehicle device acquires the random number data generated by the verifier, and calculates calculation data based on the acquired random number data and the second control program. The verifier acquires the calculation data calculated by the second in-vehicle device, calculates related data based on the acquired calculation data, and determines whether the related data matches the reference data.
検証器が生成する乱数データが変更された場合、第2車載機が算出する演算データも変更される。例えば、検証器が第2制御プログラムを検証する都度、乱数データを変更すると仮定する。この場合、検証器が第2制御プログラムを検証する都度、演算データが変更されるので、第2制御プログラムの検証結果の信頼性が高い。 When the random number data generated by the verifier is changed, the calculation data calculated by the second in-vehicle device is also changed. For example, assume that the random number data is changed each time the verifier verifies the second control program. In this case, since the calculation data is changed every time the verifier verifies the second control program, the reliability of the verification result of the second control program is high.
本発明に係る車載装置は、前記第1車載機の前記検証器は、鍵データが記憶されている記憶部を有し、前記基準データ演算部は、該記憶部に記憶されている鍵データと、前記乱数データと、前記所定データとに基づいて前記基準データを演算し、前記関連データ演算部は、前記演算データ及び鍵データに基づいて前記関連データを演算することを特徴とする。 In the in-vehicle device according to the present invention, the verifier of the first in-vehicle device has a storage unit in which key data is stored, and the reference data calculation unit includes key data stored in the storage unit. The reference data is calculated based on the random number data and the predetermined data, and the related data calculation unit calculates the related data based on the calculated data and key data.
本発明にあっては、第1車載機の検証器は、鍵データ、乱数データ及び所定データに基づいて基準データを演算すると共に、第2車載機が演算した演算データと鍵データとに基づいて関連データを演算するので、第2制御プログラムの検証結果の信頼性がより高い。 In the present invention, the verifier of the first in-vehicle device calculates the reference data based on the key data, the random number data, and the predetermined data, and based on the operation data calculated by the second in-vehicle device and the key data. Since the related data is calculated, the reliability of the verification result of the second control program is higher.
本発明に係る車載装置は、前記第1車載機の前記検証器は、乱数データを生成する乱数生成部と、該乱数生成部が生成した乱数データ、及び、所定データに基づいて、前記基準データを演算する基準データ演算部とを有し、前記第2車載機は前記関連データ演算部を有し、該関連データ演算部は、前記第2制御プログラム及び乱数データに基づいて前記関連データを演算することを特徴とする。 In the in-vehicle device according to the present invention, the verifier of the first in-vehicle device includes the random number generator that generates random number data, the random number data generated by the random number generator, and the reference data based on predetermined data. A reference data calculation unit for calculating the second data, the second vehicle-mounted device has the related data calculation unit, and the related data calculation unit calculates the related data based on the second control program and random number data. It is characterized by doing.
本発明にあっては、第1車載機の検証器は、乱数データを生成し、生成した乱数データと、所定データとに基づいて基準データを演算する。第2車載機は、検証器が生成した乱数データを取得し、取得した乱数データと第2制御プログラムとに基づいて関連データを演算する。検証器は、第2車載機が演算した関連データを取得し、取得した関連データが基準データと一致するか否かを判定する。 In the present invention, the verifier of the first in-vehicle device generates random number data, and calculates reference data based on the generated random number data and predetermined data. The second in-vehicle device acquires the random number data generated by the verifier, and calculates related data based on the acquired random number data and the second control program. The verifier acquires related data calculated by the second in-vehicle device, and determines whether or not the acquired related data matches the reference data.
検証器が生成する乱数データが変更された場合、第2車載機が演算する関連データも変更される。例えば、検証器が第2制御プログラムを検証する都度、乱数データを変更すると仮定する。この場合、検証器が第2制御プログラムを検証する都度、検証器が第2車載機から取得する関連データが変更されるので、第2制御プログラムの検証結果の信頼性が高い。 When the random number data generated by the verifier is changed, the related data calculated by the second in-vehicle device is also changed. For example, assume that the random number data is changed each time the verifier verifies the second control program. In this case, each time the verifier verifies the second control program, the related data acquired by the verifier from the second in-vehicle device is changed, so the reliability of the verification result of the second control program is high.
本発明に係る車載装置は、前記検証器の前記判定部によって、前記関連データが前記基準データと一致していないと判定された場合に前記第2車載機の動作を停止させる動作制御部を備えることを特徴とする。 The in-vehicle device according to the present invention includes an operation control unit that stops the operation of the second in-vehicle device when the determination unit of the verifier determines that the related data does not match the reference data. It is characterized by that.
本発明にあっては、第1車載機の検証器によって、関連データが所定データと一致しないと判定された場合、第2制御プログラムが改ざんされた可能性が高いとして、第2車載機は動作を停止する。 In the present invention, when the verifier of the first in-vehicle device determines that the related data does not match the predetermined data, the second in-vehicle device operates with the possibility that the second control program has been falsified. To stop.
本発明に係る中継装置は、複数の第1通信装置間の通信を中継する第1中継機と、制御プログラムに従って処理を実行し、複数の第2通信装置間の通信を中継する第2中継機とを備え、前記第1中継機及び第2中継機は前記第1通信装置及び第2通信装置間の通信を中継する車両用の中継装置であって、前記第1中継機は、鍵データが記憶されている記憶部と、該鍵データを用いて、前記第2中継機の前記制御プログラムに関連する関連データを演算する演算部と、該演算部が演算した関連データが所定データと一致するか否かを判定する判定部とを有することを特徴とする。 A relay device according to the present invention includes a first relay that relays communication between a plurality of first communication devices, and a second relay that performs processing according to a control program and relays communication between the plurality of second communication devices. The first relay and the second relay are relay devices for vehicles that relay communication between the first communication device and the second communication device, and the first relay has key data A stored storage unit, a calculation unit that calculates related data related to the control program of the second repeater using the key data, and the related data calculated by the calculation unit match predetermined data And a determination unit for determining whether or not.
本発明にあっては、第2中継機では、制御プログラムに従って処理が実行される。第1中継機は、鍵データを用いて、第2中継機の制御プログラムに関連する関連データを演算し、演算した関連データが所定データと一致するか否かを判定する。第1中継機は、関連データが所定データと一致した場合、例えば、制御プログラムは適正であることを第2中継機に通知し、第2中継機は制御プログラムに従って処理を開始する。 In the present invention, in the second repeater, processing is executed according to the control program. The first relay uses the key data to calculate related data related to the control program of the second relay, and determines whether the calculated related data matches the predetermined data. When the related data matches the predetermined data, for example, the first repeater notifies the second repeater that the control program is appropriate, and the second repeater starts processing according to the control program.
以上のように、第1中継機が第2中継機の制御プログラムが適正であることを検証するため、第1中継機及び第2中継機夫々が制御プログラムの検証機能を有する必要がない。このため、装置は小型であり、製造費用は安価である。 As described above, since the first repeater verifies that the control program for the second repeater is appropriate, each of the first repeater and the second repeater need not have a control program verification function. For this reason, the apparatus is small and the manufacturing cost is low.
本発明に係る中継装置は、前記第1中継機の前記判定部によって前記関連データが前記所定データと一致していないと判定された場合に前記第2中継機の動作を停止させる動作制御部を備えることを特徴とする。 The relay device according to the present invention includes an operation control unit that stops the operation of the second repeater when the determination unit of the first repeater determines that the related data does not match the predetermined data. It is characterized by providing.
本発明にあっては、第1中継機によって、関連データが所定データと一致しないと判定された場合、第2中継機の制御プログラムが改ざんされた可能性が高いとして、第2中継機は動作を停止する。 In the present invention, when it is determined by the first repeater that the related data does not match the predetermined data, the second repeater operates with the possibility that the control program of the second repeater has been falsified. To stop.
本発明に係る中継装置は、前記第2中継機は、前記関連データを演算するための演算データを算出する算出部を有し、前記第1中継機は、該算出部が算出した演算データを取得する取得部を有し、前記第1中継機の前記演算部は、前記鍵データと、該取得部が取得した演算データとを用いて前記関連データを演算することを特徴とする。 In the relay device according to the present invention, the second relay has a calculation unit that calculates calculation data for calculating the related data, and the first relay transmits the calculation data calculated by the calculation unit. It has an acquisition part to acquire, The calculation part of the 1st repeater calculates the related data using the key data and the calculation data which the acquisition part acquired.
本発明にあっては、第2中継機は、関連データを演算するための演算データを算出する。第1中継機は、演算データを第2中継機から取得し、鍵データと演算データとを用いて関連データを演算する。例えば、演算データのデータ量が制御プログラムのデータ量よりも小さい場合、制御プログラムが適正であることを検証するために、第2中継機から第1中継機へ転送されるデータのデータ量は小さい。この場合、検証を行うために必要な時間が短い。 In the present invention, the second repeater calculates calculation data for calculating related data. The first repeater obtains calculation data from the second repeater and calculates related data using the key data and the calculation data. For example, when the amount of operation data is smaller than the amount of data in the control program, the amount of data transferred from the second repeater to the first repeater is small in order to verify that the control program is appropriate . In this case, the time required for performing the verification is short.
本発明に係る中継装置は、前記第1中継機は、第2の制御プログラムに従って処理を実行する処理部と、第2の鍵データが記憶されている第2の記憶部と、該第2の鍵データを用いて、前記第2の制御プログラムに関連する第2の関連データを演算する第2の演算部と、該第2の演算部が演算した第2の関連データが第2の所定データと一致するか否かを判定する第2の判定部とを有することを特徴とする。 In the relay device according to the present invention, the first repeater includes a processing unit that executes processing according to a second control program, a second storage unit that stores second key data, and the second relay unit. A second calculation unit that calculates second related data related to the second control program using the key data, and the second related data calculated by the second calculation unit is the second predetermined data. And a second determination unit that determines whether or not they match.
本発明にあっては、第1中継機では、第2の制御プログラムに従って処理が実行される。第1中継機は、鍵データを用いて関連データを演算することによって、第2中継機の制御プログラムが適正であることを検証すると共に、第2の鍵データを用いて第2の関連データを演算することによって、自機の第2の制御プログラムが適正であることも検証する。 In the present invention, the first repeater executes processing according to the second control program. The first repeater verifies that the control program of the second repeater is appropriate by calculating the associated data using the key data, and uses the second key data to obtain the second associated data. It is also verified by calculation that the second control program of the own device is appropriate.
本発明に係る中継装置は、複数の第1通信装置間の通信で用いられる第1プロトコルに対応するデータを、複数の第2通信装置間の通信で用いられる第2プロトコルに対応するデータに変換し、該第2プロトコルに対応するデータを前記第1プロトコルに対応するデータに変換する変換部を備えることを特徴とする。 The relay device according to the present invention converts data corresponding to a first protocol used in communication between a plurality of first communication devices into data corresponding to a second protocol used in communication between the plurality of second communication devices. And a conversion unit for converting data corresponding to the second protocol into data corresponding to the first protocol.
本発明にあっては、複数の第1通信装置間の通信では第1プロトコルが用いられ、複数の第2通信装置間の通信では第2プロトコルが用いられる。第1通信装置及び第2通信装置間で通信が行われる場合、第1プロトコル対応するデータを、第2プロトコルに対応するデータに変換し、第2プロトコルに対応するデータを第1プロトコルに対応するデータに変換する。 In the present invention, the first protocol is used for communication between the plurality of first communication devices, and the second protocol is used for communication between the plurality of second communication devices. When communication is performed between the first communication device and the second communication device, data corresponding to the first protocol is converted into data corresponding to the second protocol, and data corresponding to the second protocol is corresponded to the first protocol. Convert to data.
本発明に係るコンピュータプログラムは、第1制御プログラムに従って処理を実行する第1処理部と、該第1処理部を構成するハードウェアとは異なる他のハードウェアによって前記第1制御プログラムを検証する検証器とを有する第1車載機と、第2制御プログラムに従って処理を実行する第2車載機とを備える車載装置の前記検証器で実行されるコンピュータプログラムであって、前記第2制御プログラムに関連する関連データを演算し、演算した関連データが基準データと一致しているか否かを判定する処理をコンピュータに実行させることを特徴とする。 A computer program according to the present invention includes a first processing unit that executes processing according to a first control program, and verification that verifies the first control program by using hardware other than the hardware that constitutes the first processing unit. A computer program that is executed by the verifier of the in-vehicle device that includes a first in-vehicle device that includes a first in-vehicle device and a second in-vehicle device that executes processing according to the second control program, and is related to the second control program The related data is calculated, and the computer is caused to execute processing for determining whether or not the calculated related data matches the reference data.
本発明にあっては、第1車載機の検証器が、第2車載機の第2制御プログラムに関連する関連データが基準データと一致するか否かを判定することよって、第2制御プログラムを検証する。このため、第2車載機が第2制御プログラムの検証機能を有する必要がないので、車載装置は小型であり、車載装置の製造費用は安価である。 In the present invention, the verifier of the first in-vehicle device determines whether or not the related data related to the second control program of the second in-vehicle device matches the reference data. Validate. For this reason, since the 2nd vehicle equipment does not need to have the verification function of the 2nd control program, a vehicle equipment is small and the manufacturing cost of a vehicle equipment is cheap.
本発明に係るコンピュータプログラムは、第1制御プログラムに従って処理を実行する第1処理部と、該第1処理部を構成するハードウェアとは異なる他のハードウェアによって前記第1制御プログラムを検証する検証器とを有する第1車載機と、第2制御プログラムに従って処理を実行する第2車載機とを備える車載装置の前記検証器で実行されるコンピュータプログラムであって、前記第2制御プログラムに関連する関連データを取得し、取得した関連データが基準データと一致しているか否かを判定する処理をコンピュータに実行させることを特徴とする。 A computer program according to the present invention includes a first processing unit that executes processing according to a first control program, and verification that verifies the first control program by using hardware other than the hardware that constitutes the first processing unit. A computer program that is executed by the verifier of the in-vehicle device that includes a first in-vehicle device that includes a first in-vehicle device and a second in-vehicle device that executes processing according to the second control program, and is related to the second control program Relevant data is acquired, and the computer is caused to execute a process for determining whether or not the acquired related data matches the reference data.
本発明にあっては、第1車載機の検証器が、第2車載機の第2制御プログラムに関連する関連データが基準データと一致するか否かを判定することよって、第2制御プログラムを検証する。このため、第2車載機が第2制御プログラムの検証機能を有する必要がないので、車載装置は小型であり、車載装置の製造費用は安価である。 In the present invention, the verifier of the first in-vehicle device determines whether or not the related data related to the second control program of the second in-vehicle device matches the reference data. Validate. For this reason, since the 2nd vehicle equipment does not need to have the verification function of the 2nd control program, a vehicle equipment is small and the manufacturing cost of a vehicle equipment is cheap.
本発明に係るコンピュータプログラムは、複数の第1通信装置間の通信を中継する第1中継機と、制御プログラムに従って処理を実行し、複数の第2通信装置間の通信を中継する第2中継機とを備え、前記第1中継機及び第2中継機は前記第1通信装置及び第2通信装置間の通信を中継する車両用の中継装置における前記第1中継機で実行されるコンピュータプログラムであって、予め記憶されている鍵データを用いて、前記第2中継機の前記制御プログラムに関連する関連データを演算し、演算した関連データが所定データと一致するか否かを判定する処理をコンピュータに実行させることを特徴とする。 A computer program according to the present invention includes a first relay that relays communication between a plurality of first communication devices, and a second relay that performs processing according to a control program and relays communication between the plurality of second communication devices. And the first repeater and the second repeater are computer programs executed by the first repeater in a vehicle relay device that relays communication between the first communication device and the second communication device. The computer calculates the related data related to the control program of the second repeater using the key data stored in advance, and determines whether or not the calculated related data matches the predetermined data It is made to perform.
本発明にあっては、第1中継機が、第2中継機の制御プログラムに関連する関連データが基準データと一致するか否かを判定することよって、第2中継機の制御プログラムを検証する。このため、第2中継機が制御プログラムの検証機能を有する必要がないので、中継装置は小型であり、中継装置の製造費用は安価である。 In the present invention, the first repeater verifies the control program of the second repeater by determining whether the related data related to the control program of the second repeater matches the reference data. . For this reason, since it is not necessary for the second repeater to have a control program verification function, the relay device is small and the manufacturing cost of the relay device is low.
本発明によれば、小型で安価な装置を実現することができる。 According to the present invention, a small and inexpensive device can be realized.
以下、本発明をその実施の形態を示す図面に基づいて詳述する。
(実施の形態1)
図1は、実施の形態1における通信システム1の要部構成を示すブロック図である。通信システム1は、車両100に好適に搭載され、中継装置11、ECU12a,12a,12b,12b、車載機器13a,13b,13c及び通信線La,Lbを備える。中継装置11は第1中継機21及び第2中継機22を有する。
中継装置11、第1中継機21及び第2中継機22夫々は、車載装置、第1車載機及び第2車載機として機能する。
Hereinafter, the present invention will be described in detail with reference to the drawings illustrating embodiments thereof.
(Embodiment 1)
FIG. 1 is a block diagram illustrating a main configuration of a
Each of the
中継装置11の第1中継機21には、2つの通信線La,Lbが各別に接続されている。通信線Laには、2つのECU12a,12aが接続されている。通信線Lbには、2つのECU12b,12bが接続されている。中継装置11では、第1中継機21は第2中継機22に接続されている。第2中継機22には、3つの車載機器13a,13b,13cが各別に接続されている。
Two communication lines La and Lb are connected to the
通信線La,Lb夫々を介して、CAN(Controller Area Network)プロトコルに従った通信が行われる。通信線La,Lb夫々はツイストペア線である。通信線La,Lb夫々を介して、CANプロトコルに対応し、識別情報を含むECUデータが送信される。識別情報は、自身が含まれているECUデータを識別するための情報である。 Communication according to the CAN (Controller Area Network) protocol is performed via the communication lines La and Lb. Each of the communication lines La and Lb is a twisted pair line. The ECU data corresponding to the CAN protocol and including identification information is transmitted via the communication lines La and Lb. The identification information is information for identifying ECU data in which the identification information is included.
ECU12a,12a及び第1中継機21夫々は、通信線Laを介してECUデータを送信する。ECU12a,12a及び第1中継機21中の1つが送信したECUデータは、他の全ての装置によって受信される。例えば、一方のECU12aが送信したECUデータは、他方のECU12a及び第1中継機21によって受信される。
Each of the
同様に、ECU12b,12b及び第1中継機21夫々は、通信線Lbを介してECUデータを送信する。ECU12b,12b及び第1中継機21中の1つが送信したECUデータは、他の全ての装置によって受信される。例えば、一方のECU12bが送信したECUデータは、他方のECU12b及び第1中継機21によって受信される。
Similarly, ECU12b, 12b and the
ECU12a,12a夫々は、ECUデータを受信した場合、受信したECUデータに含まれている識別情報に基づいて、このECUデータに係る処理を実行すべきか否かを判定する。ECU12a,12aは、受信したECUデータに係る処理を実行すべきであると判定した場合、受信したECUデータに係る処理を実行する。ECU12a,12a夫々は、受信したECUデータに係る処理を実行すべきではないと判定した場合、受信したECUデータの放置又は削除等を行う。
When each of the
同様に、ECU12b,12b夫々は、ECUデータを受信した場合、受信したECUデータに含まれている識別情報に基づいて、このECUデータに係る処理を実行すべきか否かを判定する。ECU12b,12b夫々は、受信したECUデータに係る処理を実行すべきであると判定した場合、受信したECUデータに係る処理を実行する。ECU12b,12b夫々は、受信したECUデータに係る処理を実行すべきではないと判定した場合、受信したECUデータの放置又は削除等を行う。
Similarly, when each of the
ECU12a,12a,12b,12b夫々には、図示しない電気機器が接続されている。ECU12a,12a,12b,12b夫々は、例えば、受信したECUデータに係る処理として、受信したECUデータが示す内容に基づいて、自装置に接続されている電気機器の動作を制御する処理を実行する。
An electric device (not shown) is connected to each of the
ECU12a,12a,12b,12b夫々は、例えば、自装置にセンサが接続されている場合、センサが検出した検出値を示すECUデータを送信する。また、ECU12a,12a,12b,12b夫々は、例えば、自装置に使用者から指示を受け付ける受付部が接続されている場合、受付部が受け付けた指示の内容を示すECUデータを送信する。例えば、一方のECU12aに、車両のパワーウィンドウを開閉するウィンドウモータが接続されている場合において、他方のECU12aは、パワーウィンドウの開放を指示するECUデータを送信する。一方のECU12aは、このECUデータを受信した場合、ウィンドウモータにパワーウィンドウを開放させる。
Each of the
第1中継機21は、ECU12a,12a中の1つと、ECU12b,12b中の1つとの間の通信を中継する。具体的には、第1中継機21は、通信線Laを介して受信したECUデータを、通信線Lbを介して送信し、通信線Lbを介して受信したECUデータを、通信線Laを介して送信する。ECU12a,12a,12b,12b夫々は第1通信装置として機能する。ECU12a,12a中の1つと、ECU12b,12b中の1つとの間の通信ではCANプロトコルが用いられる。
The
車載機器13a,13b,13c夫々は、第2中継機22と一対一で通信する。車載機器13a,13b,13c夫々と第2中継機22との間では、例えば、イーサネット(登録商標)の規格に準じた通信が行われる。車載機器13a,13b,13c夫々は、送信先を示す送信先情報を含む機器データを第2中継機22に送信する。第2中継機22は、車載機器13a,13b,13c中の2つの間で行われる通信を中継する。車載機器13a,13b,13c夫々は第2通信装置として機能する。車載機器13a,13b,13c中の2つの間の通信では、例えば、イーサネット(登録商標)に対応するプロトコルの1つであるTCP(Transmission Control Protocol)/IP(Internet Protocol)が用いられる。
Each of the in-
車載機器13a,13b夫々は、カメラ及びディスプレイであると仮定する。この場合、車載機器13aは、カメラで撮影した画像データを含む機器データを第2中継機22に送信する。この機器データには、送信先として車載機器13bを示す送信先情報が含まれている。第2中継機22は、画像データを含む機器データを車載機器13bに送信する。車載機器13bは、第2中継機22から受信した機器データに含まれている画像データに基づく画像を表示する。
It is assumed that each of the in-
第1中継機21及び第2中継機22は、ECU12a,12a,12b,12b中の1つと、車載機器13a,13b,13c中の1つとの間の通信を中継する。
The
ECUデータは、前述したように、CANプロトコルに対応するデータであり、第1プロトコルに対応するデータに相当する。機器データは、車載機器13a,13b,13c中の2つの間の通信で用いられるプロトコルに対応するデータであり、第2プロトコルに対応するデータに相当する。
第1中継機21は、通信線La,Lbの一方を介して受信したECUデータを機器データに変換する。第2中継機22は、第1中継機21が変換した機器データを車載機器13a,13b,13c中の1つに送信する。第2中継機22は、車載機器13a,13b,13c中の1つから機器データを受信する。第1中継機21は、第2中継機22が受信した機器データをECUデータに変換し、変換したECUデータを通信線La,Lb中の少なくとも一方を介して送信する。
As described above, the ECU data is data corresponding to the CAN protocol, and corresponds to data corresponding to the first protocol. The device data is data corresponding to a protocol used for communication between the two in-
The
図2は第1中継機21の要部構成を示すブロック図である。第1中継機21は、ROM(Read Only Memory)31、CPU32、通信部33a,33b、HSM(Hardware Security Module)34、RAM(Random Access Memory)35及び電源回路36を有する。これらは、バス37に接続されている。通信部33a,33b夫々は、バス37の他に、通信線La,Lbに接続されている。RAM35は、バス37の他に、第2中継機22に接続されている。
FIG. 2 is a block diagram showing a main configuration of the
ROM31には、第1制御プログラムP1が記憶されている。CPU32は、第1制御プログラムP1に従って第1中継処理を実行する。第1中継処理は、ECU12a,12a中の1つとECU12b,12b中の1つとの間の通信と、ECU12a,12a,12b,12b中の1つと車載機器13a,13b,13c中の1つとの間の通信とを中継するための処理である。第1制御プログラムP1は第2の制御プログラムに相当し、CPU32は処理部として機能する。更に、CPU32は、第1処理部として機能し、第1処理部を構成するハードウェアである。
The
通信部33aは、ECU12a,12a中の1つから、通信線Laを介してECUデータを受信する。通信部33aは、CPU32の指示に従って、ECUデータを、通信線Laを介して送信する。通信部33aが送信したECUデータは、ECU12a,12aによって受信される。
通信部33bは、ECU12b,12b中の1つから、通信線Lbを介してECUデータを受信する。通信部33bは、CPU32の指示に従って、ECUデータを、通信線Lbを介して送信する。通信部33bが送信したECUデータは、ECU12b,12bによって受信される。
The
The
第2中継機22には第2制御プログラムP2(図3参照)が記憶されている。HSM34は、第1制御プログラムP1が適正であることを検証すると共に、第2制御プログラムP2が適正であることを検証する。HSM34は、第1制御プログラムP1及び第2制御プログラムP2を検証する検証器として機能する。
CPU32、HSM34及び第2中継機22夫々は、RAM35に種々のデータを書き込み、RAM35からデータを読み出す。従って、例えば、第2中継機22がRAM35に書き込んだデータを、CPU32がRAM35から読み出すことができる。
The
Each of the
電源回路36は、図示しない電力線によって、車両100の図示しないバッテリに接続されている。電源回路36は、更に、図示しない電力線によって、ROM31、CPU32、通信部33a,33b、HSM34及びRAM35に接続されている。電源回路36は、バッテリが出力した電圧を所定の第1電圧に変圧する。電源回路36は、第1電圧をROM31、CPU32、通信部33a,33b、HSM34及びRAM35に出力し、これらに電力を供給する。
The
例えば、車両100の図示しないイグニッションスイッチがオンに切替わった場合、電源回路36は、ROM31、CPU32、通信部33a,33b、HSM34及びRAM35に電力を供給し、これらを作動させる。電源回路36は、HSM34の指示に従って、ROM31、CPU32、通信部33a,33b、HSM34及びRAM35への電力供給を停止する。これにより、これらは動作を停止し、RAM35に記憶されているデータは消去される。
For example, when an ignition switch (not shown) of the
HSM34は、ROM41、CPU42及びインタフェース43を有する。これらはバス44に接続されている。インタフェース43は、バス44の他にバス37に接続されている。
The
ROM41には検証プログラムPhが記憶されている。CPU42は、第1中継機21内で検証プログラムPhを実行する。これにより、第1制御プログラムP1及び第2制御プログラムP2が適正であることを検証するための検証処理が実行される。検証プログラムPhは、CPU42に検証処理を実行させるためのコンピュータプログラムである。ROM41には、更に、第1鍵データK1、第1基準データR1、第2鍵データK2及び第2基準データR2が記憶されている。これらは、所定データであり、検証処理で用いられる。ROM41は記憶部及び第2の記憶部として機能する。
CPU42は、第1制御プログラムP1及び第2制御プログラムP2を検証するハードウェアであり、CPU32とは異なっている。
The
The
なお、検証プログラムPhは、コンピュータ(CPU42)が読み取り可能に、記憶媒体E1に記憶されていてもよい。この場合、図示しない読み出し装置によって記憶媒体E1から読み出された検証プログラムPhがHSM34の図示しない記憶部に記憶される。記憶媒体E1は、光ディスク、フレキシブルディスク、磁気ディスク、磁気光ディスク又は半導体メモリ等である。光ディスクは、CD(Compact Disc)−ROM(Read Only Memory)、DVD(Digital Versatile Disc)−ROM、又は、BD(Blu-ray(登録商標) Disc)等である。磁気ディスクは、例えばハードディスクである。また、図示しない通信網に接続されている図示しない外部装置から検証プログラムPhをダウンロードし、検証プログラムPhを前述した記憶部に記憶してもよい。
The verification program Ph may be stored in the storage medium E1 so that the computer (CPU 42) can read it. In this case, the verification program Ph read from the storage medium E1 by a reading device (not shown) is stored in a storage unit (not shown) of the
CPU42は、インタフェース43を介して、第1中継機21のROM31及びRAM35にアクセスする。具体的には、CPU42は、ROM31から第1制御プログラムP1を読み出す。また、CPU42は、RAM35に種々のデータを書き込むと共にRAM35からデータを読み出す。更に、CPU42は、電源回路36に電力供給の停止を指示する。以上のように、インタフェース43は、CPU42がROM31、RAM35及び電源回路36へのアクセスを許可する。一方で、インタフェース43は、CPU32がROM41へアクセスすることを防止する。従って、CPU32は、ROM41に記憶されている内容を読み出すことはできない。
The
電源回路36からHSM34への電力供給が開始された場合、CPU42は検証処理を実行する。CPU42が検証処理を実行している間、第1中継機21のCPU32は動作を停止している。例えば、CPU32は、CPU32の図示しない端子の電圧がハイレベル電圧である場合に作動し、CPU32の端子の電圧がローレベル電圧である場合に動作を停止する。この場合、CPU42が検証処理を実行している間、HSM34によってCPU32の端子の電圧がローレベル電圧に維持される。そして、CPU42が検証処理を終了した場合、HSM34によってCPU32の端子の電圧がハイレベル電圧に切替えられる。
When power supply from the
図3は第2中継機22の要部構成を示すブロック図である。第2中継機22は、ROM51、CPU52、通信部53a,53b,53c及び電源回路54を有する。これらは、バス55に接続されている。バス55は、更に、第1中継機21のRAM35に接続されている。通信部53a,53b,53c夫々は、バス55の他に、車載機器13a,13b,13cに接続されている。
FIG. 3 is a block diagram showing a main configuration of the
ROM51には、起動プログラムPb及び第2制御プログラムP2が記憶されている。CPU52は起動プログラムPbに従って起動処理を実行する。起動処理は、CPU52への電力供給が開始されて、CPU52が作動した後、CPU52によって最初に実行される処理である。
The
また、CPU52は第2制御プログラムP2に従って第2中継処理を実行する。第2中継処理は、車載機器13a,13b,13c中の2つの間の通信と、ECU12a,12a,12b,12b中の1つと車載機器13a,13b,13c中の1つとの間の通信とを中継するための処理である。CPU52は第2処理部として機能する。
Further, the
通信部53a,53b,53c夫々は車載機器13a,13b,13cから機器データを受信する。また、通信部53a,53b,53c夫々は、CPU52の指示に従って、機器データを車載機器13a,13b,13cに送信する。
The
電源回路54は、図示しない電力線によって、車両100のバッテリに接続されている。電源回路54は、更に、図示しない電力線によって、ROM51、CPU52及び通信部53a,53b,53cに接続されている。電源回路54は、バッテリが出力した電圧を所定の第2電圧に変圧する。電源回路54は、所定の第2電圧をROM31、CPU32、通信部33a,33b、HSM34及びRAM35に出力し、これらに電力を供給する。
The
例えば、車両100の図示しないイグニッションスイッチがオンに切替わった場合、電源回路54は、ROM51、CPU52及び通信部53a,53b,53cに電力を供給し、これらを作動させる。電源回路54は、CPU52の指示に従って、ROM51、CPU52及び通信部53a,53b,53cへの電力供給を停止する。これにより、これらは動作を停止する。
For example, when an ignition switch (not shown) of the
起動処理及び第2中継処理夫々において、CPU52は、第1中継機21のRAM35に種々のデータを書き込み、RAM35からデータを読み出す。
In each of the startup process and the second relay process, the
図4は第1中継処理の手順を示すフローチャートである。第1中継機21のCPU32は第1中継処理を周期的に実行する。まず、CPU32は、通信部33a,33b中の1つがECUデータを受信したか否かを判定する(ステップS1)。CPU32は、通信部33a,33b中の1つがECUデータを受信したと判定した場合(S1:YES)、ECUデータを、ECU12a,12a,12b,12b及び車載機器13a,13b,13c中の少なくとも1つに送信すべきか否かを判定する(ステップS2)。
FIG. 4 is a flowchart showing the procedure of the first relay process. The
ROM31には、複数の識別情報が記憶されている。ROM31に記憶されている複数の識別情報中の一又は複数の識別情報夫々には、通信部33a,33b中の1つが対応付けられている。ROM31に記憶されている複数の識別情報中の残りの識別情報夫々には、送信先情報が対応付けられている。送信先情報は、前述したように、車載機器13a,13b,13c中の少なくとも1つを示す。
The
ステップS2では、CPU32は、受信されたECUデータに含まれている識別情報が、ROM31に記憶されている複数の識別情報中の1つである場合、ECUデータを送信すべきと判定する。また、ステップS2では、CPU32は、受信されたECUデータに含まれている識別情報が、ROM31に記憶されて複数の識別情報のいずれとも一致しない場合、ECUデータを送信すべきではないと判定する。
In step S <b> 2, when the identification information included in the received ECU data is one of the plurality of identification information stored in the
CPU32は、ECUデータを送信すべきと判定した場合(S2:YES)、受信されたECUデータを第1中継機21が送信するか否かを判定する(ステップS3)。ここで、CPU32は、ROM31において、受信されたECUデータに含まれている識別情報に、通信部33a,33b中の1つが対応付けられている場合、受信されたECUデータを第1中継機21が送信すると判定する。また、CPU32は、ROM31において、受信されたECUデータに含まれている識別情報に送信先情報が対応付けられている場合、受信されたECUデータを第1中継機21が送信しないと判定する。
When determining that the ECU data should be transmitted (S2: YES), the
CPU32は、受信されたECUデータを第1中継機21が送信すると判定した場合(S3:YES)、通信部33a,33bの中で、受信されたECUデータに含まれている識別情報に対応する通信部に、受信されたECUデータの送信を指示する(ステップS4)。これにより、通信部33a,33bの中で送信を指示された通信部は、受信されたECUデータを送信する。
When it is determined that the
例えば、通信部33aがECU12a,12a中の1つからECUデータを受信した場合において、通信部33aが受信したECUデータに含まれている識別情報が通信部33bに対応付けられているとき、CPU32は、通信部33bに指示して、通信部33aが受信したECUデータを送信させる。このECUデータはECU12b,12bによって受信される。
以上のように、第1中継機21は、ECU12a,12a中の1つと、ECU12b,12b中の1つとの間の通信を中継する。
For example, when the
As described above, the
CPU32は、受信されたECUデータを第1中継機21が送信しない、即ち、受信されたECUデータを第2中継機22が送信すると判定した場合(S3:NO)、受信されたECUデータを機器データに変換する(ステップS5)。ステップS5で変換された機器データには、受信されたECUデータに含まれている識別情報に対応する送信先情報が含まれている。送信先情報は、車載機器13a,13b,13c中の少なくとも1つを示している。次に、CPU32は、ステップS5で変換した機器データをRAM35に書き込む(ステップS6)。前述したように、第2中継機22のCPU52は、この機器データをRAM35から読み出すことができる。
When the
CPU32は、通信部33a,33bのいずれもECUデータを受信していないと判定した場合(S1:NO)、ECUデータを送信すべきではないと判定した場合(S2:NO)、又は、ステップS4,S6の一方を実行した後、通信部33a,33b中の1つが、RAM35に記憶されている機器データを送信すべきか否かを判定する(ステップS7)。ここで、CPU32は、送信先情報がECU12a,12a,12b,12b中の少なくとも1つを示す機器データがRAM35に記憶されている場合、通信部33a,33b中の1つが機器データを送信すべきと判定する。CPU32は、送信先情報がECU12a,12a,12b,12b中の少なくとも1つを示す機器データがRAM35に記憶されていない場合、通信部33a,33b中のいずれも機器データを送信すべきではないと判定する。
The
CPU32は、機器データを送信すべきと判定した場合(S7:YES)、送信すべき機器データをECUデータに変換する(ステップS8)。ステップS8で変換したECUデータには、送信先情報に応じた識別情報が含まれている。例えば、複数の送信先情報夫々に対応付けて識別情報がROM31に記憶されており、送信先情報に応じた識別情報をECUデータに含める。例えば、ECU12a,12a中の1つを示す送信先情報に一の識別情報が対応し、ECU12a,12a中の1つとECU12b,12bの1つとを示す送信先情報に他の識別情報が対応している。CPU32は変換部としても機能する。
When it is determined that the device data should be transmitted (S7: YES), the
次に、CPU32は、通信部33a,33b中の少なくとも1つに、ステップS8で変換したECUデータの送信を指示する(ステップS9)。これにより、通信部33a,33b中の少なくとも1つは、ステップS8でCPU32が変換したECUデータを送信する。例えば、ステップS8で送信先がECU12a,12a中の1つである機器データを変換した場合、CPU32は通信部33aに指示してステップS8で変換したECUデータを送信させる。
Next, the
CPU32は、通信部33a,33bのいずれも機器データを送信すべきではないと判定した場合(S7:NO)、又は、ステップS9を実行した後、第1中継処理を終了する。
When it is determined that neither the
図5は第2中継処理の手順を示すフローチャートである。第2中継機22のCPU52は第2中継処理を周期的に実行する。まず、CPU52は、通信部53a,53b,53c中の1つが機器データを受信したか否かを判定する(ステップS21)。CPU52は、通信部53a,53b,53c中の1つが機器データを受信したと判定した場合(S21:YES)、受信した機器データを車載機器13a,13b,13c中の少なくとも1つに送信すべきか否かを判定する(ステップS22)。
FIG. 5 is a flowchart showing the procedure of the second relay process. The
ここで、CPU52は、受信した機器データに含まれている送信先情報が車載機器13a,13b,13c中の少なくとも1つを示している場合、受信した機器データを車載機器13a,13b,13c中の少なくとも1つに送信すべきと判定する。一方で、CPU52は、受信した機器データに含まれている送信先情報が車載機器13a,13b,13cのいずれも示していない場合、受信した機器データを車載機器13a,13b,13cのいずれにも送信すべきではないと判定する。
Here, when the transmission destination information included in the received device data indicates at least one of the in-
CPU52は、受信した機器データを車載機器13a,13b,13c中の少なくとも1つに送信すべきと判定した場合(S22:YES)、通信部53a,53b,53c中の少なくとも1つに機器データの送信を指示する(ステップS23)。車載機器13a,13b,13c夫々は、通信部53a,53b,53cが対応する。ステップS23では、受信した機器データに含まれている送信先情報が示す送信先に応じて、送信を指示する通信部が決まる。例えば、送信先情報が車載機器13b,13cを示す場合、CPU52は、通信部53b,53c夫々に、受信した機器データの送信を指示する。CPU53がステップS23を実行した場合、通信部53a,53b,53cの中で送信を指示された通信部は機器データを送信する。
When the
例えば、通信部53aが機器データを受信した場合において、通信部53aが受信した機器データに含まれている送信先情報が車載機器13bを示すとき、CPU52は、通信部53bに指示して、通信部53aが受信した機器データを送信させる。
以上のように、第2中継機22は、車載機器13a,13b,13c中の2つの間の通信を中継する。
For example, when the
As described above, the
CPU52は、受信した機器データを車載機器13a,13b,13cのいずれにも送信すべきではない、即ち、受信した機器データをECU12a,12a,12b,12b中の少なくとも1つに送信すべきであると判定した場合(S22:NO)、受信した機器データを第1中継機21のRAM35に書き込む(ステップS24)。
The
CPU52は、通信部53a,53b,53cのいずれも機器データを受信していないと判定した場合(S21:NO)、又は、ステップS23,S24を実行した後、車載機器13a,13b,13c中の少なくとも1つに送信すべき機器データがRAM35に記憶されているか否かを判定する(ステップS25)。ここで、CPU52は、送信先情報が車載機器13a,13b,13c中の少なくとも1つを示す機器データがRAM35に記憶されている場合、送信すべき機器データが記憶されていると判定する。CPU52は、送信先情報が車載機器13a,13b,13c中の少なくとも1つを示す機器データがRAM35に記憶されていない場合、送信すべき機器データが記憶されていないと判定する。
The
CPU52は、送信すべき機器データが記憶されていると判定した場合(S25:YES)、通信部53a,53b,53c中の少なくとも1つに機器データの送信を指示する(ステップS26)。ステップS26では、ステップS23と同様に、送信すべき機器データに含まれている送信先情報が示す送信先に応じて、送信を指示する通信部が決まる。
CPU52は、送信すべき機器データが記憶されていないと判定した場合(S25:NO)、又は、ステップS26を実行した後、第2中継処理を終了する。
When it is determined that device data to be transmitted is stored (S25: YES), the
CPU52 complete | finishes a 2nd relay process, when it determines with the apparatus data which should be transmitted not memorize | stored (S25: NO) or after performing step S26.
以上のように構成された中継装置11では、ECU12a,12a,12b,12b中の1つが送信したECUデータは、機器データに変換され、変換された機器データは、車載機器13a,13b,13c中の少なくとも1つに送信される。また、車載機器13a,13b,13c中の1つが送信した機器データは、ECUデータに変換され、変換されたECUデータは、ECU12a,12a,12b,12b中の少なくとも1つに送信される。
In the
図6は検証処理の手順を示すフローチャートである。第1中継機21が有するHSM34のCPU42は、電源回路54がCPU42への電力供給を開始した場合において、第1中継処理を実行する前に検証処理を実行する。前述したように、CPU42が検証処理を実行している間、CPU32は動作を停止している。検証処理では、まず、CPU42は、第1制御プログラムP1をROM31から読み出す(ステップS31)。次に、CPU42は、第1制御プログラムP1に関連する関連データを演算するための演算データを、例えばハッシュ関数を用いて算出する(ステップS32)。ステップS32では、CPU42は、ステップS31で読み出した制御プログラムP1に基づいて演算データを算出する。
FIG. 6 is a flowchart showing the procedure of the verification process. The
次に、CPU42は、ステップS32で算出した演算データと、ROM41に記憶されている第1鍵データK1とを用いて、第1制御プログラムP1に関連する関連データを演算する(ステップS33)。第1鍵データK1は第2の鍵データに相当し、CPU42は第2の演算部として機能する。
次に、CPU42は、ステップS33で演算した関連データが、ROM41に予め記憶されている第1基準データR1と一致するか否かを判定する(ステップS34)。CPU42は第2の判定部としても機能する。
Next, the
Next, the
CPU42は、ステップS34を実行することによって、第1制御プログラムP1が適正であることを検証する。第1制御プログラムP1に関連する関連データが第1基準データR1と一致していることは、第1制御プログラムP1が適正であることを示す。第1制御プログラムP1に関連する関連データが第1基準データR1と一致していないことは、第1制御プログラムP1が適正ではないこと、即ち、第1制御プログラムP1が改ざんされている可能性が高いことを示す。
The
CPU42は、関連データが第1基準データR1と一致しないと判定した場合(S34:NO)、第2中継機22の電源回路54が行う電力供給の停止を指示する停止データをRAM35に書き込む(ステップS35)。これにより、第2中継機22のCPU52に第1制御プログラムP1が適正ではないことを通知することができる。その後、CPU42は、電源回路36に電力供給の停止を指示する(ステップS36)。これにより、電源回路36は、ROM31、CPU32、通信部33a,33b、HSM34及びRAM35への電力供給を停止し、第1中継機21は動作を停止する。CPU42は、ステップS36を実行した後、検証処理を終了する。
If the
なお、前述したように、電源回路36がRAM35への電力供給を停止した場合、RAM35に記憶されているデータは消去される。第2中継機22のCPU52がRAM35に記憶されている停止データを読み出す時間を確保するため、CPU42は、ステップS35を実行してから、CPU52が停止データを読み出すために十分な所定時間が経過した後、ステップS36を実行する。
As described above, when the
CPU42は、関連データが第1基準データR1と一致すると判定した場合(S34:YES)、第2中継機22の第2制御プログラムP2の演算データがRAM35に記憶されているか否かを判定する(ステップS37)。第2制御プログラムP2の演算データは、第2制御プログラムP2に関連する関連データを演算するためのデータである。CPU42は、演算データが記憶されていないと判定した場合(S37:NO)、ステップS37を再び実行し、演算データがRAM35に書き込まれるまで待機する。第2中継機22のCPU52は、起動処理において、第2制御プログラムP2の演算データを算出し、算出した演算データをRAM35に書き込む。
When determining that the related data matches the first reference data R1 (S34: YES), the
CPU42は、演算データが記憶されていると判定した場合(S37:YES)、RAM35から第2制御プログラムP2の演算データを読み出し(ステップS38)、読み出した演算データと、ROM41に記憶されている第2鍵データK2とを用いて、第2制御プログラムP2に関連する関連データを演算する(ステップS39)。CPU42は演算部及び関連データ演算部としても機能する。
If the
次に、CPU42は、ステップS39で演算した関連データが、ROM41に予め記憶されている第2基準データR2と一致するか否かを判定する(ステップS40)。CPU42は判定部としても機能する。
CPU42は、ステップS40を実行することによって、第2制御プログラムP2が適正であることも検証する。CPU42は、関連データが第2基準データR2と一致していると判定した場合(S40:YES)、第2制御プログラムP2が適正であることを示す正常データをRAM35に書き込む(ステップS41)。これにより、第2中継機22のCPU52に第2制御プログラムP2が適正であることを通知することができる。
Next, the
The
CPU42は、関連データが第2基準データR2と一致していないと判定した場合(S40:NO)、第2制御プログラムP2が適正ではない、即ち、第2制御プログラムP2が改ざんされている可能性が高いことを示す異常データをRAM35に書き込む(ステップS42)。これにより、第2中継機22のCPU52に第2制御プログラムP2が適正ではないことを通知することができる。
When the
CPU42は、ステップS41,S42の一方を実行した後、検証処理を終了する。CPU42は、検証処理を終了した後、電源回路36が電力供給を一旦停止して、電力供給を再開するまで、動作を停止する。CPU42が検証処理を終了した後、CPU32は、適正な第1制御プログラムP1を実行する。なお、前述したように、インタフェース43は、CPU32からROM41へのアクセスを防止している。このため、検証プログラムPh、第1鍵データK1、第1基準データR1、第2鍵データK2及び第2基準データR2がHSM34の外側に持ち出されることはない。
After executing one of steps S41 and S42, the
図7は起動処理の手順を示すフローチャートである。第2中継機22のCPU52は、電源回路54がCPU52への電力供給を開始した場合において、第2中継処理を実行する前に、起動プログラムPbに従って起動処理を実行する。起動処理では、まず、CPU52は、第2制御プログラムP2をROM51から読み出す(ステップS51)。次に、CPU52は、例えばハッシュ関数を用いて、第2制御プログラムP2に関連する関連データを演算するための演算データを算出する(ステップS52)。CPU52は算出部として機能する。ステップS52では、CPU52は、ステップS51で読み出した第2制御プログラムP2に基づいて演算データを算出する。
FIG. 7 is a flowchart showing the procedure of the starting process. When the
次に、CPU52は、ステップS52で算出した演算データを第1中継機21のRAM35に書き込む(ステップS53)。前述したように、第1中継機21が有するHSM34のCPU42は、RAM35に記憶されている演算データを読み出し、読み出した演算データを用いて第2制御プログラムP2に関連する関連データを演算し、第2制御プログラムP2が適正であるか否かを検証する。CPU42は、検証処理において、RAM35に停止データ、異常データ又は正常データを書き込む。
RAM35から関連データを読み出すことは、関連データを取得することに相当する。従って、CPU42は取得部としても機能する。
Next, the
Reading the relevant data from the
なお、第1中継機21の電源回路36と、第2中継機22の電源回路54とは略同時に電力供給を開始し、CPU52は、第1中継機21の電源回路36が電力供給を開始した後、ステップS53を実行する。このため、CPU52は、演算データをRAM35に確実に書き込むことができる。
The
CPU52は、ステップS53を実行した後、停止データが第1中継機21のRAM35に記憶されているか否かを判定する(ステップS54)。CPU52は、停止データが記憶されていないと判定した場合(S54:NO)、異常データがRAM35に記憶されているか否かを判定する(ステップS55)。CPU52は、停止データが記憶されていると判定した場合(S54:YES)、又は、異常データが記憶されていると判定した場合(S55:YES)、電源回路54に電力供給の停止を指示する(ステップS56)。これにより、電源回路54は電力供給を停止し、ROM51、CPU52及び通信部53a,53b,53cは動作を停止する。CPU52は、ステップS56を実行した後、起動処理を終了する。
After executing step S53, the
以上のように、第1中継機21が有するHSM34のCPU42は、RAM35に停止データ又は異常データを書き込むことによって、CPU42の動作、即ち、第2中継機22の動作を停止させる。CPU42は、動作制御部としても機能する。
前述したように、CPU42は、第1制御プログラムP1に関連する関連データが第1基準データR1と一致していないと判定した場合、第1制御プログラムP1が改ざんされている可能性が高いとして、停止データをRAM35に書き込む。
また、CPU42は、第2制御プログラムP2に関連する関連データが第2基準データR2と一致していないと判定した場合、第2制御プログラムP2が改ざんされている可能性が高いとして、異常データをRAM35に書き込む。これにより、第2中継機22の動作が停止する。
As described above, the
As described above, when the
On the other hand, if the
CPU52がステップS55で異常データが記憶されていると判定してステップS56を実行した場合、第1中継機21の電源回路36は電力供給を停止せず、第1中継機21のCPU32は第1中継処理を実行する。このため、第2中継機22の動作は停止するが、ECU12a,12a中の1つと、ECU12b,12b中の1つとの間の通信の中継は、第1中継機21によって行われる。
When the
例えば、ECU12a,12a,12b,12b夫々が車両100の運転に最低限必要な機能を有するヘッドライト又はワイパーモータ等の電気機器を制御し、車載機器13a,13b,13c夫々は、車両100の運転に必ずしも必要でないカメラ又はディスプレイ等であると仮定する。この場合、第1制御プログラムP1が適正であれば、第2制御プログラムP2が適正でなかったとしても、運転者は車両100を運転することができる。
For example, each of the
CPU52は、異常データが記憶されていないと判定した場合(S55:NO)、正常データが第1中継機21のRAM35に記憶されているか否かを判定する(ステップS57)。CPU52は、正常データが記憶されていないと判定した場合(S57:NO)、ステップS54を実行し、RAM35に停止データ、異常データ又は正常データが記憶されるまで待機する。
When determining that abnormal data is not stored (S55: NO), the
なお、CPU52がステップS54を実行する前に、第1中継機21が有するHSM34のCPU42が検証処理のステップS36を実行した場合、RAM35にデータが記憶されていないため、CPU52は、ステップS54,S55,S57の判定を無限に繰り返す。このため、起動処理において、CPU52は、ステップS54,S55,S57の判定を繰り返している時間が第2の所定時間を超えた場合、第1制御プログラムP1が適正ではないとして、ステップS56を実行してもよい。
If the
CPU52は、正常データが記憶されていると判定した場合(S57:YES)、起動処理を終了する。その後、CPU52は、第2中継処理を実行する。
When it is determined that normal data is stored (S57: YES), the
以上のように構成された中継装置11では、第1中継機21が有するHSM34のCPU32が、第2制御プログラムP2が適正であることを検証する。このため、第2中継機22に、検証機能を有するHSM34と同様の構成部を設ける必要がない。結果、中継装置11は小型であり、中継装置11の製造費用は安価である。
In the
また、第2中継機22のCPU52は、第2制御プログラムP2の演算データを算出し、算出した演算データを第1中継機21のRAM35に書き込む。第2制御プログラムP2の演算データのデータ量は、第2制御プログラムP2のデータ量よりも小さい。このため、第2制御プログラムP2が適正であることを検証するために、第2中継機22から第1中継機21へ転送されるデータのデータ量は小さい。結果、検証を行うために必要な時間が短い。
Further, the
(実施の形態2)
図8は、実施の形態2における通信システム1の要部構成を示すブロック図である。
以下では、実施の形態2について、実施の形態1と異なる点を説明する。後述する構成を除く他の構成については、実施の形態1と共通しているため、実施の形態1と共通する構成部には実施の形態1と同一の参照符号を付してその説明を省略する。
(Embodiment 2)
FIG. 8 is a block diagram illustrating a main configuration of the
In the following, the differences between the second embodiment and the first embodiment will be described. Since the configuration other than the configuration described later is the same as that in the first embodiment, the same reference numerals as those in the first embodiment are given to the components common to the first embodiment, and the description thereof is omitted. To do.
実施の形態2における通信システム1では、実施の形態1における通信システム1と比較して、中継装置11の構成が異なる。実施の形態2における中継装置11は、第1中継機21及び第2中継機22に加えて、メモリ23を有する。メモリ23は第2中継機22に接続されている。メモリ23は不揮発性メモリである。メモリ23には、第2制御プログラムP2が記憶されている。第2制御プログラムP2は、第2中継機22によってメモリ23から読み出される。
In the
図9は第2中継機22の要部構成を示すブロック図である。実施の形態2における第2中継機22は、実施の形態1における第2中継機22が有する構成部に加えて、インタフェース61及びRAM62を有する。インタフェース61及びRAM62もバス55に接続されている。インタフェース61は、更に、メモリ23に接続される。
FIG. 9 is a block diagram showing a main configuration of the
CPU52は、インタフェース61を介して、第2制御プログラムP2をメモリ23から読み出す。また、CPU52は、RAM62に種々のデータを書き込み、RAM62からデータを読み出す。
なお、実施の形態2おけるROM51には、第2制御プログラムP2が記憶されていない。
The
Note that the second control program P2 is not stored in the
電源回路54は、ROM51、CPU52及び通信部53a,53b,53cに加えて、インタフェース61及びRAM62に電力を供給する。インタフェース61及びRAM62夫々は、電源回路54から電力が供給されている間、作動する。電源回路54が電力供給を停止した場合、RAM62に記憶されているデータは消去される。
The
図10は起動処理の手順を示すフローチャートである。実施の形態2においても、第2中継機22のCPU52は、電源回路54がCPU52への電力供給を開始した場合において、第2中継処理を実行する前に、起動プログラムPbに従って起動処理を実行する。実施の形態2における起動処理のステップS65〜S68は、実施の形態1における起動処理のステップS54〜S57と同様である。このため、ステップS65〜S68の詳細な説明を省略する。
FIG. 10 is a flowchart showing the procedure of the startup process. Also in the second embodiment, when the
実施の形態2における起動処理では、まず、CPU52は、インタフェース61を介して、メモリ23から、第2制御プログラムP2を読み出し(ステップS61)、読み出した第2制御プログラムP2をRAM62に書き込む(ステップS62)。次に、CPU52は、例えばハッシュ関数を用いて、第2制御プログラムP2に関連する関連データを演算するための演算データを算出する(ステップS63)。
In the startup process according to the second embodiment, first, the
次に、CPU52は、ステップS64で算出した演算データを第1中継機21のRAM35に書き込み(ステップS64)、ステップS65を実行する。
Next, the
実施の形態2と同様に、CPU52は、ステップS68で正常データが第1中継機21のRAM35に記憶されていると判定して起動処理を終了した場合、第2中継機22のRAM62に記憶されている第2制御プログラムP2に従って、第2中継処理を実行する。
以上のように構成された実施の形態2における中継装置11は、実施の形態1における中継装置11が奏する効果と同様の効果を奏する。
As in the second embodiment, when the
The
(実施の形態3)
図11及び図12は、実施の形態3における検証処理の手順を示すフローチャートである。
以下では、実施の形態3について、実施の形態1と異なる点を説明する。後述する構成を除く他の構成については、実施の形態1と共通しているため、実施の形態1と共通する構成部には実施の形態1と同一の参照符号を付してその説明を省略する。
(Embodiment 3)
11 and 12 are flowcharts showing the procedure of the verification process according to the third embodiment.
In the following, the differences between the third embodiment and the first embodiment will be described. Since the configuration other than the configuration described later is the same as that in the first embodiment, the same reference numerals as those in the first embodiment are given to the components common to the first embodiment, and the description thereof is omitted. To do.
実施の形態3における通信システム1では、実施の形態1における通信システム1と比較して、第1中継機21が有するHSM34のCPU42が実行する検証処理の内容と、第2中継機22のCPU52が実行する起動処理の内容とが異なる。
In the
HSM34のCPU42は、実施の形態1と同様に、電源回路54がCPU42への電力供給を開始した場合において、第1中継処理を実行する前に検証処理を実行する。CPU42が検証処理を実行している間、CPU32は動作を停止している。実施の形態3における検証処理のステップS75,S76,S87,S88夫々は、実施の形態1における検証処理のステップS35,S36,S41,S42と同様である。このため、ステップS75,S76,S87,S88の詳細な説明を省略する。
As in the first embodiment, the
実施の形態3における検証処理では、まず、CPU42は、第1制御プログラムP1をROM31から読み出し(ステップS71)、読み出した第1制御プログラムP1に基づいて、第1制御プログラムP1に関連する第1関連データを演算するための第1演算データを算出する(ステップS72)。ステップS72では、CPU42は、例えば、ハッシュ関数を用いて第1演算データを算出する。
In the verification process in the third embodiment, first, the
次に、CPU42は、ステップS72で算出した第1演算データと、ROM41に記憶されている第1鍵データK1とに基づいて、第1制御プログラムP1に関連する第1関連データを演算し(ステップS73)、演算した第1関連データが第1基準データR1と一致するか否かを判定する(ステップS74)。CPU42は、ステップS74を実行することによって、第1制御プログラムP1が適正であることを検証する。第1関連データが第1基準データR1と一致していることは、第1制御プログラムP1が適正であることを示す。第1関連データが第1基準データR1と一致していないことは、第1制御プログラムP1が適正ではないこと、即ち、第1制御プログラムP1が改ざんされている可能性が高いことを示す。
Next, the
CPU42は、第1関連データが第1基準データR1と一致しないと判定した場合(S74:NO)、ステップS75,S76を順次実行する。これにより、電源回路36は、ROM31、CPU32、通信部33a,33b、HSM34及びRAM35への電力供給を停止し、第1中継機21は動作を停止する。CPU42は、ステップS76を実行した後、検証処理を終了する。
If the
CPU42は、第1関連データが第1基準データR1と一致すると判定した場合(S74:YES)、乱数データを生成する(ステップS77)。乱数データは、例えば、「1」又は「0」で表される数値の羅列であり、乱数を示す。ステップS77では、CPU42は、初期値を決定し、決定した初期値に基づいて乱数データを生成する。CPU42は、例えば、ステップS77が実行された時刻に基づいて初期値を決定する。この場合においては、ステップS77が実行される時刻が異なったとき、ステップS77で生成される乱数データの内容は変更される。時刻には、年月日も含まれている。
When it is determined that the first related data matches the first reference data R1 (S74: YES), the
前述したように、電源回路54がCPU42への電力供給を開始する都度、検証処理は実行される。繰り返し実行される検証処理において、ステップS77が実行される時刻は相互に異なる。このため、これらの時刻に基づいて決定される初期値も相互に異なる。結果、ステップS77が実行された時刻に基づいて初期値が決定される場合、ステップS77で生成される乱数データの内容は、過去のステップS77で生成された乱数データの内容のいずれとも異なる。CPU42は乱数生成部としても機能する。
As described above, each time the
次に、CPU42は、ステップS77で生成した乱数データをRAM35に書き込む(ステップS78)。実施の形態3における起動処理では、第2中継機22のCPU52は、ステップS78で書き込まれた乱数データと、第2制御プログラムP2とに基づいて、第2制御プログラムP2に関連する第2関連データを演算するための第2演算データを算出し、算出した第2演算データをRAM35に書き込む。
Next, the
HSM34のCPU42は、ステップS78を実行した後、第2演算データがRAM35に記憶されているか否かを判定する(ステップS79)。CPU42は、第2演算データが記憶されていないと判定した場合(S79:NO)、ステップS79を再び実行し、第2中継機22のCPU52が第2演算データをRAM35に書き込むまで待機する。
After executing Step S78, the
CPU42は、第2演算データが記憶されていると判定した場合(S79:YES)、RAM35から第2演算データを読み出し(ステップS80)、読み出した第2演算データと、ROM41に記憶されている第2鍵データK2とに基づいて、第2関連データを演算する(ステップS81)。
When the
次に、CPU42は、ROM41から第2基準データR2を読み出し(ステップS82)、読み出した第2基準データR2と、ステップS77で生成した乱数データとを合成することによって、第1合成データを生成する(ステップS83)。ステップS83では、CPU42は、例えば、第2基準データR2の最後尾に乱数データを加えることによって第1合成データを生成する。次に、CPU42は、ステップS83で生成した第1合成データに基づいて、第1中間データを算出する(ステップS84)。ステップS84では、CPU42は、例えば、ハッシュ関数を用いて第1中間データを算出する。
Next, the
次に、CPU42は、ステップS84で算出した第1中間データと、ROM41に記憶されている第2鍵データK2とに基づいて、第3基準データを演算する(ステップS85)。
以上のように、CPU42は、乱数データ、第2基準データR2及び第2鍵データK2に基づいて第3基準データを演算する。CPU42は基準データ演算部として機能する。
Next, the
As described above, the
次に、CPU42は、ステップS81で演算した第2関連データが、ステップS86で演算した第3基準データと一致するか否かを判定する(ステップS86)。CPU42は、ステップS86を実行することによって、第2制御プログラムP2が適正であることも検証する。CPU42は、第2関連データが第3基準データと一致すると判定した場合(S86:YES)、第2制御プログラムP2は適正であるとして、ステップS87を実行する。CPU42は、第2関連データが第3基準データと一致しないと判定した場合(S86:NO)、第2制御プログラムP2は適正ではない、即ち、第2制御プログラムP2が改ざんされている可能性が高いとして、ステップS88を実行する。CPU42は、ステップS87,S88の一方を実行した後、検証処理を終了する。HSM34のCPU42は、検証処理を終了した後、電源回路36が電力供給を一旦停止して、電力供給を再開するまで、動作を停止する。CPU42が検証処理を終了した後、CPU32は、適正な第1制御プログラムP1を実行する。
Next, the
図13は起動処理の手順を示すフローチャートである。第2中継機22のCPU52は、実施の形態1と同様に、電源回路54がCPU52への電力供給を開始した場合において、第2中継処理を実行する前に、起動プログラムPbに従って起動処理を実行する。起動処理では、まず、CPU52は、停止データがRAM35に記憶されているか否かを判定する(ステップS91)。CPU52は、停止データが記憶されていないと判定した場合(S91:NO)、乱数データがRAM35に記憶されているか否かを判定する(ステップS92)。
FIG. 13 is a flowchart showing the procedure of the startup process. As in the first embodiment, the
CPU52は、乱数データが記憶されていないと判定した場合(S92:NO)、ステップS91を実行し、HSM34のCPU42が停止データ又は乱数データをRAM35に書き込むまで待機する。
なお、CPU52がステップS91を実行する前に、HSM34のCPU42が検証処理のステップS76を実行した場合、RAM35にデータが記憶されていないため、CPU52は、ステップS91,S92の判定を無限に繰り返す。このため、起動処理において、CPU52は、ステップS91,S92の判定を繰り返している時間が第3の所定時間を超えた場合、第1制御プログラムP1が適正ではないとして、ステップS99を実行してもよい。
If it is determined that random number data is not stored (S92: NO), the
In addition, when CPU42 of HSM34 performs step S76 of a verification process before CPU52 performs step S91, since data is not memorize | stored in RAM35, CPU52 repeats the determination of step S91, S92 infinitely. For this reason, in the startup process, the
CPU52は、乱数データが記憶されていると判定した場合(S92:YES)、第2制御プログラムP2をROM51から読み出し(ステップS93)、読み出した第2制御プログラムP2に基づいて第2中間データを算出する(ステップS94)。ステップS94では、CPU52は、例えば、ハッシュ関数を用いて第2中間データを算出する。
When it is determined that random number data is stored (S92: YES), the
次に、CPU52は、ステップS94で算出した第2中間データと、RAM35に記憶されている乱数データとを合成することによって、第2合成データを生成する(ステップS95)。ステップS95では、CPU52は、例えば、第2中間データの最後尾に乱数データを加えることによって第2合成データを生成する。次に、CPU52は、ステップS95で生成した第2合成データに基づいて、第2関連データを演算するための第2演算データを算出する(ステップS96)。ステップS96では、CPU52は、例えば、ハッシュ関数を用いて第2演算データを算出する。
以上のように、CPU52は第2制御プログラムP2、乱数データ及び第2鍵データK2に基づいて第2演算データを算出する。
Next, the
As described above, the
次に、CPU52は、ステップS96で算出した第2演算データをRAM35に書き込む(ステップS97)。前述したように、HSM34のCPU42は、RAM35に記憶されている第2演算データを読み出し、読み出した第2演算データに基づいて第2関連データを演算し、第2制御プログラムP2が適正であるか否かを検証する。CPU42は、検証結果に基づいて、正常データ又は異常データをRAM35に書き込む。
Next, the
CPU52は、ステップS97を実行した後、異常データがRAM35に記憶されているか否かを判定する(ステップS98)。CPU52は、停止データが記憶されていると判定した場合(S91:YES)、又は、異常データが記憶されていると判定した場合(S98:YES)、電源回路54に電力供給の停止を指示する(ステップS99)。これにより、電源回路54は電力供給を停止し、ROM51、CPU52及び通信部53a,53b,53cは動作を停止する。CPU52は、ステップS99を実行した後、起動処理を終了する。
After executing step S97, the
以上のように、HSM34のCPU42は、RAM35に停止データ又は異常データを書き込むことによって、CPU42の動作、即ち、第2中継機22の動作を停止させる。
前述したように、CPU42は、第1制御プログラムP1に関連する第1関連データが第1基準データR1と一致していないと判定した場合、第1制御プログラムP1が改ざんされている可能性が高いとして、停止データをRAM35に書き込む。
また、CPU42は、第2制御プログラムP2に関連する第2関連データが第3基準データと一致していないと判定した場合、第2制御プログラムP2が改ざんされている可能性が高いとして、異常データをRAM35に書き込む。これにより、第2中継機22の動作が停止する。
As described above, the
As described above, when the
On the other hand, if the
CPU52がステップS98で異常データが記憶されていると判定してステップS99を実行した場合、第1中継機21の電源回路36は電力供給を停止せず、第1中継機21のCPU32は第1中継処理を実行する。このため、第2中継機22の動作は停止するが、ECU12a,12a中の1つと、ECU12b,12b中の1つとの間の通信の中継は、第1中継機21によって行われる。
When the
CPU52は、異常データが記憶されていないと判定した場合(S98:NO)、正常データがRAM35に記憶されているか否かを判定する(ステップS100)。CPU52は、正常データが記憶されていないと判定した場合(S100:NO)、ステップS98を実行し、HSM34のCPU42が正常データ又は異常データをRAM35に書き込むまで待機する。CPU52は、正常データが記憶されていると判定した場合(S100:YES)、起動処理を終了する。その後、CPU52は、第2中継処理を実行する。
When determining that abnormal data is not stored (S98: NO), the
図14は、第2制御プログラムP2の検証の説明図である。前述したように、第2中継機22のCPU52は、第2制御プログラムP2に基づいて第2中間データを算出する。次に、CPU52は、算出した第2中間データと、HSM34のCPU42が生成した乱数データとを合成することによって、第2合成データを生成する。CPU52は、生成した第2合成データに基づいて、第2演算データを算出し、算出した第2演算データを第1中継機21のRAM35に書き込む。
FIG. 14 is an explanatory diagram of verification of the second control program P2. As described above, the
HSM34のCPU42は、RAM35に記憶されている第2演算データと、第2鍵データK2とに基づいて第2関連データを演算する。
また、CPU42は、第2基準データR2と乱数データとを合成することによって、第1合成データを生成する。CPU42は、生成した第1合成データに基づいて、第1中間データを算出する。CPU42は、算出した第1中間データと、第2鍵データK2とに基づいて、第3基準データを演算する。CPU42は、第2関連データが第3演算データに一致するか否かを判定することによって、第2制御プログラムP2を検証する。
The
Further, the
第2中間データと乱数データとを合成することによって、第2合成データを生成する方法は、第2基準データと乱数データとを合成することによって、第1合成データを生成する方法と同じである。第2合成データに基づいて第2演算データを算出する方法は、第1合成データに基づいて第1中間データを算出する方法と同じである。第2演算データと、第2鍵データK2とに基づいて第2関連データを演算する方法は、第1中間データと、第2鍵データK2とに基づいて第3基準データを演算する方法と同じである。 The method of generating the second combined data by combining the second intermediate data and the random number data is the same as the method of generating the first combined data by combining the second reference data and the random number data. . The method of calculating the second calculation data based on the second composite data is the same as the method of calculating the first intermediate data based on the first composite data. The method of calculating the second related data based on the second calculation data and the second key data K2 is the same as the method of calculating the third reference data based on the first intermediate data and the second key data K2. It is.
第2制御プログラムP2が適正である場合、第2基準データR2は第2中間データと一致する。この場合、第2合成データ、第2演算データ及び第2関連データ夫々は、第1合成データ、第1中間データ及び第3基準データに一致し、正常データがRAM35に書き込まれる。
前述したように、検証処理が実行される都度、乱数データの内容は変更される。このため、今回の検証処理において、前回の検証処理で算出された第2演算データをRAM35に書き込んだ場合、第2関連データは第3基準データと一致しないので、第2制御プログラムP2が適正ではないと判定される。
When the second control program P2 is appropriate, the second reference data R2 matches the second intermediate data. In this case, the second composite data, the second calculation data, and the second related data are identical to the first composite data, the first intermediate data, and the third reference data, and normal data is written into the
As described above, every time the verification process is executed, the content of the random number data is changed. For this reason, in the current verification process, when the second calculation data calculated in the previous verification process is written in the
第2制御プログラムP2を改ざんする方法として、以下の方法が考えられる。過去の検証処理において算出された演算データを記憶した上で、第2制御プログラムP2を改ざんし、その後の検証処理では、記憶されている演算データをRAM35に書き込む。実施の形態3における中継装置において、この方法が用いられた場合であっても、第2制御プログラムP2の改ざんが検出されるので、第2制御プログラムP2の検証結果の信頼性が高い。
The following method can be considered as a method of falsifying the second control program P2. After the calculation data calculated in the past verification process is stored, the second control program P2 is falsified, and in the subsequent verification process, the stored calculation data is written in the
また、HSM34のCPU42は、第2鍵データK2、乱数データ及び第2基準データR2に基づいて第3基準データを演算すると共に、第2中継機22のCPU52は、第2演算データと第2鍵データK2とに基づいて第2関連データを演算するので、第2制御プログラムP2の検証結果の信頼性はより高い。
Further, the
以上のように構成された中継装置11では、第1中継機21が有するHSM34のCPU32が、第2制御プログラムP2を検証する。このため、第2中継機22が、第2制御プログラムP2の検証機能を有する必要がないので、中継装置11は小型であり、中継装置11の製造費用は安価である。
In the
また、第2中継機22のCPU52は、第2制御プログラムP2の第2演算データを算出し、算出した第2演算データを第1中継機21のRAM35に書き込む。第2演算データのデータ量は、第2制御プログラムP2のデータ量よりも小さい。このため、第2制御プログラムP2が適正であることを検証するために、第2中継機22から第1中継機21へ転送されるデータのデータ量は小さい。結果、検証を行うために必要な時間が短い。
また、実施の形態3における中継装置11は、実施の形態1における中継装置11が奏する効果を同様に奏する。
The
Moreover, the
なお、実施の形態2において、第2中継機22のCPU52は、実施の形態3における起動処理を実行してもよい。この場合、起動処理では、CPU52は、ステップS93の代わりに、実施の形態2におけるステップS61,S62を実行する。ステップS94では、ステップS61で読み出した第2制御プログラムP2に基づいて第2中間データを算出する。
In the second embodiment, the
(実施の形態4)
実施の形態3における中継装置11では、HSM34のCPU42は第1鍵データK1に基づいて第1関連データを演算し、第2鍵データK2に基づいて第2関連データ及び第3基準データを演算している。しかしながら、CPU42は、第1鍵データK1,K2に基づく演算を行わなくてもよい。
以下では、実施の形態4について、実施の形態3と異なる点を説明する。後述する構成を除く他の構成については、実施の形態3と共通しているため、実施の形態3と共通する構成部には実施の形態3と同一の参照符号を付してその説明を省略する。
(Embodiment 4)
In the
Hereinafter, the differences between the fourth embodiment and the third embodiment will be described. Since the configuration other than the configuration described later is the same as that of the third embodiment, the same reference numerals as those of the third embodiment are assigned to the same components as those of the third embodiment, and the description thereof is omitted. To do.
実施の形態4における通信システム1では、実施の形態3における通信システム1と比較して、第1中継機21が有するHSM34のCPU42が実行する検証処理の内容と、第2中継機22のCPU52が実行する起動処理の内容とが異なる。
In the
図15及び図16は、実施の形態4における検証処理の手順を示すフローチャートである。HSM34のCPU42は、実施の形態3と同様に、電源回路54がCPU42への電力供給を開始した場合において、第1中継処理を実行する前に検証処理を実行する。CPU42が検証処理を実行している間、CPU32は動作を停止している。実施の形態4における検証処理のステップS111,S113〜S117,S119,S120,S124,S125夫々は、実施の形態3における検証処理のステップS71,S74〜S78,S82,S83,S87,S88と同様である。このため、ステップS111,S113〜S117,S119,S120,S124,S125の詳細な説明を省略する。
15 and 16 are flowcharts showing the procedure of the verification process in the fourth embodiment. Similarly to the third embodiment, the
検証処理において、HSM34のCPU42は、ステップS111を実行した後、ステップS111で読み出した第1制御プログラムP1に基づいて、第1制御プログラムP1に関連する第1関連データを演算する(ステップS112)。ステップS112では、CPU42は、例えば、ハッシュ関数を用いて第1関連データを演算する。CPU42は、ステップS112を実行した後、ステップS113を実行する。
In the verification process, after executing Step S111, the
ステップS117では、CPU42は、実施の形態3と同様に、乱数データをRAM35に書き込む。実施の形態4における起動処理では、第2中継機22のCPU52は、ステップS117で書き込まれた乱数データと、第2制御プログラムP2とに基づいて、第2制御プログラムP2に関連する第2関連データを演算し、演算した第2関連データをRAM35に書き込む。
In step S117, the
CPU42は、ステップS117を実行した後、第2関連データがRAM35に記憶されているか否かを判定する(ステップS118)。CPU42は、第2関連データが記憶されていないと判定した場合(S118:NO)、ステップS118を再び実行し、第2中継機22のCPU52が第2関連データをRAM35に書き込むまで待機する。
After executing step S117, the
CPU42は、第2関連データが記憶されていると判定した場合(S118:YES)、ステップS119,S120を実行する。次に、CPU42は、ステップS120で生成した第1合成データに基づいて、第3基準データを演算する(ステップS121)。ステップS121では、CPU42は、例えば、ハッシュ関数を用いて第3基準データを演算する。
以上のように、CPU42は、乱数データ及び第2基準データR2に基づいて第3基準データを演算する。
CPU42 performs step S119, S120, when it determines with 2nd relevant data being memorize | stored (S118: YES). Next, the
As described above, the
次に、CPU42は、RAM35から第2関連データを読み出す(ステップS122)。これにより、CPU42は、第2中継機22のCPU52が演算した第2関連データを取得する。次に、CPU42は、ステップS122で読み出した第2関連データが、ステップS121で演算した第3基準データと一致するか否かを判定する(ステップS123)。CPU42は、ステップS123を実行することによって、第2制御プログラムP2が適正であることも検証する。
Next, the
CPU42は、第2関連データが第3基準データと一致すると判定した場合(S123:YES)、第2制御プログラムP2は適正であるとして、ステップS124を実行する。CPU42は、第2関連データが第3基準データと一致しないと判定した場合(S123:NO)、第2制御プログラムP2は適正ではない、即ち、第2制御プログラムP2が改ざんされている可能性が高いとして、ステップS125を実行する。CPU42は、ステップS124,S125の一方を実行した後、検証処理を終了する。HSM34のCPU42は、検証処理を終了した後、電源回路36が電力供給を一旦停止して、電力供給を再開するまで、動作を停止する。CPU42が検証処理を終了した後、CPU32は、適正な第1制御プログラムP1を実行する。
When the
図17は起動処理の手順を示すフローチャートである。第2中継機22のCPU52は、実施の形態3と同様に、電源回路54がCPU52への電力供給を開始した場合において、第2中継処理を実行する前に、起動プログラムPbに従って起動処理を実行する。実施の形態4における起動処理のステップS131〜S135,S138〜S140夫々は、ステップS91〜S95,S98〜S100と同様である。このため、ステップS131〜S135,S138〜S140の詳細な説明を省略する。
FIG. 17 is a flowchart showing the procedure of the starting process. As in the third embodiment, the
起動処理では、第2中継機22のCPU52は、ステップS135を実行した後、ステップS135で生成した第2合成データに基づいて、第2関連データを演算する(ステップS136)。ステップS136では、CPU52は、例えば、ハッシュ関数を用いて第2関連データを演算する。
以上のように、CPU52は第2制御プログラムP2及び乱数データに基づいて第2演算データを算出する。実施の形態4においては、HSM34のCPU42ではなく、第2中継機22のCPU52が関連データ演算部として機能する。
In the activation process, the
As described above, the
次に、CPU52は、ステップS136で演算した第2関連データをRAM35に書き込み(ステップS137)、ステップS138を実行する。
Next, the
図18は、第2制御プログラムP2の検証の説明図である。実施の形態3と同様に、第2中継機22のCPU52は、第2制御プログラムP2に基づいて第2中間データを算出する。次に、CPU52は、算出した第2中間データと、HSM34のCPU42が生成した乱数データとを合成することによって、第2合成データを生成する。CPU52は、生成した第2合成データに基づいて、第2関連データを演算し、演算した第2関連データを第1中継機21のRAM35に書き込む。
FIG. 18 is an explanatory diagram of the verification of the second control program P2. As in the third embodiment, the
HSM34のCPU42は、実施の形態3と同様に、第2基準データR2と、乱数データとを合成することによって、第1合成データを生成する。CPU42は、生成した第1合成データに基づいて、第3基準データを演算する。CPU42は、第2中継機22のCPU52が演算した第2関連データが、第3基準データに一致するか否かを判定することによって、第2制御プログラムP2を検証する。
As in the third embodiment, the
第2中間データと乱数データとを合成することによって、第2合成データを生成する方法は、第2基準データと乱数データとを合成することによって、第1合成データを生成する方法と同じである。第2合成データに基づいて第2関連データを演算する方法は、第1合成データに基づいて第3基準データを演算する方法と同じである。 The method of generating the second combined data by combining the second intermediate data and the random number data is the same as the method of generating the first combined data by combining the second reference data and the random number data. . The method of calculating the second related data based on the second composite data is the same as the method of calculating the third reference data based on the first composite data.
第2制御プログラムP2が適正である場合、第2基準データR2は第2中間データと一致する。この場合、第2合成データ及び第2関連データ夫々は、第1合成データ及び第3基準データに一致し、正常データがRAM35に書き込まれる。
前述したように、検証処理が実行される都度、乱数データの内容は変更される。このため、検証処理が実行される都度、RAM35から読み出す第2関連データは変更される。今回の起動処理において、前回の起動処理で演算された第2関連データをRAM35に書き込んだ場合、第2関連データは第3基準データと一致しないので、第2制御プログラムP2が適正ではないと判定される。結果、実施の形態3と同様に、第2制御プログラムP2の検証結果の信頼性が高い。
When the second control program P2 is appropriate, the second reference data R2 matches the second intermediate data. In this case, the second combined data and the second related data respectively match the first combined data and the third reference data, and normal data is written in the
As described above, every time the verification process is executed, the content of the random number data is changed. For this reason, every time the verification process is executed, the second related data read from the
実施の形態4における検証処理及び起動処理では、第1鍵データK1及び第2鍵データK2が用いられることはない。このため、HSM34のROM41に第1鍵データK1及び第2鍵データK2が記憶されている必要はない。
In the verification process and the activation process in the fourth embodiment, the first key data K1 and the second key data K2 are not used. For this reason, it is not necessary to store the first key data K1 and the second key data K2 in the
また、第2中継機22のCPU52は、第2制御プログラムP2に関連する第2関連データを演算し、演算した第2関連データを第1中継機21のRAM35に書き込む。第2関連データのデータ量は、第2制御プログラムP2のデータ量よりも小さい。このため、第2制御プログラムP2が適正であることを検証するために、第2中継機22から第1中継機21へ転送されるデータのデータ量は小さい。結果、検証を行うために必要な時間が短い。
実施の形態4における中継装置11は、実施の形態3における中継装置11が奏する効果の中で、演算データの算出することによって得られる効果と、第2鍵データK2に基づいて第3基準データを演算することによって得られる効果を除く他の効果を同様に奏する。
Further, the
The
なお、実施の形態2において、第2中継機22のCPU52は、実施の形態4における起動処理を実行してもよい。この場合、起動処理では、CPU52は、ステップS133の代わりに、実施の形態2におけるステップS61,S62を実行し、HSM34のROM41に第1鍵データK1及び第2鍵データK2が記憶されている必要はない。ステップS134では、ステップS61で読み出した第2制御プログラムP2に基づいて第2中間データを算出する。
In the second embodiment, the
また、実施の形態3において、第2中間データ及び乱数データを合成することによって生成される第2合成データに基づいて算出される第2演算データが、第2制御プログラムP2及び乱数データを合成することによって生成されるデータに基づいて算出されるデータと同一である場合、第2中間データの算出を省略してもよい。この場合、第2中継機22のCPU52は、起動処理において、第2制御プログラムP2と乱数データとに基づいて第2合成データを生成する。
In the third embodiment, the second calculation data calculated based on the second synthesized data generated by synthesizing the second intermediate data and the random number data synthesizes the second control program P2 and the random number data. If the data is the same as the data calculated based on the data generated by this, the calculation of the second intermediate data may be omitted. In this case, the
同様に、実施の形態4において、第2中間データ及び乱数データを合成することによって生成される第2合成データに基づいて演算される第2関連データが、第2制御プログラムP2及び乱数データを合成することによって生成されるデータに基づいて算出されるデータと同一である場合、第2中間データの算出を省略してもよい。この場合、第2中継機22のCPU52は、起動処理において、第2制御プログラムP2と乱数データとに基づいて第2合成データを生成する。
Similarly, in the fourth embodiment, the second related data calculated based on the second synthesized data generated by synthesizing the second intermediate data and the random number data synthesizes the second control program P2 and the random number data. When the data is the same as the data calculated based on the data generated by doing so, the calculation of the second intermediate data may be omitted. In this case, the
また、実施の形態1〜4において、第2中継機22の動作を停止させる構成は、第2中継機22の電源回路54に電力供給を停止させる構成に限定されず、例えば、バッテリと電源回路54とを接続する電力線の中途に設けられたスイッチをオフにする構成であってもよい。この場合、スイッチがオフされた場合、電源回路54は動作を停止する。これにより、電源回路54は電力供給を停止する。
Moreover, in Embodiment 1-4, the structure which stops operation | movement of the
同様に、第1中継機21の動作を停止させる構成は、第1中継機21の電源回路36に電力供給を停止させる構成に限定されず、例えば、バッテリと電源回路36とを接続する電力線の中途に設けられたスイッチをオフにする構成であってもよい。この場合、スイッチがオフされた場合、電源回路36は動作を停止する。これにより、電源回路36は電力供給を停止する。
更に、第1中継機21が有するHSM34のCPU42によって、第2制御プログラムP2が適正ではないと判定された場合、第2中継機22の動作だけではなく、第1中継機21の動作を停止させてもよい。
Similarly, the configuration for stopping the operation of the
Furthermore, when the
また、第1中継機21が中継する通信で用いられる通信プロトコルはCANプロトコルに限定されない。更に、第1中継機21が中継する通信で用いられる通信プロトコルは、第2中継機21が中継する通信で用いられる通信プロトコルと同一であってもよい。
Further, the communication protocol used in the communication relayed by the
また、実施の形態1,2,3において、第2制御プログラムP2の演算データ又は第2演算データは、第2中継機22のCPU52ではなく、第1中継機21が有するHSM34のCPU42によって算出されてもよい。この場合、第2中継機22のCPU52は、起動処理で第2制御プログラムP2を第1中継機21のRAM35に書き込む。
In the first, second, and third embodiments, the calculation data or the second calculation data of the second control program P2 is calculated not by the
また、実施の形態1〜4において、第1中継機21に接続される通信線の数は、2に限定されず、3以上であってもよい。更に、各通信線に接続されるECUの数は2に限定されず、1又は3以上であってもよい。また、各通信線に接続されるECUの数は、他の通信線に接続されているECUの数と異なっていてもよい。複数のECUが車載機器13a,13b,13cと同様に第1中継機21に直接に接続されていてもよい。
In the first to fourth embodiments, the number of communication lines connected to the
また、第2中継機22に接続される車載機器の数は、3に限定されず、2又は4以上であってもよい。更に、第2中継機22に複数の通信線が接続され、各通信線に一又は複数の車載機器が接続されてもよい。この場合、第2中継機22は、一の通信線に接続されている1つの車載機器と、他の通信線に接続されている1つの車載機器との通信を中継する。
また、ECUデータから機器データへの変換、及び、機器データからECUデータへの変換は、第2中継機22のCPU52が行ってもよい。
Further, the number of in-vehicle devices connected to the
Further, the conversion from the ECU data to the device data and the conversion from the device data to the ECU data may be performed by the
開示された実施の形態1〜4はすべての点で例示であって、制限的なものではないと考えられるべきである。本発明の範囲は、上述した意味ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。 The disclosed first to fourth embodiments are examples in all respects and should be considered not to be restrictive. The scope of the present invention is defined by the terms of the claims, rather than the meanings described above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
11 中継装置(車載装置)
12a,12b ECU(第1通信装置)
13a,13b,13c 車載機器(第2通信装置)
21 第1中継機(第1車載機)
22 第2中継機(第2車載機)
32 CPU(第1処理部、処理部、変換部)
34 HSM(検証器)
41 ROM(記憶部、第2の記憶部)
42 CPU(関連データ演算部、判定部、乱数生成部、基準データ演算部、動作制御部、演算部、第2の演算部、第2の判定部、取得部)
52 CPU(第2処理部、関連データ演算部、算出部)
100 車両
K1 鍵データ(第2の鍵データ)
K2 鍵データ
P1 第1制御プログラム(第2の制御プログラム)
P2 第2制御プログラム
Ph 検証プログラム
11 Relay device (on-vehicle device)
12a, 12b ECU (first communication device)
13a, 13b, 13c In-vehicle device (second communication device)
21 First repeater (first in-vehicle device)
22 Second repeater (second in-vehicle device)
32 CPU (first processing unit, processing unit, conversion unit)
34 HSM (Verifier)
41 ROM (storage unit, second storage unit)
42 CPU (related data calculation unit, determination unit, random number generation unit, reference data calculation unit, operation control unit, calculation unit, second calculation unit, second determination unit, acquisition unit)
52 CPU (second processing unit, related data calculation unit, calculation unit)
100 vehicle K1 key data (second key data)
K2 key data P1 first control program (second control program)
P2 Second control program Ph verification program
図6は検証処理の手順を示すフローチャートである。第1中継機21が有するHSM34のCPU42は、電源回路54がCPU42への電力供給を開始した場合において、第1中継処理を実行する前に検証処理を実行する。前述したように、CPU42が検証処理を実行している間、CPU32は動作を停止している。検証処理では、まず、CPU42は、第1制御プログラムP1をROM31から読み出す(ステップS31)。次に、CPU42は、第1制御プログラムP1に関連する関連データを演算するための演算データを、例えばハッシュ関数を用いて算出する(ステップS32)。ステップS32では、CPU42は、ステップS31で読み出した第1制御プログラムP1に基づいて演算データを算出する。
FIG. 6 is a flowchart showing the procedure of the verification process. The
実施の形態1と同様に、CPU52は、ステップS68で正常データが第1中継機21のRAM35に記憶されていると判定して起動処理を終了した場合、第2中継機22のRAM62に記憶されている第2制御プログラムP2に従って、第2中継処理を実行する。
以上のように構成された実施の形態2における中継装置11は、実施の形態1における中継装置11が奏する効果と同様の効果を奏する。
Similar to the first embodiment,
The
次に、CPU42は、ステップS81で演算した第2関連データが、ステップS85で演算した第3基準データと一致するか否かを判定する(ステップS86)。CPU42は、ステップS86を実行することによって、第2制御プログラムP2が適正であることも検証する。CPU42は、第2関連データが第3基準データと一致すると判定した場合(S86:YES)、第2制御プログラムP2は適正であるとして、ステップS87を実行する。CPU42は、第2関連データが第3基準データと一致しないと判定した場合(S86:NO)、第2制御プログラムP2は適正ではない、即ち、第2制御プログラムP2が改ざんされている可能性が高いとして、ステップS88を実行する。CPU42は、ステップS87,S88の一方を実行した後、検証処理を終了する。HSM34のCPU42は、検証処理を終了した後、電源回路36が電力供給を一旦停止して、電力供給を再開するまで、動作を停止する。CPU42が検証処理を終了した後、CPU32は、適正な第1制御プログラムP1を実行する。
Next, the
HSM34のCPU42は、RAM35に記憶されている第2演算データと、第2鍵データK2とに基づいて第2関連データを演算する。
また、CPU42は、第2基準データR2と乱数データとを合成することによって、第1合成データを生成する。CPU42は、生成した第1合成データに基づいて、第1中間データを算出する。CPU42は、算出した第1中間データと、第2鍵データK2とに基づいて、第3基準データを演算する。CPU42は、第2関連データが第3基準データに一致するか否かを判定することによって、第2制御プログラムP2を検証する。
The
Further, the
(実施の形態4)
実施の形態3における中継装置11では、HSM34のCPU42は第1鍵データK1に基づいて第1関連データを演算し、第2鍵データK2に基づいて第2関連データ及び第3基準データを演算している。しかしながら、CPU42は、第1鍵データK1及び第2鍵データK2に基づく演算を行わなくてもよい。
以下では、実施の形態4について、実施の形態3と異なる点を説明する。後述する構成を除く他の構成については、実施の形態3と共通しているため、実施の形態3と共通する構成部には実施の形態3と同一の参照符号を付してその説明を省略する。
(Embodiment 4)
In the
Hereinafter, the differences between the fourth embodiment and the third embodiment will be described. Since the configuration other than the configuration described later is the same as that of the third embodiment, the same reference numerals as those of the third embodiment are assigned to the same components as those of the third embodiment, and the description thereof is omitted. To do.
また、第1中継機21が中継する通信で用いられる通信プロトコルはCANプロトコルに限定されない。更に、第1中継機21が中継する通信で用いられる通信プロトコルは、第2中継機22が中継する通信で用いられる通信プロトコルと同一であってもよい。
Further, the communication protocol used in the communication relayed by the
11 中継装置(車載装置)
12a,12b ECU(第1通信装置)
13a,13b,13c 車載機器(第2通信装置)
21 第1中継機(第1車載機)
22 第2中継機(第2車載機)
32 CPU(第1処理部、処理部、変換部)
34 HSM(検証器)
41 ROM(記憶部、第2の記憶部)
42 CPU(関連データ演算部、判定部、乱数生成部、基準データ演算部、動作制御部、演算部、第2の演算部、第2の判定部、取得部)
52 CPU(第2処理部、関連データ演算部、算出部)
100 車両
K1 第1鍵データ(第2の鍵データ)
K2 第2鍵データ
P1 第1制御プログラム(第2の制御プログラム)
P2 第2制御プログラム
Ph 検証プログラム
11 Relay device (on-vehicle device)
12a, 12b ECU (first communication device)
13a, 13b, 13c In-vehicle device (second communication device)
21 First repeater (first in-vehicle device)
22 Second repeater (second in-vehicle device)
32 CPU (first processing unit, processing unit, conversion unit)
34 HSM (Verifier)
41 ROM (storage unit, second storage unit)
42 CPU (related data calculation unit, determination unit, random number generation unit, reference data calculation unit, operation control unit, calculation unit, second calculation unit, second determination unit, acquisition unit)
52 CPU (second processing unit, related data calculation unit, calculation unit)
100 vehicle K1 first key data (second key data)
K2 second key data P1 first control program (second control program)
P2 Second control program Ph verification program
Claims (14)
第2制御プログラムに従って処理を実行する第2処理部を有する第2車載機と、
前記第2制御プログラムに関連する関連データを演算する関連データ演算部と
を備え、
前記検証器は、前記関連データ演算部が演算した関連データが基準データと一致するか否かを判定する判定部を有すること
を特徴とする車載装置。 A first in-vehicle device comprising: a first processing unit that executes processing according to a first control program; and a verifier that verifies the first control program using other hardware different from the hardware constituting the first processing unit In-vehicle device comprising:
A second in-vehicle device having a second processing unit for executing processing according to the second control program;
A related data calculation unit for calculating related data related to the second control program,
The in-vehicle device, wherein the verifier includes a determination unit that determines whether or not the related data calculated by the related data calculation unit matches reference data.
を特徴とする請求項1に記載の車載装置。 The in-vehicle device according to claim 1, wherein the first control program is verified by the verification device when the other hardware executes the verification program.
前記関連データ演算部と、
乱数データを生成する乱数生成部と、
該乱数生成部が生成した乱数データ、及び、所定データに基づいて、前記基準データを演算する基準データ演算部と
を有し、
前記第2車載機は、前記第2制御プログラム及び乱数データに基づいて、前記関連データを演算するための演算データを算出する算出部を有し、
前記検証器の前記関連データ演算部は、前記算出部が算出した演算データに基づいて前記関連データを演算すること
を特徴とする請求項1又は請求項2に記載の車載装置。 The verifier of the first in-vehicle device is
The related data calculation unit;
A random number generator for generating random number data;
A random number data generated by the random number generation unit, and a reference data calculation unit that calculates the reference data based on predetermined data;
The second vehicle-mounted device has a calculation unit that calculates calculation data for calculating the related data based on the second control program and random number data,
The in-vehicle device according to claim 1, wherein the related data calculation unit of the verifier calculates the related data based on the calculation data calculated by the calculation unit.
前記基準データ演算部は、該記憶部に記憶されている鍵データと、前記乱数データと、前記所定データとに基づいて前記基準データを演算し、
前記関連データ演算部は、前記演算データ及び鍵データに基づいて前記関連データを演算すること
を特徴とする請求項3に記載の車載装置。 The verifier of the first vehicle-mounted device has a storage unit in which key data is stored,
The reference data calculation unit calculates the reference data based on the key data stored in the storage unit, the random number data, and the predetermined data,
The in-vehicle device according to claim 3, wherein the related data calculation unit calculates the related data based on the calculation data and key data.
乱数データを生成する乱数生成部と、
該乱数生成部が生成した乱数データ、及び、所定データに基づいて、前記基準データを演算する基準データ演算部と
を有し、
前記第2車載機は前記関連データ演算部を有し、
該関連データ演算部は、前記第2制御プログラム及び乱数データに基づいて前記関連データを演算すること
を特徴とする請求項1又は請求項2に記載の車載装置。 The verifier of the first in-vehicle device is
A random number generator for generating random number data;
A random number data generated by the random number generation unit, and a reference data calculation unit that calculates the reference data based on predetermined data;
The second in-vehicle device has the related data calculation unit,
The in-vehicle device according to claim 1, wherein the related data calculation unit calculates the related data based on the second control program and random number data.
を特徴とする請求項1から請求項5のいずれか1つに記載の車載装置。 The operation control unit that stops the operation of the second onboard device when the determination unit of the verifier determines that the related data does not match the reference data. The in-vehicle device according to claim 5.
前記第1中継機は、
鍵データが記憶されている記憶部と、
該鍵データを用いて、前記第2中継機の前記制御プログラムに関連する関連データを演算する演算部と、
該演算部が演算した関連データが所定データと一致するか否かを判定する判定部と
を有することを特徴とする中継装置。 A first relay that relays communication between a plurality of first communication devices; and a second relay that executes processing according to a control program and relays communication between the plurality of second communication devices. The machine and the second relay machine are vehicle relay devices that relay communication between the first communication device and the second communication device,
The first repeater is
A storage unit storing key data; and
A calculation unit that calculates related data related to the control program of the second relay using the key data;
And a determination unit that determines whether or not the related data calculated by the calculation unit matches predetermined data.
を特徴とする請求項7に記載の中継装置。 The operation control unit for stopping the operation of the second repeater when the determination unit of the first repeater determines that the related data does not match the predetermined data. 8. The relay device according to 7.
前記第1中継機は、該算出部が算出した演算データを取得する取得部を有し、
前記第1中継機の前記演算部は、前記鍵データと、該取得部が取得した演算データとを用いて前記関連データを演算すること
を特徴とする請求項7又は請求項8に記載の中継装置。 The second relay has a calculation unit for calculating calculation data for calculating the related data,
The first repeater has an acquisition unit that acquires calculation data calculated by the calculation unit;
The relay according to claim 7 or 8, wherein the calculation unit of the first repeater calculates the related data using the key data and the calculation data acquired by the acquisition unit. apparatus.
第2の制御プログラムに従って処理を実行する処理部と、
第2の鍵データが記憶されている第2の記憶部と、
該第2の鍵データを用いて、前記第2の制御プログラムに関連する第2の関連データを演算する第2の演算部と、
該第2の演算部が演算した第2の関連データが第2の所定データと一致するか否かを判定する第2の判定部と
を有することを特徴とする請求項7から請求項9のいずれか1つに記載の中継装置。 The first repeater is
A processing unit that executes processing according to the second control program;
A second storage unit storing second key data;
A second computing unit that computes second related data related to the second control program using the second key data;
The second determination unit that determines whether or not the second related data calculated by the second calculation unit matches the second predetermined data. The relay apparatus as described in any one.
を特徴とする請求項7から請求項10のいずれか1つに記載の中継装置。 Data corresponding to the first protocol used in communication between the plurality of first communication devices is converted into data corresponding to the second protocol used in communication between the plurality of second communication devices, and the second protocol is supported The relay device according to claim 7, further comprising: a conversion unit that converts data to be converted into data corresponding to the first protocol.
前記第2制御プログラムに関連する関連データを演算し、
演算した関連データが基準データと一致しているか否かを判定する
処理をコンピュータに実行させることを特徴とするコンピュータプログラム。 A first in-vehicle device comprising: a first processing unit that executes processing according to a first control program; and a verifier that verifies the first control program using other hardware different from the hardware constituting the first processing unit And a computer program executed by the verifier of the in-vehicle device comprising a second in-vehicle device that executes processing according to the second control program,
Calculating related data related to the second control program;
A computer program for causing a computer to execute a process of determining whether or not the calculated related data matches the reference data.
前記第2制御プログラムに関連する関連データを取得し、
取得した関連データが基準データと一致しているか否かを判定する
処理をコンピュータに実行させることを特徴とするコンピュータプログラム。 A first in-vehicle device comprising: a first processing unit that executes processing according to a first control program; and a verifier that verifies the first control program using other hardware different from the hardware constituting the first processing unit And a computer program executed by the verifier of the in-vehicle device comprising a second in-vehicle device that executes processing according to the second control program,
Obtaining related data relating to the second control program;
A computer program that causes a computer to execute a process of determining whether or not acquired related data matches reference data.
予め記憶されている鍵データを用いて、前記第2中継機の前記制御プログラムに関連する関連データを演算し、
演算した関連データが所定データと一致するか否かを判定する
処理をコンピュータに実行させることを特徴とするコンピュータプログラム。 A first relay that relays communication between a plurality of first communication devices; and a second relay that executes processing according to a control program and relays communication between the plurality of second communication devices. The machine and the second relay machine are computer programs executed by the first relay machine in the vehicle relay device that relays communication between the first communication device and the second communication device,
Using the key data stored in advance, calculate related data related to the control program of the second repeater,
A computer program for causing a computer to execute a process of determining whether or not the calculated related data matches predetermined data.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711420384.2A CN108337228B (en) | 2017-01-13 | 2017-12-25 | In-vehicle device, relay device, and medium |
US15/863,024 US10469129B2 (en) | 2017-01-13 | 2018-01-05 | Vehicle-mounted apparatus, relay apparatus and computer program |
DE102018100756.6A DE102018100756B4 (en) | 2017-01-13 | 2018-01-15 | ON-VEHICLE DEVICE, TRANSFER DEVICE AND COMPUTER PROGRAM |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017004524 | 2017-01-13 | ||
JP2017004524 | 2017-01-13 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018116669A true JP2018116669A (en) | 2018-07-26 |
JP6443482B2 JP6443482B2 (en) | 2018-12-26 |
Family
ID=62985585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017068330A Active JP6443482B2 (en) | 2017-01-13 | 2017-03-30 | In-vehicle device, relay device, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6443482B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021100527A1 (en) * | 2019-11-19 | 2021-05-27 | 日立Astemo株式会社 | Electronic control device, and computation method |
CN114128157A (en) * | 2019-08-02 | 2022-03-01 | 株式会社自动网络技术研究所 | In-vehicle relay device, in-vehicle communication system, communication program, and communication method |
KR20220080562A (en) | 2020-12-07 | 2022-06-14 | 현대오토에버 주식회사 | Security apparatus for plurality of vehicle controller and external invasion detection method thereof |
KR20230076523A (en) | 2021-11-24 | 2023-05-31 | 현대오토에버 주식회사 | Method for detecting malicious external intrusion into vehicle and apparatus thereof |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008174098A (en) * | 2007-01-18 | 2008-07-31 | Toyota Motor Corp | Control system for vehicle |
JP2010011400A (en) * | 2008-06-30 | 2010-01-14 | National Institute Of Advanced Industrial & Technology | Cipher communication system of common key system |
JP2013219710A (en) * | 2012-04-12 | 2013-10-24 | Toyota Motor Corp | Authentication system of on-vehicle control device and authentication method of on-vehicle control device |
JP2015225376A (en) * | 2014-05-26 | 2015-12-14 | Kddi株式会社 | Computer system, computer, semiconductor device, information processing method, and computer program |
WO2017006862A1 (en) * | 2015-07-03 | 2017-01-12 | Kddi株式会社 | Software distribution processing device, vehicle, software distribution processing method, and computer program |
WO2017047462A1 (en) * | 2015-09-14 | 2017-03-23 | 株式会社オートネットワーク技術研究所 | Communication system |
-
2017
- 2017-03-30 JP JP2017068330A patent/JP6443482B2/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008174098A (en) * | 2007-01-18 | 2008-07-31 | Toyota Motor Corp | Control system for vehicle |
US20100070106A1 (en) * | 2007-01-18 | 2010-03-18 | Keisuke Okamoto | Vehicle control system |
JP2010011400A (en) * | 2008-06-30 | 2010-01-14 | National Institute Of Advanced Industrial & Technology | Cipher communication system of common key system |
JP2013219710A (en) * | 2012-04-12 | 2013-10-24 | Toyota Motor Corp | Authentication system of on-vehicle control device and authentication method of on-vehicle control device |
JP2015225376A (en) * | 2014-05-26 | 2015-12-14 | Kddi株式会社 | Computer system, computer, semiconductor device, information processing method, and computer program |
WO2017006862A1 (en) * | 2015-07-03 | 2017-01-12 | Kddi株式会社 | Software distribution processing device, vehicle, software distribution processing method, and computer program |
WO2017047462A1 (en) * | 2015-09-14 | 2017-03-23 | 株式会社オートネットワーク技術研究所 | Communication system |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114128157A (en) * | 2019-08-02 | 2022-03-01 | 株式会社自动网络技术研究所 | In-vehicle relay device, in-vehicle communication system, communication program, and communication method |
WO2021100527A1 (en) * | 2019-11-19 | 2021-05-27 | 日立Astemo株式会社 | Electronic control device, and computation method |
JP2021082002A (en) * | 2019-11-19 | 2021-05-27 | 日立Astemo株式会社 | Electronic control device and calculation method |
JP7373366B2 (en) | 2019-11-19 | 2023-11-02 | 日立Astemo株式会社 | Electronic control device, calculation method |
KR20220080562A (en) | 2020-12-07 | 2022-06-14 | 현대오토에버 주식회사 | Security apparatus for plurality of vehicle controller and external invasion detection method thereof |
KR20230076523A (en) | 2021-11-24 | 2023-05-31 | 현대오토에버 주식회사 | Method for detecting malicious external intrusion into vehicle and apparatus thereof |
Also Published As
Publication number | Publication date |
---|---|
JP6443482B2 (en) | 2018-12-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6443482B2 (en) | In-vehicle device, relay device, and computer program | |
US10049232B2 (en) | Rewrite detection system, rewrite detection device and information processing device | |
WO2016002559A1 (en) | Communication system and key information sharing method | |
US11567748B2 (en) | Interface device having updatable firmware, mobile device, and firmware update method | |
KR20190115325A (en) | Electronic apparatus and method for diagnosing of vehicle | |
CN108337228B (en) | In-vehicle device, relay device, and medium | |
JP2018095066A (en) | On-vehicle power supply system, relay box, and relay control device | |
CN105159707A (en) | Secure financial terminal firmware programming method and financial terminal | |
JP2006073527A (en) | Smart battery pack and battery type discriminating method using it | |
JP5286659B2 (en) | In-vehicle device relay system, in-vehicle device relay method, and relay device | |
JP6342281B2 (en) | Rewrite detection system and information processing apparatus | |
CN107078806A (en) | Optical transceiver apparatus and method | |
JP2009134497A (en) | Reprogramming system for non-volatile memory of in-vehicle control unit | |
US9128831B2 (en) | Electrical device and method of setting address | |
JP4042790B2 (en) | Electrical device and method for determining normal communication function in electrical device | |
JP2017168907A (en) | Communication system | |
JP2013112120A (en) | In-vehicle communication system | |
US20220377068A1 (en) | Vehicle control device, vehicle, vehicle control method, and non-transitory recording medium | |
EP2026505A2 (en) | Communication method for connection device, program for performing said communication method and connection device | |
WO2018135300A1 (en) | Communication device and communication controller | |
JP2018088165A5 (en) | ||
WO2018225461A1 (en) | Processing device and computer program | |
KR20140072933A (en) | Method of storing vehicle identification number, apparatus performing the same and system perfroming the same | |
WO2021111925A1 (en) | Vehicle-mounted system, vehicle-mounted information registration device, and information registration method | |
JP2008045436A (en) | Program rewriting system for electronic control device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180810 |
|
A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20180911 |
|
A975 | Report on accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A971005 Effective date: 20181024 |
|
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: 20181030 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20181112 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6443482 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |