KR20200020645A - Method, system and computer program for updating firmware of ecu - Google Patents

Method, system and computer program for updating firmware of ecu Download PDF

Info

Publication number
KR20200020645A
KR20200020645A KR1020190100540A KR20190100540A KR20200020645A KR 20200020645 A KR20200020645 A KR 20200020645A KR 1020190100540 A KR1020190100540 A KR 1020190100540A KR 20190100540 A KR20190100540 A KR 20190100540A KR 20200020645 A KR20200020645 A KR 20200020645A
Authority
KR
South Korea
Prior art keywords
firmware
electronic controller
server
new firmware
certificate
Prior art date
Application number
KR1020190100540A
Other languages
Korean (ko)
Other versions
KR102254146B1 (en
Inventor
홍석민
Original Assignee
주식회사 페스카로
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 주식회사 페스카로 filed Critical 주식회사 페스카로
Publication of KR20200020645A publication Critical patent/KR20200020645A/en
Application granted granted Critical
Publication of KR102254146B1 publication Critical patent/KR102254146B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/572Secure firmware programming, e.g. of basic input output system [BIOS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

According to one embodiment of the present invention, provided is a system for updating firmware of an electric control unit. The firmware update system of an electric control unit comprises: a central gateway which receives new firmware containing a digital signature from a server; and an electric control unit which updates existing firmware based on the new firmware. The electric control unit comprises a flash memory which writes data of the new firmware by a divided page unit; and a hardware security module which verifies a digital signature in parallel based on a certificate when the data of the new firmware is written in the flash memory by the divided page unit. The present invention performs a digital signature verification based on a certificate by using HSM containing the root certificate, thereby safely updating firmware.

Description

전자식 제어기의 펌웨어 업데이트 방법, 시스템 및 프로그램{METHOD, SYSTEM AND COMPUTER PROGRAM FOR UPDATING FIRMWARE OF ECU}Firmware update method, system and program of electronic controller {METHOD, SYSTEM AND COMPUTER PROGRAM FOR UPDATING FIRMWARE OF ECU}

본 발명은 전자식 제어기의 펌웨어 업데이트 방법, 시스템 및 프로그램에 관한 것으로, 보다 상세하게는 인증서 기반 전자서명 검증 및 검증의 병렬 처리를 통해 안전하고 빠르게 펌웨어를 업데이트할 수 있는 방법, 시스템 및 프로그램에 관한 것이다.The present invention relates to a firmware update method, system, and program for an electronic controller, and more particularly, to a method, system, and program for safely and quickly updating firmware through parallel processing of certificate-based digital signature verification and verification. .

차량은 사람 또는 화물을 운송할 목적으로 차륜을 구동시켜 주행하는 기기로, 도로 위를 주행하는 것이 주 역할이다. 또한, 차량은 기본적인 주행 기능 외에도 오디오 기능, 비디오 기능, 길 안내 기능(내비게이션 기능), 공조 기능, 시트 열선 기능, 외부의 사용자용 단말기와의 통신 기능 등 사용자 편의를 위한 부가적인 기능을 더 수행한다.A vehicle is a device driven by driving wheels for the purpose of transporting people or cargo, and its main role is to drive on a road. In addition to the basic driving functions, the vehicle performs additional functions for user convenience, such as audio functions, video functions, road guidance functions (navigation functions), air conditioning functions, seat heating functions, and communication functions with external user terminals. .

이러한 차량에는 주행을 위한 전자 장치뿐만 아니라, 운전자 및 탑승자의 안전을 위한 여러 가지 안전 기능을 수행하는 전자 장치들이 마련될 수 있다. 여기서 다수의 전자장치들은 상호 유기적으로 작동될 수 있다. 외부의 네트워크와도 연결될 수 있다. 최근, 차량에 다양한 전자 장치가 탑재됨에 따라, 이러한 전자 장비의 제어를 위한 다수의 ECU(Electronic Control Unit)들이 차량에 탑재되고 있는 추세이다.Such vehicles may be provided with electronic devices that perform various safety functions for safety of drivers and passengers, as well as electronic devices for driving. Here, the plurality of electronic devices may operate with each other organically. It can also be connected to external networks. Recently, as various electronic devices are mounted in a vehicle, a plurality of ECUs (Electronic Control Units) for controlling such electronic equipment have been installed in a vehicle.

본 발명은 루트 인증서가 포함된 HSM 을 이용하여 인증서 기반의 전자서명 검증을 수행하는 것을 일 목적으로 한다.An object of the present invention is to perform certificate-based digital signature verification using the HSM containing a root certificate.

또한, 본 발명은 펌웨어를 쓰기 처리할 때 전자서명 검증도 병렬적으로 수행하는 것을 다른 목적으로 한다. Another object of the present invention is to perform digital signature verification in parallel when writing and writing firmware.

본 발명의 일 실시예에 따르면, 전자식 제어기(Electric Control Unit)의 펌웨어 업데이트 시스템으로서, 상기 시스템은, 서버로부터 전자서명이 포함된 신규 펌웨어를 수신하는 센트럴 게이트웨이; 및 상기 신규 펌웨어에 기초하여 기존의 펌웨어를 업데이트하는 전자식 제어기를 포함하고, 상기 전자식 제어기는, 상기 신규 펌웨어의 데이터를 분할된 페이지 단위로 쓰기(write) 처리하는 플래시 메모리; 및 상기 분할된 페이지 단위로 상기 플래시 메모리에 신규 펌웨어 데이터가 쓰기 처리 될 때, 병렬적으로 인증서에 기반하여 전자서명을 검증하는 하드웨어기반 보안 모듈(Hardware Security Module)을 포함하는 전자식 제어기의 펌웨어 업데이트 시스템이 제공된다.According to an embodiment of the present invention, there is provided a firmware update system of an electric control unit, the system comprising: a central gateway for receiving new firmware including an electronic signature from a server; And an electronic controller for updating the existing firmware based on the new firmware, wherein the electronic controller comprises: a flash memory which writes data of the new firmware in divided page units; And a hardware-based security module (Hardware Security Module) for verifying the electronic signature based on the certificate in parallel when the new firmware data is written to the flash memory in units of the divided pages. This is provided.

본 발명에 있어서, 상기 센트럴 게이트웨이는 블록 단위로 분할된 상기 신규 펌웨어를 수신하고, 하나의 블록을 페이지 단위로 분할하여 각 페이지들을 상기 전자식 제어기로 전송할 수 있다.In the present invention, the central gateway may receive the new firmware divided into block units, divide one block into page units, and transmit each page to the electronic controller.

본 발명에 있어서, 상기 전자서명을 검증하는 것은, 상기 페이지 단위로 해시함수 결과값을 증분한 최종 해쉬값과, 상기 전달받은 전자 서명을 인증서의 공개키를 이용하여 복호화한 값이 동일한지 여부를 확인하는 것일 수 있다.In the present invention, verifying the digital signature includes determining whether a final hash value obtained by incrementing a hash function result value in units of pages and a value obtained by decrypting the received electronic signature using a public key of a certificate are the same. It may be to confirm.

본 발명에 있어서, 상기 센트럴 게이트웨이는 차량 외부 통신망을 통해 상기 서버로부터 상기 신규 펌웨어를 제공받고, 차량 내부 통신망을 통해 상기 신규 펌웨어를 상기 전자식 제어기로 제공할 수 있다.In the present invention, the central gateway may be provided with the new firmware from the server through the vehicle external communication network, and may provide the new firmware to the electronic controller through the vehicle internal communication network.

본 발명에 있어서, 상기 전자식 제어기는, 상기 센트럴 게이트웨이로부터 수신한 상기 신규 펌웨어를 분할된 페이지 단위로 기록하는 RAM; 을 더 포함할 수 있다.In the present invention, the electronic controller, RAM for recording the new firmware received from the central gateway in divided page units; It may further include.

본 발명에 있어서, 상기 하드웨어기반 보안 모듈은, 내부에 제조시부터 저장된 루트 인증서를 포함하고, 상기 루트 인증서를 이용하여 상기 서버로부터 전달받은 전자서명용 인증서의 유효성을 확인할 수 있다.In the present invention, the hardware-based security module, including a root certificate stored from the manufacturing time therein, it is possible to check the validity of the certificate for the electronic signature received from the server using the root certificate.

본 발명에 있어서, 상기 신규 펌웨어는 서버와 상기 전자식 제어기 간 합의된 비밀키에 의해 암호화된 펌웨어로서, 상기 합의된 비밀키는 상기 전자식 제어기가 생성한 난수 기반 비밀키를 상기 서버의 공개키를 이용하여 암호화하고 상기 서버의 개인키를 이용하여 복호화한 것일 수 있다.In the present invention, the new firmware is firmware encrypted by a secret key agreed between a server and the electronic controller, wherein the agreed secret key uses a random number based secret key generated by the electronic controller using the public key of the server. By encrypting and decrypting using the private key of the server.

본 발명에 있어서, 상기 전자서명의 검증에 실패한 경우, 상기 플래시 메모리에 쓰기된 신규 펌웨어 데이터의 해당 블록 단위가 모두 삭제될 수 있다.In the present invention, when the verification of the electronic signature fails, all corresponding block units of new firmware data written to the flash memory may be deleted.

본 발명의 일 실시예에 따르면, 전자식 제어기(Electric Control Unit)의 펌웨어 업데이트 방법으로서, 상기 방법은, 센트럴 게이트웨이에 의해 서버로부터 전자서명이 포함된 신규 펌웨어를 수신하는 단계; 플래시 메모리에 의해 상기 신규 펌웨어의 데이터를 분할된 페이지 단위로 쓰기(write) 처리하는 단계; 상기 분할된 페이지 단위로 상기 플래시 메모리에 신규 펌웨어 데이터가 쓰기 처리 될 때, 하드웨어 기반 보안 모듈에 의해, 병렬적으로 인증서에 기반하여 전자서명을 검증하는 단계; 를 포함하는 전자식 제어기의 펌웨어 업데이트 방법이 제공된다.According to an embodiment of the present invention, there is provided a method of updating a firmware of an electric control unit, the method comprising: receiving new firmware including an electronic signature from a server by a central gateway; Writing data of the new firmware in divided page units by a flash memory; Verifying, by the hardware-based security module, the digital signature based on the certificate in parallel, when the new firmware data is written to the flash memory in the divided page unit; A firmware update method for an electronic controller is provided.

본 발명에 따른 방법을 실행하기 위해 컴퓨터 판독 가능한 기록 매체에 기록된 컴퓨터 프로그램이 제공된다.A computer program recorded on a computer readable recording medium for carrying out the method according to the present invention is provided.

본 발명에 의하면, 루트 인증서가 포함된 HSM 을 이용하여 인증서 기반의 전자서명 검증을 수행함으로써, 펌웨어를 안전하게 업데이트할 수 있다.According to the present invention, by performing certificate-based digital signature verification using the HSM including the root certificate, it is possible to safely update the firmware.

또한, 본 발명은 펌웨어를 쓰기 처리할 때 전자서명 검증도 병렬적으로 수행함으로써, 펌웨어를 신속하게 업데이트할 수 있다.In addition, the present invention can update the firmware quickly by performing digital signature verification in parallel when writing the firmware.

도 1 은 본 발명의 일 실시예에 따른 차량 내부 및 외부의 네트워크 환경을 예시한 것이다.
도 2 는 본 발명의 일 실시예에 따른 ECU의 내부 구성을 나타낸 것이다.
도 3 은 본 발명의 일 실시예에 따른 펌웨어 업데이트 과정을 나타낸 것이다.
도 4 는 본 발명의 일 실시예에 따른 전자서명 검증을 설명하기 위한 도면이다.
도 5 는 본 발명의 일 실시예에 따른 파이프라인 형태의 페이지 단위 신규 펌웨어 업데이트 과정을 설명하기 위한 것이다.
도 6 은 본 발명의 일 실시예에 따른 암호화된 신규 펌웨어를 전송하는 예시를 나타낸 것이다.
1 illustrates a network environment inside and outside a vehicle according to an embodiment of the present invention.
2 shows an internal configuration of an ECU according to an embodiment of the present invention.
3 shows a firmware update process according to an embodiment of the present invention.
4 is a view for explaining digital signature verification according to an embodiment of the present invention.
FIG. 5 illustrates a process of updating a new page-based firmware in a pipeline form according to an embodiment of the present invention.
6 illustrates an example of transmitting encrypted new firmware according to an embodiment of the present invention.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이러한 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 본 명세서에 기재되어 있는 특정 형상, 구조 및 특성은 본 발명의 정신과 범위를 벗어나지 않으면서 일 실시예로부터 다른 실시예로 변경되어 구현될 수 있다. 또한, 각각의 실시예 내의 개별 구성요소의 위치 또는 배치도 본 발명의 정신과 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 행하여지는 것이 아니며, 본 발명의 범위는 특허청구범위의 청구항들이 청구하는 범위 및 그와 균등한 모든 범위를 포괄하는 것으로 받아들여져야 한다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 구성요소를 나타낸다.DETAILED DESCRIPTION OF THE INVENTION The following detailed description of the invention refers to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It is to be understood that the various embodiments of the invention are different but need not be mutually exclusive. For example, certain shapes, structures, and characteristics described herein may be implemented with changes from one embodiment to another without departing from the spirit and scope of the invention. In addition, it is to be understood that the location or arrangement of individual components within each embodiment may be changed without departing from the spirit and scope of the invention. Accordingly, the following detailed description is not to be taken in a limiting sense, and the scope of the present invention should be taken as encompassing the scope of the claims of the claims and all equivalents thereof. Like reference numerals in the drawings indicate the same or similar elements throughout the several aspects.

도 1 은 본 발명의 일 실시예에 따른 차량 내부 및 외부의 네트워크 환경을 예시한 것이다.1 illustrates a network environment inside and outside a vehicle according to an embodiment of the present invention.

도 1 에 도시된 바와 같이, 차량(10) 내부는 센트럴 게이트웨이(Central Gateway, 이하 CGW)(200), 내부 통신망(11) 및 복수개의 ECU(101, 102, 103,...)가 존재할 수 있다. ECU(전자식 제어기, Electric Control Unit)란 차량 내부에 포함된 차량의 엔진, 변속기, 에어백, 조향장치 뿐만 아니라 각종 센서와 같은 전장 장치들의 제어를 위한 전자 제어 유닛이다. 즉, ECU는 차량에서 사용되는 전자 제어 유닛으로서, 그 예로서 ECU 1(101)은 엔진 제어 유닛(Engine Control Unit)이고, ECU 2(102)는 에어백 제어 유닛(ACU, Airbag Control Unit)이며, ECU 3(103)는 편의 제어 유닛(CCU, Convenience Control Unit)일 수 있다. 더불어, 본 발명에 따른 ECU는 차량의 ECU라 기재되더라도, 차량 뿐만 아니라 건설중장비(굴삭기, 지게차, 도자, 로더 등), 농업장비(트랙터 등), 드론 등에 탑재되는 모든 전자식 제어기를 의미할 수 있다. 이하의 본 명세서에서는 차량 내부의 각 ECU 들을 통칭하여 ECU(100)라 기재하기로 한다.본 발명의 ECU(100)들은 하드웨어를 제어하는 마이크로프로그램으로서 펌웨어를 포함할 수 있다. 이때, 펌웨어는 ECU(100)의 MCU(Micro Control Unit) 자체를 제어하는 펌웨어를 의미할 수도 있고, 후술하는 HSM의 펌웨어를 의미할 수도 있다. ECU(100)에 포함된 펌웨어는 필요에 따라 업데이트가 수행될 수 있으며, 본 발명에 따른 ECU(100)의 펌웨어 업데이트는 유선 뿐만 아니라 무선 펌웨어 업데이트에도 적용될 수 있다. 즉, 본 발명은 빠르고 안전하게 ECU(100)의 유선 또는 무선으로 펌웨어를 업데이트하는 것을 일 목적으로 한다.As shown in FIG. 1, the inside of the vehicle 10 may include a central gateway (CGW) 200, an internal communication network 11, and a plurality of ECUs 101, 102, 103,... have. An ECU (Electric Control Unit) is an electronic control unit for controlling electronic devices such as engines, transmissions, airbags, steering devices as well as various sensors of a vehicle included in a vehicle. That is, ECU is an electronic control unit used in a vehicle, for example ECU 1 (101) is an engine control unit (Engine Control Unit), ECU 2 (102) is an airbag control unit (ACU), The ECU 3 103 may be a convenience control unit (CCU). In addition, although the ECU according to the present invention is described as an ECU of a vehicle, it may mean all electronic controllers mounted on not only the vehicle but also heavy equipment (excavator, forklift, pottery, loader, etc.), agricultural equipment (tractor, etc.), drones, and the like. . Hereinafter, each ECU in the vehicle will be collectively referred to as an ECU 100. The ECUs 100 of the present invention may include firmware as a microprogram that controls hardware. In this case, the firmware may mean firmware for controlling the MCU (Micro Control Unit) itself of the ECU 100, or may refer to the firmware of the HSM to be described later. The firmware included in the ECU 100 may be updated as necessary, and the firmware update of the ECU 100 according to the present invention may be applied to a wireless firmware update as well as a wire. That is, an object of the present invention is to update firmware by wire or wireless of the ECU 100 quickly and safely.

본 발명의 일 실시예에 따르면 각 ECU(100)들은 내부 통신망(11)을 통해 CGW(200)와 연결될 수 있다. 이때, 차량의 내부 통신망(11)은 CAN(Controller Area Network), LIN(Local Interconnect Network), MOST(Media Oriented System Transport), Ethernet 등과 같은 차량 내 유무선 통신망일 수 있다.According to an embodiment of the present invention, each ECU 100 may be connected to the CGW 200 through the internal communication network 11. In this case, the internal communication network 11 of the vehicle may be an in-vehicle wired or wireless communication network such as a controller area network (CAN), a local interconnect network (LIN), a media oriented system transport (MOST), or an Ethernet.

또한, 차량(10)의 CGW(200)는 외부 통신망(12)을 통해 서버(300)와 연결될 수 있다. 본 명세서에서 서버(300)는 펌웨어 업데이트 데이터를 전달하는 서비스 서버 또는 백엔드 서버를 의미할 수 있다. 도 1 에서는 비록 서버(300)가 단일 구성으로 도시되었지만, 펌웨어 업데이트 데이터를 제공하는 서버(300)는 복수개 존재할 수 있으며, 각 ECU(100)마다 각기 다른 서버로부터 신규 펌웨어(펌웨어 업데이트)를 수신할 수도 있다. 본 발명의 일 실시예에 따르면, 차량 내 ECU(100)는 서버(300)로부터 신규 펌웨어를 전달받아 펌웨어를 업데이트할 수 있다.In addition, the CGW 200 of the vehicle 10 may be connected to the server 300 through the external communication network 12. In this specification, the server 300 may refer to a service server or a back-end server that delivers firmware update data. In FIG. 1, although the server 300 is illustrated in a single configuration, there may be a plurality of servers 300 providing firmware update data, and each ECU 100 may receive new firmware (firmware update) from different servers. It may be. According to an embodiment of the present invention, the ECU 100 in the vehicle may receive new firmware from the server 300 and update the firmware.

그러나, 인터넷에 직접적으로 연결되어 자동으로 업데이트 될 수 있는 다른 장치(예를 들어, 스마트폰)의 펌웨어와 달리, ECU(100)의 펌웨어는 자동 업데이트가 불가능하다. 이는, 차량 내부의 ECU(100)는 도 1 에 도시된 바와 같이 외부 통신망(12)과 직접적으로 연결되지 않고, CGW(200)를 통해 외부 통신망(12)과 연결되기 때문이다. 따라서, 차량의 경우 CGW(200)가 차량 내부의 30개에 달하는 전자식 제어기를 모두 관리해야 하고, 차량의 특성 상 이동 중에 항상 안정적으로 네트워크에 연결되어 있기도 불가능하므로 일반적인 전자장치의 펌웨어와 달리 ECU(100)의 펌웨어는 업데이트 시 보다 특수한 방법이 필요하다.However, unlike firmware of other devices (eg, smartphones) that can be updated automatically by connecting directly to the Internet, the firmware of ECU 100 is not automatically updated. This is because the ECU 100 inside the vehicle is not directly connected to the external communication network 12 as shown in FIG. 1, but is connected to the external communication network 12 through the CGW 200. Therefore, in the case of a vehicle, the CGW 200 must manage all 30 electronic controllers inside the vehicle, and because of the characteristics of the vehicle, the CGW 200 cannot be stably connected to the network at all times during movement. The firmware of 100) needs a special method for updating.

더불어, 최근 들어 자율주행 자동차, ADAS(Advanced Driver Assistance Systems) 시스템 등의 도입에 따라 차량의 보안이 문제되고 있다. 특히, 전자식 제어기의 펌웨어 업데이트 시 필수적으로 외부 통신망(12)을 통해 서버(300)로부터 신규 펌웨어를 수신해야 하므로, 수신한 펌웨어 업데이트 데이터가 무결한지에 대한 보안성 검증이 필요하다. 이를 위해, 본 발명은 안전하게 그리고 빠르게 전자식 제어기의 펌웨어를 유선 또는 무선으로 업데이트할 수 있는 시스템 및 방법을 제공하고자 한다.In addition, in recent years, the security of the vehicle has been a problem with the introduction of autonomous vehicles, Advanced Driver Assistance Systems (ADAS) system. In particular, when updating the firmware of the electronic controller, it is necessary to receive new firmware from the server 300 through the external communication network 12, it is necessary to verify the security of the received firmware update data is intact. To this end, the present invention seeks to provide a system and method that can safely and quickly update the firmware of an electronic controller by wire or wirelessly.

도 2 는 본 발명의 일 실시예에 따른 ECU의 내부 구성을 나타낸 것이다.2 shows an internal configuration of an ECU according to an embodiment of the present invention.

도 2 를 참조하면, 본 발명의 일 실시예에 따른 ECU(100)는 MCU(Micro Control Unit, 110), RAM(Random Access Memory, 120), 플래시 메모리(130) 및 HSM(Hardware Security Module, 140)을 포함할 수 있다. 또한, 비록 도 2 에는 도시되지 않았지만, ECU(100) 내 MCU(110)는 호스트 코어 및 HSM 코어를 포함할 수 있다.Referring to FIG. 2, the ECU 100 according to an embodiment of the present invention may include a micro control unit (MCU) 110, a random access memory (RAM) 120, a flash memory 130, and a hardware security module (HSM) 140. ) May be included. Also, although not shown in FIG. 2, MCU 110 in ECU 100 may include a host core and an HSM core.

본 발명의 일 실시예에 따르면 MCU(110) 내에는 기본적인 호스트 코어 외에도, 보안 기능을 담당하는 HSM 코어가 추가적으로 구비될 수 있다. 또한, 하드웨어적으로 HSM(140)이 ECU(100) 내에 존재할 수 있다. 본 발명의 HSM(140)는 하드웨어기반 보안 모듈로서, 유럽 자동차 보안 프로젝트(E-safety Vehicle Intrusion proTected Applications)에서 정의한 국제 표준화된 하드웨어 기반 보안 모듈일 수 있다.According to an embodiment of the present invention, in addition to the basic host core, the MCU 110 may further include an HSM core that is responsible for security functions. In addition, the HSM 140 may exist in the ECU 100 in hardware. The HSM 140 of the present invention is a hardware-based security module, and may be an international standardized hardware-based security module defined by the European E-safety Vehicle Intrusion proTected Applications.

보다 상세히, 완성차 제조사에 부품을 납품하는 부품 제조사들은 차량용 반도체 회사(칩 벤더사)로부터 MCU(110)를 구매하여 사용하는 것이 일반적이다. 이는 MCU(110)를 구성하는 칩은 단기간에 제조하기 어려우므로 부품 제조사가 직접 칩을 제조하기 보다 반도체 회사로부터 구매하는 것이 효율적이기 때문이다.In more detail, component manufacturers supplying components to finished vehicle manufacturers generally purchase and use MCU 110 from a vehicle semiconductor company (chip vendor). This is because the chip constituting the MCU 110 is difficult to manufacture in a short time, it is more efficient for the component manufacturer to purchase from the semiconductor company than to manufacture the chip directly.

한편, 요근래 보안의 중요성이 대두되기 시작하면서 차량용 반도체 회사들은 MCU(110)에 HSM(140) 칩을 포함시키기 시작하였다. 부품 제조사들의 수에 비해 차량용 반도체 회사는 그 수가 한정적이므로, 차량의 전장 장치 내에 들어가는 거의 모든 MCU(110)들은 유사한 HSM(140)을 포함하고 있다. 본 발명의 일 실시예에 따르면, 암호화 관련 기능들은 모두 HSM(140) 내부에서만 모두 수행되어, 암호키 혹은 중간 계산값 등이 외부에 노출될 위험성이 제거될 수 있다. 대표적으로, HSM(112) 내에는 제조사가 발행한 루트 인증서가 차량 출고 전에 저장될 수 있다.Meanwhile, in recent years, as the importance of security is on the rise, automotive semiconductor companies have begun to include the HSM 140 chip in the MCU 110. As the number of automotive semiconductor companies is limited compared to the number of component manufacturers, almost all MCUs 110 within the vehicle's electronic device include a similar HSM 140. According to one embodiment of the present invention, encryption-related functions are all performed only inside the HSM 140, thereby eliminating the risk that the encryption key or intermediate calculation value, etc. are exposed to the outside. Representatively, a route certificate issued by a manufacturer may be stored in the HSM 112 before leaving the vehicle.

보다 상세히, HSM(140) 내부에는 암호 라이브러리 기능이 하드웨어 가속화 장치로 구현되어 있다. 만약 암호 라이브러리 기능이 소프트웨어로 구현되어 있다면, 하드웨어로 구현하는 경우보다 오래 걸린다는 단점이 존재한다. 특히, 차량의 ECU(100)들은 CPU 클락이 낮은 것이 일반적이므로, 소프트웨어로 암호화 기능을 구현하는 경우 차량의 시동 시 빠른 시간 내에 부팅이 되지 못한다는 단점이 존재한다. 이에 반해, HSM(140) 내부에는 암호화 관련 구성들이 하드웨어로 구현되므로, 짧은 시간에 암호화 및 복호화가 가능하다는 장점이 존재한다. 따라서, 본 발명은 HSM(140) 하드웨어를 이용해서 펌웨어를 업데이트하는 것을 일 특징으로 한다.In more detail, the cryptographic library function is implemented as a hardware acceleration device inside the HSM 140. If the cryptographic library function is implemented in software, the disadvantage is that it takes longer than that implemented in hardware. In particular, since the ECU 100 of the vehicle generally has a low CPU clock, when the encryption function is implemented by software, there is a disadvantage in that the vehicle cannot be booted at a short time during start-up. In contrast, since the encryption-related components are implemented in hardware in the HSM 140, there is an advantage that encryption and decryption are possible in a short time. Therefore, the present invention is characterized by updating the firmware using the HSM 140 hardware.

이하에서는, HSM(140)을 이용하여 펌웨어 업데이트를 수행하는 구체적인 방법에 대해 살펴보기로 한다.Hereinafter, a detailed method of performing a firmware update using the HSM 140 will be described.

도 3 은 본 발명의 일 실시예에 따른 펌웨어 업데이트 과정을 나타낸 것이다.3 shows a firmware update process according to an embodiment of the present invention.

도 3 을 참조하면, 먼저 도 3 의 (a)를 참고하면 CGW(200)는 외부 통신망(12)을 통해 신규 펌웨어(펌웨어 업데이트 데이터)를 획득할 수 있다. 이때, 획득된 신규 펌웨어는 블록 단위(블록 #1, 블록 #2, ...)로 분할된 것으로서, 각 블록마다 전자 서명이 삽입되어 있을 수 있다. 보다 상세히, 도 1 과 관련한 설명에서 언급된 서버(300)가 신규 펌웨어의 각 블록에 대해 전자 서명을 생성 및 삽입하여 외부 통신망(12)을 통해 CGW(200)로 전달할 수 있다. Referring to FIG. 3, referring first to FIG. 3A, the CGW 200 may acquire new firmware (firmware update data) through the external communication network 12. In this case, the obtained new firmware is divided into block units (block # 1, block # 2, ...), and an electronic signature may be inserted into each block. In more detail, the server 300 mentioned in the description related to FIG. 1 may generate and insert an electronic signature for each block of the new firmware and transmit the digital signature to the CGW 200 through the external communication network 12.

본 발명의 일 실시예에 따르면, 펌웨어 업데이트 데이터가 블록 단위로 분할되어 있으므로, 신규 펌웨어 업데이트 시, 현재의 펌웨어 전체를 수정할 필요 없이 변경 부분이 포함된 블록만 수정할 수 있다. 즉 신규 펌웨어의 데이터 사이즈가 큰 경우, 전체를 업데이트하지 않고 블록으로 나눠서 필요한 부분만 업데이트할 수 있으므로 효율성이 증대될 수 있다.According to an embodiment of the present invention, since the firmware update data is divided into blocks, the new firmware update may modify only the block including the changed portion without having to modify the entire current firmware. That is, when the data size of the new firmware is large, the efficiency can be increased because only the necessary parts can be updated by dividing into blocks without updating the whole.

다음으로, 도 3 의 (b)와 같이 CGW(200)는 하나의 블록(블록#1)을 복수개의 페이지들(페이지#1, 페이지#2, ...)로 분할한다. 동일하게 다른 블록들 역시 복수개의 페이지로 분할할 수 있다. Next, as shown in FIG. 3B, the CGW 200 divides one block (block # 1) into a plurality of pages (page # 1, page # 2, ...). Similarly, other blocks may be divided into a plurality of pages.

다음으로, 도 3 의 (c) 를 참조하면, 분할된 페이지들은 차량 내부 통신망(11)을 통해 ECU(100)로 전달된다. 즉, 신규 펌웨어(310)자체가 이동하는 것이 아니라, 분할된 페이지들이 ECU(100)로 전달된다.Next, referring to FIG. 3C, the divided pages are transferred to the ECU 100 through the in-vehicle communication network 11. That is, instead of the new firmware 310 itself moving, the divided pages are transmitted to the ECU 100.

다음으로, 도 3 의 (d)를 참조하면, 분할되어 전달된 페이지들은 ECU(100)의 RAM(120)에 먼저 쌓인다. 다음으로, 도 3 의 (d)와 같이 저장된 페이지들은 플래시 메모리(130)에 쓰기 되는 동시에(s31), HSM(140)을 이용하여 전자서명이 검증된다(s33). Next, referring to FIG. 3D, the divided and transferred pages are first stacked in the RAM 120 of the ECU 100. Next, pages stored as shown in (d) of FIG. 3 are written to the flash memory 130 (s31) and the electronic signature is verified using the HSM 140 (s33).

보다 상세히, ECU(100) 내 MCU(110)의 호스트 코어는 내부 통신망(11)을 통해 수신된 페이지들(페이지#1, 페이지#2, ...)을 플래시 메모리(130)에 쓰기 작업을 수행한다(S31). 동시에, MCU(110) 내의 HSM 코어에서는 현재까지 누적된 해시값(hash, 메시지 압축함수)에 전달받은 신규 페이지를 반영한 해쉬값 계산 작업을 병렬적으로 처리한다(s32). 즉, ECU(100) 내의 MCU(110)의 호스트 코어 및 HSM 코어는 쓰기 작업 및 해쉬값 계산 작업을 동시에 병렬적으로 진행한다. 또한, HSM 코어는 상술한 해쉬값 계산 작업을 분할된 총 페이지 개수만큼 반복하고, 최종적으로 증분 계산된 해시 값과 전달받은 전자서명을 인증서의 공개키를 이용하여 복호화한 값이 동일한지 여부를 검증한다(s33). 만약, 최종 전자 서명에 검증하는 것에 실패하는 경우, 해당 블록 전체를 지운다(s34).More specifically, the host core of the MCU 110 in the ECU 100 writes pages (pages # 1, # 2, ...) received through the internal communication network 11 to the flash memory 130. It performs (S31). At the same time, the HSM core in the MCU 110 processes the hash value calculation task reflecting the new page received in the hash value (hash, message compression function) accumulated up to now (s32). That is, the host core and the HSM core of the MCU 110 in the ECU 100 simultaneously perform write operations and hash value calculation tasks in parallel. In addition, the HSM core repeats the above-described hash value calculation operation by the total number of divided pages, and verifies whether the hash value of the incrementally calculated hash value and the received electronic signature are decrypted using the public key of the certificate. (S33). If it fails to verify the final digital signature, the entire block is erased (s34).

보다 상세히, 전자 서명을 인증하는 것과 관련하여, 본 발명의 일 실시예에 따르면 ECU(100)는 서버(300)로부터 전자서명용 인증서를 안전하게 전달받아, ECU(100) 내부에 안전하게 저장된 루트 인증서를 이용하여 전달받은 인증서의 유효성 확인 후, HSM(140) 내에 안전하게 저장할 수 있다. ECU(100)는 제조사와 난수 생성기반 임의 값을 서버에게 전달하고, 서버는 전달받은 값을 자신의 개인키를 이용하여 암호화 후 다시 ECU(100)에게 응답한다. 또한, ECU(100)는 전달받은 암호화값을 전달받은 인증서의 공개키를 이용하여 복호화 후 기 생성한 임의 값과 비교를 통하여 서버를 인증한다. ECU는 전달받은 암호화값을 전달받은 인증서의 공개키를 이용하여 복호화 후 기 생성한 임의값과 비교를 통하여 서버(300)를 인증한다.More specifically, in relation to authenticating the electronic signature, according to an embodiment of the present invention, the ECU 100 securely receives the digital signature certificate from the server 300, using the root certificate securely stored inside the ECU 100 After checking the validity of the received certificate, it can be safely stored in the HSM (140). The ECU 100 transmits a random value based on the manufacturer and the random number generation to the server, and the server responds to the ECU 100 again after encrypting the received value using its private key. In addition, the ECU 100 authenticates the server by comparing the received encryption value with a random value generated after decryption using the public key of the received certificate. The ECU authenticates the server 300 by comparing the received encryption value with a random value generated after decryption using the public key of the received certificate.

도 4 는 본 발명의 일 실시예에 따른 전자서명 검증을 설명하기 위한 도면이다.4 is a view for explaining digital signature verification according to an embodiment of the present invention.

상술한 바와 같이, 도 3 의 s32 단계에 따르면 본 발명의 ECU(100)는 현재까지 누적된 해쉬값에 전달받은 신규 페이지의 해쉬값을 반영하는 작업을 수행한다. 이와 같은 누적된 해쉬값에 전달받은 신규 페이지의 해쉬값을 반영하는 작업을, 분할된 총 페이지에 대해 반복적으로 수행하여 최종적으로 증분 계산된 해쉬값을 산출한다. 즉, 최종적으로 증분 계산된 해쉬값을 산출할 수 있다.As described above, according to step s32 of FIG. 3, the ECU 100 of the present invention performs a task of reflecting the hash value of the new page transmitted to the hash value accumulated so far. A task that reflects the hash value of the new page received in the accumulated hash value is repeatedly performed on the divided total pages to finally calculate an incrementally calculated hash value. That is, the hash value finally calculated incrementally can be calculated.

도 4 의 (a) 를 참조하면, 전체 블록(블록#1)에 대해 해쉬함수를 적용하여 최종 해쉬값을 획득하는 구성이 도시되어 있다. 또한, 도 4 의 (b) 를 참조하면, 블록(블록#1)을 페이지 단위(페이지#1, 페이지#2, ...)로 분할하고, 각 페이지를 해쉬함수에 증분 형태로 적용하여 최종 해쉬값을 획득하는 구성이 도시되어 있다. 보다 상세히, 도 4 의 (b)에서는, 페이지#1에 해쉬 함수를 적용하여 제1 해쉬값(HV1)을 획득하고, 제1 해쉬값(HV1) 및 페이지#2에 해쉬함수를 적용하여 제2 해쉬값(HV2)을 얻는 것과 같은 방식으로, 증분 형태로 최종 해쉬값을 획득한다. 이때, 해쉬 함수는 스트리밍 특성을 지니므로, 도 4 의 (a)와 (b)의 최종 해쉬값은 동일할 수 있다. 즉, 블록 전체를 해쉬 함수로 계산한 최종 해쉬값(HV)과, 블록을 페이지 단위로 분할 한 후 개별 페이지의 해쉬 함수의 증분값인 최종 해쉬값(HV)이 동일할 수 있다. 따라서, 증분 형태로 계산된 해쉬 값과 전달받은 전자서명 값을 인증서의 공개키로 복호화 한 값이 서로 동일한지 여부를 확인함으로써, 전자서명 검증을 수행할 수 있다. 만약, 동일하지 않다면 플래시 메모리(130)에 쓰여진 해당 블록을 모두 지울 수 있다.Referring to FIG. 4A, a configuration of obtaining a final hash value by applying a hash function to all blocks (block # 1) is illustrated. In addition, referring to FIG. 4B, the block (block # 1) is divided into page units (pages # 1, page # 2, ...), and each page is incrementally applied to the hash function, resulting in a final result. A configuration for obtaining a hash value is shown. In more detail, in FIG. 4B, the first hash value HV1 is obtained by applying the hash function to page # 1, and the second hash value is applied to the first hash value HV1 and page # 2. In the same manner as obtaining the hash value HV2, the final hash value is obtained in incremental form. In this case, since the hash function has a streaming characteristic, the final hash values of (a) and (b) of FIG. 4 may be the same. That is, the final hash value HV calculated as the hash function of the entire block and the final hash value HV which is an increment value of the hash function of the individual pages after the block is divided into pages may be the same. Therefore, the digital signature verification can be performed by checking whether the hash value calculated in the incremental form and the value of the received digital signature are decrypted with the public key of the certificate. If not the same, all of the blocks written in the flash memory 130 may be erased.

따라서, 본 발명의 일 실시예에 따르면 증분 형태의 인증서 기반 전자서명 검증을 통해, 페이지 단위로 전송 시 ECU(100) 내부적으로 플래시 메모리(130)에 쓰기 및 검증을 위한 최종 해쉬값 계산을 동시에 수행할 수 있도록 함으로써, 펌웨어 업데이트 소요 시간을 단축할 수 있다. 기존에는 플래시 메모리(130)에 쓰기 과정이 끝나야 전자서명 검증 과정을 후속으로 진행할 수 있었다. 이에 반해, 본원 발명은 쓰기 과정과 전자서명 검증 과정은 병렬처리를 함으로써 속도를 줄일 수 있다. Accordingly, according to an embodiment of the present invention, through the certificate-based digital signature verification in incremental form, the final hash value for writing and verifying in the flash memory 130 internally at the same time during the page unit transmission is simultaneously performed. By doing so, the time required for firmware update can be shortened. Conventionally, the digital signature verification process may be subsequently performed only after the writing process is completed in the flash memory 130. On the contrary, in the present invention, the writing process and the digital signature verification process can be reduced in speed by performing parallel processing.

도 5 는 본 발명의 일 실시예에 따른 파이프라인 형태의 페이지 단위 신규 펌웨어 업데이트 과정을 설명하기 위한 것이다.FIG. 5 illustrates a process of updating a new page-based firmware in a pipeline form according to an embodiment of the present invention.

도 5 를 참조하면, 파이프라인 형태의 페이지 단위 신규 펌웨어 보안 업데이트 과정이 나타나있다. 도 5 에 나타난 각 사각형은 신규 펌웨어의 분할된 페이지를 나타낼 수 있다. 즉, 본 발명의 일 실시예에 따르면 MCU(110)의 호스트 코어 처리 영역은, 각 페이지가 들어오면 플래시 메모리(130)에 페이지를 쓰는 과정을 순차적으로 처리한다. 예를 들어, A, B, C 페이지가 순차적으로 전송되면, A, B, C 페이지가 순차적으로 플래시 메모리(130)에 쓰기 될 수 있다. 더불어, HSM 코어 처리 영역은 플래시 메모리(130)에 A, B, C 가 쓰일 때 동시에 A, B, C 페이지를 검증한다. 따라서, 도 4 에서 보는 바와 같이 A, B, C 각 페이지의 쓰기/검증이 동시에 이루어질 수 있고, 따라서 호스트 코어와 HSM 코어라는 2개의 파이프라인을 가동한 것과 같은 효과를 가질 수 있다.Referring to FIG. 5, a new page firmware update process in a pipeline form is shown. Each square shown in FIG. 5 may represent a divided page of new firmware. That is, according to an embodiment of the present invention, the host core processing area of the MCU 110 sequentially processes the writing of the page in the flash memory 130 when each page comes in. For example, when A, B, and C pages are sequentially transmitted, A, B, and C pages may be sequentially written to the flash memory 130. In addition, the HSM core processing area verifies A, B, and C pages simultaneously when A, B, and C are used in the flash memory 130. Therefore, as shown in FIG. 4, the writing / verification of each page of A, B, and C can be simultaneously performed, and therefore, it can have the same effect as operating two pipelines, a host core and an HSM core.

한편, 차량 내부 통신망(11)에 스니핑이 발생할 경우, 도 3 과 같이 차량 내부 통신망(11)을 통해 전송되는 신규 펌웨어 내용이 유출될 수 있는 위험성 존재한다. CAN 과 같은 차량 내부 통신망(11)은 안전한 통신 채널이 아니므로 보안에 취약한 측면이 존재한다. 이를 보완하기 위해, 본원 발명은 신규 펌웨어를 암호화하여 차량 내부 통신망을 통해 전송할 수 있다. 즉, 서버(300)가 신규 펌웨어를 비밀키를 이용하여 블록 단위로 암호화한 후, 암호화된 블록들로 이루어진 펌웨어를 CGW(200)를 통해 ECU(100)로 전송할 수 있다.On the other hand, when sniffing occurs in the in-vehicle communication network 11, there is a risk that new firmware contents transmitted through the in-vehicle communication network 11 may leak as shown in FIG. 3. Since the in-vehicle communication network 11 such as CAN is not a secure communication channel, there is a security vulnerability. To compensate for this, the present invention can encrypt the new firmware and transmit it through the in-vehicle communication network. That is, after the server 300 encrypts the new firmware in units of blocks by using a secret key, the server 300 may transmit firmware of the encrypted blocks to the ECU 100 through the CGW 200.

본 발명의 일 실시예에 따르면, 암호화된 블록들로 이루어진 신규 펌웨어는 최초 서버와 비밀키 합의 과정을 한 유일한 ECU(100)만이 복호화 가능하다. 즉, 비밀키를 공유하고 있는 대상이 서버와 해당 ECU뿐이므로, ECU(100) 내의 HSM(140)에 저장된 비밀키를 통해서만 암호화된 블록을 복호화하는 것이 가능하다.According to an embodiment of the present invention, the new firmware composed of the encrypted blocks can be decrypted only by the ECU 100 which has made a secret key agreement process with the original server. That is, since only the server and the corresponding ECU share the secret key, it is possible to decrypt the encrypted block only through the secret key stored in the HSM 140 in the ECU 100.

보다 상세히, ECU(100)는 난수 생성기반 비밀키를 생성하여, HSM(112)과 같은 내부의 안전한 저장소에 저장하고 이를 서버(300) 인증서의 공개키를 이용하여 암호화한 후 서버(300)에 전달한다. 그후, 서버(300)는 전달받은 암호화된 비밀키를 개인키를 이용하여 복호화 후 내부에 안전하게 저장함으로써, 서버(300)와 ECU(100) 만이 해당 비밀키를 공유하게 된다. 즉, 신규 펌웨어는 서버(300)와 ECU(100) 간 합의된 비밀키에 의해 암호화된 펌웨어로서, 상기 합의된 비밀키는 ECU(100)가 생성한 난수 기반 비밀키이다. 생성된 난수 기반 비밀키는 ECU(100)에 의해 서버(300)의 공개키를 이용하여 암호화되어 서버(100)로 전송되고, 암호화된 비밀키는 서버(100)에 의해 서버(300)의 개인키를 이용하여 복호화됨으로써, 서버-ECU간 합의된 비밀키로 동작할 수 있다. 따라서 합의된 비밀키는 상기 ECU(100)에 의해 생성된 난수 기반 비밀키가 서버(300)의 공개키를 이용하여 암호화된 후, 서버(300)의 개인키를 이용하여 복호화된 것이다.In more detail, the ECU 100 generates a random number-based secret key, stores it in an internal secure storage such as the HSM 112, encrypts it using the public key of the server 300 certificate, and then stores the secret key in the server 300. To pass. After that, the server 300 decrypts the received encrypted secret key using a private key and then stores it securely therein so that only the server 300 and the ECU 100 share the corresponding secret key. That is, the new firmware is firmware encrypted by a secret key agreed between the server 300 and the ECU 100, and the agreed secret key is a random number based secret key generated by the ECU 100. The generated random number based secret key is encrypted by the ECU 100 using the public key of the server 300 and transmitted to the server 100, and the encrypted secret key is stored by the server 100 in the individual of the server 300. By decrypting with the key, it can operate with the secret key agreed between the server and the ECU. Therefore, the agreed secret key is a random number-based secret key generated by the ECU 100 is encrypted using the public key of the server 300, and then decrypted using the private key of the server 300.

도 6 은 본 발명의 일 실시예에 따른 암호화된 신규 펌웨어를 전송하는 예시를 나타낸 것이다.6 shows an example of transmitting encrypted new firmware according to an embodiment of the present invention.

도 6 을 참조하면, 먼저 도 6 의 (a)를 참조하면 서버(300)는 신규 펌웨어를 특정 크기의 블록들로 분할하여, 블록단위 전자서명을 생성 및 삽입한다. 상술한 바와 같이, 신규 펌웨어는 부트블록, 애플리케이션 코드1블록, 애플리케이션 코드2블록, 데이터 블록 등으로 분할될 수 있다. 다음으로, 도 6 의 (b) 를 참조하면, 백엔드 서버(300)는 비밀키로 블록들을 암호화하여 암호화된 블록들을 생성한다.Referring to FIG. 6, referring first to FIG. 6A, the server 300 divides new firmware into blocks having a specific size, and generates and inserts a block unit digital signature. As described above, the new firmware may be divided into a boot block, an application code 1 block, an application code 2 block, a data block, and the like. Next, referring to FIG. 6B, the back-end server 300 generates encrypted blocks by encrypting blocks with a secret key.

다음으로, 도 6 의 (c) 및 (d) 를 참조하면, 외부 통신망(12)을 통해 암호화된 블록들로 이루어진 펌웨어가 CGW(200)로 이동한다. 이때, 외부 통신망(12)은 안전한 통신 채널(SSL 혹은 TLS 등)일 수 있다.Next, referring to (c) and (d) of FIG. 6, firmware composed of blocks encrypted through the external communication network 12 moves to the CGW 200. In this case, the external communication network 12 may be a secure communication channel (SSL or TLS, etc.).

다음으로, 도 6 의 (e)를 참조하면, 펌웨어가 암호화된 블록 단위로 차량 내부 통신망을 통해 ECU(100)로 전송된다(s61). 다음으로, 도 6 의 (f)를 참조하면, 암호화된 블록을 수신한 ECU(100)는 RAM(120)에 암호화된 블록들을 저장한다. 저장된 암호화된 블록은 HSM(140)에 저장된 암호키를 이용하여 복호화될 수 있다(s62). 다음으로, 복호화된 블록은 플래시 메모리(130)에 쓰기 되고, 인증서에 기반하여 복호화된 블록의 전자서명을 검증하는 프로세스가 병렬적으로 이루어질 수 있다(S63). 만약, 최종 전자서명의 검증이 실패하는 경우, 쓰기 된 복호화된 블록이 삭제될 수 있다.Next, referring to FIG. 6E, firmware is transmitted to the ECU 100 through the in-vehicle communication network in units of encrypted blocks (s61). Next, referring to FIG. 6F, the ECU 100 receiving the encrypted block stores the encrypted blocks in the RAM 120. The stored encrypted block may be decrypted using the encryption key stored in the HSM 140 (s62). Next, the decrypted block is written to the flash memory 130, and a process of verifying the digital signature of the decrypted block based on the certificate may be performed in parallel (S63). If the final digital signature fails, the written decoded block may be deleted.

이상 설명된 본 발명에 따른 실시예는 컴퓨터 상에서 다양한 구성요소를 통하여 실행될 수 있는 컴퓨터 프로그램의 형태로 구현될 수 있으며, 이와 같은 컴퓨터 프로그램은 컴퓨터로 판독 가능한 매체에 기록될 수 있다. 이때, 매체는 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다.Embodiments according to the present invention described above may be implemented in the form of a computer program that can be executed through various components on a computer, such a computer program may be recorded in a computer-readable medium. In this case, the medium may be to continuously store a program executable by the computer, or to store for execution or download. In addition, the medium may be a variety of recording means or storage means in the form of a single or several hardware combined, not limited to a medium directly connected to any computer system, it may be distributed on the network. Examples of media include magnetic media such as hard disks, floppy disks and magnetic tape, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, And ROM, RAM, flash memory, and the like, configured to store program instructions. In addition, examples of another medium may include a recording medium or a storage medium managed by an app store that distributes an application, a site that supplies or distributes various software, a server, or the like.

이상에서 본 발명이 구체적인 구성요소 등과 같은 특정 사항과 한정된 실시예 및 도면에 의하여 설명되었으나, 이는 본 발명의 보다 전반적인 이해를 돕기 위하여 제공된 것일 뿐, 본 발명이 상기 실시예에 한정되는 것은 아니며, 본 발명이 속하는 기술분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정과 변경을 꾀할 수 있다.Although the present invention has been described by specific matters such as specific components and limited embodiments and drawings, it is provided only to help a more general understanding of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art can make various modifications and changes from this description.

따라서, 본 발명의 사상은 상기 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 또는 이로부터 등가적으로 변경된 모든 범위는 본 발명의 사상의 범주에 속한다고 할 것이다.Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the scope of the spirit of the present invention is defined not only in the claims below, but also in the ranges equivalent to or equivalent to the claims. Will belong to.

Claims (16)

전자식 제어기(Electric Control Unit)의 펌웨어 업데이트 시스템으로서, 상기 시스템은,
서버로부터 전자서명이 포함된 신규 펌웨어를 수신하는 센트럴 게이트웨이;

상기 신규 펌웨어에 기초하여 기존의 펌웨어를 업데이트하는 전자식 제어기를 포함하고, 상기 전자식 제어기는,
상기 신규 펌웨어의 데이터를 분할된 페이지 단위로 쓰기(write) 처리하는 플래시 메모리; 및
상기 분할된 페이지 단위로 상기 플래시 메모리에 신규 펌웨어 데이터가 쓰기 처리 될 때, 병렬적으로 인증서에 기반하여 전자서명을 검증하는 하드웨어기반 보안 모듈(Hardware Security Module)을 포함하는, 전자식 제어기의 펌웨어 업데이트 시스템.
A firmware update system of an electric control unit (Electric Control Unit), wherein the system,
A central gateway for receiving new firmware including a digital signature from a server;
And
An electronic controller for updating the existing firmware based on the new firmware, wherein the electronic controller,
A flash memory which writes data of the new firmware in units of divided pages; And
When the new firmware data is written to the flash memory by the divided page unit, the firmware update system of the electronic controller including a hardware-based security module (Hardware Security Module) for verifying the electronic signature based on the certificate in parallel .
제 1 항에 있어서,
상기 센트럴 게이트웨이는 블록 단위로 분할된 상기 신규 펌웨어를 수신하고, 하나의 블록을 페이지 단위로 분할하여 각 페이지들을 상기 전자식 제어기로 전송하는, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
The central gateway receives the new firmware divided into block units, divides one block into page units, and transmits each page to the electronic controller.
제 1 항에 있어서,
상기 전자서명을 검증하는 것은, 상기 페이지 단위로 해시함수 결과값을 증분한 최종 해쉬값과, 상기 전달받은 전자 서명을 인증서의 공개키를 이용하여 복호화한 값이 동일한지 여부를 확인하는 것인, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
Validating the digital signature is to confirm whether or not the final hash value obtained by incrementing the hash function result value by the page unit and the value obtained by decrypting the received electronic signature using a public key of a certificate are the same. Firmware update system of electronic controller.
제 1 항에 있어서,
상기 센트럴 게이트웨이는 차량 외부 통신망을 통해 상기 서버로부터 상기 신규 펌웨어를 제공받고, 차량 내부 통신망을 통해 상기 신규 펌웨어를 상기 전자식 제어기로 제공하는, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
And the central gateway is provided with the new firmware from the server via an external vehicle communication network and provides the new firmware to the electronic controller via an internal vehicle communication network.
제 1 항에 있어서,
상기 전자식 제어기는,
상기 센트럴 게이트웨이로부터 수신한 상기 신규 펌웨어를 분할된 페이지 단위로 기록하는 RAM; 을 더 포함하는, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
The electronic controller,
RAM for recording the new firmware received from the central gateway in divided page units; The firmware update system of the electronic controller further comprising.
제 1 항에 있어서,
상기 하드웨어기반 보안 모듈은, 내부에 제조시부터 저장된 루트 인증서를 포함하고, 상기 루트 인증서를 이용하여 상기 서버로부터 전달받은 전자서명용 인증서의 유효성을 확인하는, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
The hardware-based security module includes a root certificate stored at the time of manufacture therein, and checks the validity of the certificate for the electronic signature received from the server using the root certificate, firmware update system of the electronic controller.
제 1 항에 있어서,
상기 신규 펌웨어는 서버와 상기 전자식 제어기 간 합의된 비밀키에 의해 암호화된 펌웨어로서, 상기 합의된 비밀키는 상기 전자식 제어기가 생성한 난수 기반 비밀키를 상기 서버의 공개키를 이용하여 암호화하고 상기 서버의 개인키를 이용하여 복호화한 것인, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
The new firmware is firmware encrypted by a secret key agreed between a server and the electronic controller. The agreed secret key encrypts a random number-based secret key generated by the electronic controller using the public key of the server and the server. The firmware update system of the electronic controller, which is decrypted using the private key.
제 1 항에 있어서,
상기 전자서명의 검증에 실패한 경우, 상기 플래시 메모리에 쓰기된 신규 펌웨어 데이터의 해당 블록 단위가 모두 삭제되는, 전자식 제어기의 펌웨어 업데이트 시스템.
The method of claim 1,
When the verification of the electronic signature fails, all corresponding block units of new firmware data written to the flash memory are deleted.
전자식 제어기(Electric Control Unit)의 펌웨어 업데이트 방법으로서, 상기 방법은,
센트럴 게이트웨이에 의해 서버로부터 전자서명이 포함된 신규 펌웨어를 수신하는 단계;
플래시 메모리에 의해 상기 신규 펌웨어의 데이터를 분할된 페이지 단위로 쓰기(write) 처리하는 단계;
상기 분할된 페이지 단위로 상기 플래시 메모리에 신규 펌웨어 데이터가 쓰기 처리 될 때, 하드웨어 기반 보안 모듈에 의해, 병렬적으로 인증서에 기반하여 전자서명을 검증하는 단계; 를 포함하는 전자식 제어기의 펌웨어 업데이트 방법.
A firmware update method of an electric control unit (Electric Control Unit), the method comprising:
Receiving, by the central gateway, new firmware including the digital signature from the server;
Writing data of the new firmware by a divided page unit by a flash memory;
Verifying, by the hardware-based security module, the digital signature based on the certificate in parallel when new firmware data is written to the flash memory in the divided page unit; Firmware update method of the electronic controller comprising a.
제 9 항에 있어서,
상기 신규 펌웨어를 수신하는 단계는, 블록 단위로 분할된 상기 신규 펌웨어를 수신하고, 하나의 블록을 페이지 단위로 분할하여 각 페이지들을 상기 전자식 제어기로 전송하는, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
The receiving of the new firmware may include receiving the new firmware divided into block units, dividing one block into page units and transmitting each page to the electronic controller.
제 9 항에 있어서,
상기 전자서명을 검증하는 것은, 상기 페이지 단위로 해시함수 결과값을 증분한 최종 해쉬값과, 상기 전달받은 전자 서명을 인증서의 공개키를 이용하여 복호화한 값이 동일한지 여부를 확인하는 것인, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
Validating the digital signature is to confirm whether or not the final hash value obtained by incrementing the hash function result value by the page unit and the value obtained by decrypting the received electronic signature using a public key of a certificate are the same. Firmware update method of electronic controller.
제 9 항에 있어서,
상기 신규 펌웨어를 수신하는 단계는, 차량 외부 통신망을 통해 상기 서버로부터 상기 신규 펌웨어를 제공받고, 차량 내부 통신망을 통해 상기 신규 펌웨어를 상기 전자식 제어기로 제공하는, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
The receiving of the new firmware may include receiving the new firmware from the server through a vehicle external communication network and providing the new firmware to the electronic controller through an internal vehicle communication network.
제 9 항에 있어서,
상기 하드웨어 기반 보안 모듈은, 내부에 제조시부터 저장된 루트 인증서를 포함하고, 상기 루트 인증서를 이용하여 상기 서버로부터 전달받은 전자서명용 인증서의 유효성을 확인하는, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
The hardware-based security module includes a root certificate stored at the time of manufacture therein, and checks the validity of the certificate for the electronic signature received from the server using the root certificate, firmware update method of the electronic controller.
제 9 항에 있어서,
상기 신규 펌웨어는 서버와 상기 전자식 제어기 간 합의된 비밀키에 의해 암호화된 펌웨어로서, 상기 합의된 비밀키는 상기 전자식 제어기에 의해 생성된 난수 기반 비밀키가 상기 서버의 공개키를 이용하여 암호화된 후, 상기 서버의 개인키를 이용하여 복호화된 것인, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
The new firmware is firmware encrypted by a secret key agreed between a server and the electronic controller. The agreed secret key is a random number based secret key generated by the electronic controller after being encrypted using the public key of the server. And decrypted using the private key of the server.
제 9 항에 있어서,
상기 전자서명의 검증에 실패한 경우, 상기 플래시 메모리에 쓰기된 신규 펌웨어 데이터의 해당 블록 단위가 모두 삭제되는, 전자식 제어기의 펌웨어 업데이트 방법.
The method of claim 9,
When the verification of the electronic signature fails, all corresponding block units of new firmware data written to the flash memory are deleted.
제 9 항 내지 제 15 항 중 어느 한 항에 따른 방법을 실행하기 위해 컴퓨터 판독 가능한 기록 매체에 기록된 컴퓨터 프로그램.A computer program recorded on a computer readable recording medium for carrying out the method according to any one of claims 9 to 15.
KR1020190100540A 2018-08-16 2019-08-16 Method, system and computer program for updating firmware of ecu KR102254146B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20180095743 2018-08-16
KR1020180095743 2018-08-16

Publications (2)

Publication Number Publication Date
KR20200020645A true KR20200020645A (en) 2020-02-26
KR102254146B1 KR102254146B1 (en) 2021-05-21

Family

ID=69637538

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190100540A KR102254146B1 (en) 2018-08-16 2019-08-16 Method, system and computer program for updating firmware of ecu

Country Status (1)

Country Link
KR (1) KR102254146B1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210110907A (en) * 2020-03-02 2021-09-10 이병대 Vehicle ECU update device and method secured in OTA environment
KR20220042939A (en) * 2020-09-28 2022-04-05 주식회사 페스카로 Method and apparatus for evaluating security of electronic controller in vehicle
KR102465390B1 (en) * 2022-04-26 2022-11-09 (주)프리뉴 Flight controller and method therefor
KR102482309B1 (en) * 2022-09-27 2022-12-28 주식회사 시옷 Low-spec ECU wireless update security system for vehicles
CN117892318A (en) * 2024-03-12 2024-04-16 汉兴同衡科技集团有限公司 Internet of things intelligent terminal data security protection method, system and storage device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050026924A (en) * 2002-05-07 2005-03-16 소니 에릭슨 모빌 커뮤니케이션즈 에이비 Method for loading an application in a device, device and smart card therefor
JP2010211295A (en) * 2009-03-06 2010-09-24 Mitsubishi Electric Corp Data update device, data update method of the same, and data update program
JP2013174976A (en) * 2012-02-23 2013-09-05 Toshiba Corp Memory system and update method for control program
JP2018079768A (en) * 2016-11-15 2018-05-24 トヨタ自動車株式会社 Update data storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050026924A (en) * 2002-05-07 2005-03-16 소니 에릭슨 모빌 커뮤니케이션즈 에이비 Method for loading an application in a device, device and smart card therefor
JP2010211295A (en) * 2009-03-06 2010-09-24 Mitsubishi Electric Corp Data update device, data update method of the same, and data update program
JP2013174976A (en) * 2012-02-23 2013-09-05 Toshiba Corp Memory system and update method for control program
JP2018079768A (en) * 2016-11-15 2018-05-24 トヨタ自動車株式会社 Update data storage system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210110907A (en) * 2020-03-02 2021-09-10 이병대 Vehicle ECU update device and method secured in OTA environment
KR20220042939A (en) * 2020-09-28 2022-04-05 주식회사 페스카로 Method and apparatus for evaluating security of electronic controller in vehicle
KR102465390B1 (en) * 2022-04-26 2022-11-09 (주)프리뉴 Flight controller and method therefor
KR102482309B1 (en) * 2022-09-27 2022-12-28 주식회사 시옷 Low-spec ECU wireless update security system for vehicles
WO2024071465A1 (en) * 2022-09-27 2024-04-04 주식회사 시옷 Low-specification ecu wireless update security system for vehicle
CN117892318A (en) * 2024-03-12 2024-04-16 汉兴同衡科技集团有限公司 Internet of things intelligent terminal data security protection method, system and storage device
CN117892318B (en) * 2024-03-12 2024-05-24 汉兴同衡科技集团有限公司 Internet of things intelligent terminal data security protection method, system and storage device

Also Published As

Publication number Publication date
KR102254146B1 (en) 2021-05-21

Similar Documents

Publication Publication Date Title
KR102254146B1 (en) Method, system and computer program for updating firmware of ecu
JP7280396B2 (en) Secure provisioning and management of equipment
US11082228B2 (en) Reuse system, key generation device, data security device, in-vehicle computer, reuse method, and computer program
US10419220B2 (en) Management device, key generating device, vehicle, maintenance tool, management system, management method, and computer program
US10855460B2 (en) In-vehicle computer system, vehicle, key generation device, management method, key generation method, and computer program
EP3474488A1 (en) System, certification authority, vehicle-mounted computer, vehicle, public key certificate issuance method, and program
US11212087B2 (en) Management system, key generation device, in-vehicle computer, management method, and computer program
CN103166759B (en) Use the method and apparatus downloaded for secure firmware of diagnosis link connector (DLC) and ONSTAR system
JP5949732B2 (en) Program update system and program update method
JP6178390B2 (en) Management device, management system, vehicle, management method, and computer program
WO2017022821A1 (en) Management device, management system, key generation device, key generation system, key management system, vehicle, management method, key generation method, and computer program
US8856538B2 (en) Secured flash programming of secondary processor
EP3276876B1 (en) Management device, vehicle, management method, and computer program
JP6190443B2 (en) In-vehicle computer system, vehicle, management method, and computer program
US11182485B2 (en) In-vehicle apparatus for efficient reprogramming and controlling method thereof
WO2018223041A1 (en) System and method for cryptographic protections of customized computing environment
CN109314645B (en) Data providing system, data protection device, data providing method, and storage medium
Petri et al. Evaluation of lightweight TPMs for automotive software updates over the air
CN109314644B (en) Data providing system, data protection device, data providing method, and storage medium
JP2018055566A (en) Maintenance device, maintenance method, and computer program
KR102389727B1 (en) Method and apparatus for evaluating security of electronic controller in vehicle
KR102025808B1 (en) Driving assistance Apparatus for Vehicle and Control method thereof
JP6554704B2 (en) Data providing system and data providing method
KR101982917B1 (en) Certificate-based vehicle security method and apparatus to maintain ecu security
JP6132955B1 (en) Verification system, verification device, verification method, and computer program

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right