KR102545102B1 - In-vehicle controller and method for performing update therof - Google Patents

In-vehicle controller and method for performing update therof Download PDF

Info

Publication number
KR102545102B1
KR102545102B1 KR1020180055253A KR20180055253A KR102545102B1 KR 102545102 B1 KR102545102 B1 KR 102545102B1 KR 1020180055253 A KR1020180055253 A KR 1020180055253A KR 20180055253 A KR20180055253 A KR 20180055253A KR 102545102 B1 KR102545102 B1 KR 102545102B1
Authority
KR
South Korea
Prior art keywords
authentication code
message authentication
comparison
flag
area
Prior art date
Application number
KR1020180055253A
Other languages
Korean (ko)
Other versions
KR20190130756A (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 현대자동차주식회사
Priority to KR1020180055253A priority Critical patent/KR102545102B1/en
Publication of KR20190130756A publication Critical patent/KR20190130756A/en
Application granted granted Critical
Publication of KR102545102B1 publication Critical patent/KR102545102B1/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/575Secure boot
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3242Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

본 발명은 차량용 제어기 및 그 업데이트 방법에 관한 것으로, 보다 상세하게는 무결성 확보를 위한 보안 기술이 적용된 상태에서 무선 업데이트가 가능한 제어기 및 그 업데이트 방법에 관한 것이다. 본 발명의 일 실시예에 따른 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법은, 호스트 어플리케이션을 기반으로 생성된 제1 메시지 인증 코드가 제1 메모리 영역에 저장된 후 제1 리셋되는 단계; 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드를 호스트 어플리케이션이 저장되는 제2 메모리 영역에 주입되는 단계; 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제2 메시지 인증 코드가 생성되고, 제3 메모리 영역에 저장된 후 제2 리셋되는 단계; 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제3 메시지 인증 코드가 생성되면, 상기 제3 메시지 인증 코드와 상기 제3 메모리 영역에 저장된 상기 제2 메시지 인증 코드가 제1 비교되고, 상기 제2 메모리 영역에 주입된 상기 제1 메시지 인증 코드와 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드가 제2 비교되는 단계; 및 상기 제1 비교의 결과 및 상기 제2 비교의 결과가 모두 동일할 경우 호스팅 시스템이 부팅되는 단계를 포함할 수 있다.The present invention relates to a vehicle controller and an update method thereof, and more particularly, to a controller capable of wireless update in a state in which a security technology for securing integrity is applied and an update method thereof. A secure booting method of a controller including a hardware security module according to an embodiment of the present invention includes storing a first message authentication code generated based on a host application in a first memory area and then performing a first reset; injecting the first message authentication code of the first memory area into a second memory area storing a host application; generating a second message authentication code based on the first application data into which the first message authentication code is injected, storing the second message authentication code in a third memory area, and performing a second reset; When a third message authentication code is generated based on the first application data into which the first message authentication code is injected, a first comparison is performed between the third message authentication code and the second message authentication code stored in the third memory area. and performing a second comparison between the first message authentication code injected into the second memory area and the first message authentication code in the first memory area; and booting the hosting system when the result of the first comparison and the result of the second comparison are identical.

Description

차량용 제어기 및 그 업데이트 방법{IN-VEHICLE CONTROLLER AND METHOD FOR PERFORMING UPDATE THEROF}Vehicle controller and its update method {IN-VEHICLE CONTROLLER AND METHOD FOR PERFORMING UPDATE THEROF}

본 발명은 차량용 제어기 및 그 업데이트 방법에 관한 것으로, 보다 상세하게는 무결성 확보를 위한 보안 기술이 적용된 상태에서 무선 업데이트가 가능한 제어기 및 그 업데이트 방법에 관한 것이다.The present invention relates to a vehicle controller and an update method thereof, and more particularly, to a controller capable of wireless update in a state in which a security technology for securing integrity is applied and an update method thereof.

일반적으로 하드웨어 보안 모듈(HSM: Hardware Security Module)은 암호화 키의 수명 주기 보호를 위해 특별히 설계된 암호화 프로세서를 의미하며, 강화된 위조 방지 장치 내에서 암호화 처리, 키 보호 및 키 관리를 수행한다. 차량 제어기 도메인에서 사용되는 HSM은 일반적으로 키를 안전하게 저장할 수 있는 보안 메모리(Secure Memory)를 구비한다. 예컨대, 보안 메모리는 호스트 시스템(즉, 어플리케이션)과 별개로 보안성이 높은 HSM 전용 RAM이나 ROM을 포함하며, HSM은 전용의 중앙처리장치(CPU)를 통해 일련의 동작을 수행하여 잠재적 공격자의 공격으로부터 상대적으로 안전하게 기능을 수행할 수 있다.In general, a hardware security module (HSM) refers to a cryptographic processor specially designed for protection of the life cycle of cryptographic keys, and performs cryptographic processing, key protection, and key management within a hardened anti-counterfeiting device. An HSM used in a vehicle controller domain generally includes a secure memory that can safely store keys. For example, the secure memory includes RAM or ROM dedicated to the HSM with high security, separate from the host system (i.e., the application), and the HSM performs a series of operations through a dedicated central processing unit (CPU) to prevent potential attackers from attacking. function can be performed relatively safely.

특히, HSM은 제어기의 보안 부팅(Secure Booting) 기능을 제공한다. 보안 부팅이란 HSM을 통해 부팅 시 제어기의 펌웨어의 무결성을 검증하는 기능이다. 구체적으로, 부팅 시 HSM은 호스트 부트로더의 무결성을 검증하고, 무결성 검증이 통과된 경우에만 제어권을 호스트 부트로더로 넘긴다. 따라서, 부트로더의 무결성이 검증된 경우에만 정상적으로 호스트의 부팅 절차가 진행될 수 있다. In particular, the HSM provides a secure booting function of the controller. Secure boot is a function that verifies the integrity of the firmware of the controller when booting through HSM. Specifically, during booting, the HSM verifies the integrity of the host bootloader, and transfers control to the host bootloader only when the integrity verification passes. Therefore, the booting process of the host can proceed normally only when the integrity of the bootloader is verified.

이하, 도 1, 도 2 및 표 1을 참조하여 일반적인 HSM을 이용한 호스트의 부팅 과정을 설명한다.Hereinafter, a booting process of a host using a general HSM will be described with reference to FIGS. 1, 2 and Table 1.

도 1은 일반적인 HSM을 구비한 제어기의 메모리 구성의 일례를, 도 2는 일반적인 HSM을 구비한 제어기의 부팅 절차의 일례를 각각 나타낸다. 또한, 표 1은 도 1에 도시된 메모리 구성의 설정을 나타낸다.1 shows an example of a memory configuration of a controller with a general HSM, and FIG. 2 shows an example of a booting procedure of a controller with a general HSM. Table 1 also shows settings of the memory configuration shown in FIG.

먼저, 도 1을 참조하면 HSM을 구비한 제어기는 적어도 호스트 메모리(10)와 HSM 메모리(20)를 포함할 수 있다. 여기서, 호스트 메모리(10)는 HSM을 이용한 보안 부팅의 설정 여부를 나타내는 보안 부트 설정(Secure Boot Enable, 11)과 제어기 구동용 어플리케이션과 관련 데이터를 저장하는 호스트 어플리케이션 프로그램 및 데이터(13)를 저장할 수 있다. 또한, HSM 메모리(20)는 보안 부트 플래그(Secure Boot Flag, 21), 제1 메시지 인증 코드(1st_MAC, 23) 및 인스턴트 메시지 인증 코드(Instant_MAC, 25)을 저장할 수 있다.First, referring to FIG. 1 , a controller having an HSM may include at least a host memory 10 and an HSM memory 20 . Here, the host memory 10 may store a secure boot enable 11 indicating whether secure booting using HSM is set, and a host application program and data 13 storing an application for driving a controller and related data. there is. In addition, the HSM memory 20 may store a secure boot flag (Secure Boot Flag, 21), a first message authentication code (1st_MAC, 23), and an instant message authentication code (Instant_MAC, 25).

각 메모리(10, 20)에 저장되는 데이터는 서로 다른 메모리 주소로 구분될 수 있으며, 데이터 중 적어도 일부는 각 메모리(10, 20)에서 미리 저장될 영역이 설정되어 있을 수 있다.Data stored in the respective memories 10 and 20 may be divided into different memory addresses, and an area to store at least some of the data in each memory 10 and 20 may be set in advance.

아래 표 1은 각 메모리(10, 20)에 저장되는 데이터별로 저장되는 영역과 업데이트, 접근 가능 여부가 설정되는 형태의 일례를 나타낸다.Table 1 below shows an example of a format in which areas to be stored for each data stored in the memories 10 and 20, updates, and accessibility are set.

데이터 구분

data division

저장되는
메모리
영역
saved
Memory
area
유선
리프로그래밍
cable
reprogramming
무선
리프로그래밍
(by OTA)
wireless
reprogramming
(by OTA)
HOST 프로그램에
의한
메모리 접근
to the HOST program
by
memory access
HSM 프로그램에
의한 메모리 접근
to the HSM program
memory access by
By 일반 디버거By Generic Debugger By Security 디버거By Security Debugger ReadRead WriteWrite ReadRead WriteWrite Secure Boot EnableSecure Boot Enable HOST NVMHOST NVM Write 불가Write impossible Write
불가
Write
not possible
Write 불가Write impossible 가능possible 불가not possible 불가not possible 불가not possible
Secure Boot FlagSecure Boot Flag HSM NVMHSM NVM Write 불가Write impossible Write
가능

Write
possible

Write 불가Write impossible 불가not possible 불가not possible 가능possible 가능possible
Host ApplicationHost Application HOST NVMHOST NVM Write 가능Writeable Write 가능Writeable 가능possible 가능possible 가능possible 가능possible 1st_MAC1st_MAC HSM NVMHSM NVM Write 불가Write impossible Write 불가Write impossible 불가not possible 불가not possible 가능possible 가능possible Instant_MACInstant_MAC HSM VMHSM VMs -- -- -- 불가not possible 불가not possible 가능possible 가능possible

표 1에서 NVM은 비휘발성 메모리를, VM은 휘발성 메모리를 각각 의미하며, 보안 디버거는 후술될 보안성이 확보된 디버거를 의미한다. 이하, 각 데이터를 구체적으로 설명한다.In Table 1, NVM means non-volatile memory, VM means volatile memory, respectively, and a secure debugger means a debugger with secured security, which will be described later. Hereinafter, each data will be described in detail.

표 1을 참조하면, 보안 부트 설정(Secure Boot Enable)은 0이나 1로 설정될 수 있으며, 0으로 설정되면 해당 제어기에서 도 2를 참조하여 후술될 보안 부팅 과정이 수행되기 않으며, 1로 설정되면 보안 부팅 과정이 수행될 수 있다. 보안 부팅 설정이 한번 ‘1’로 세팅되면, '1'에서 '0'으로의 데이터 값 변경(Writing)은 어떤 경로로도 절대로 허용되지 않는다.Referring to Table 1, Secure Boot Enable can be set to 0 or 1. If set to 0, the secure boot process to be described later with reference to FIG. 2 is not performed in the corresponding controller. A secure boot process may be performed. Once the secure boot setting is set to ‘1’, data value change (Writing) from ‘1’ to ‘0’ is absolutely not allowed in any path.

보안 부트 플래그(Secure Boot Flag)는 메시지 인증 코드(MAC) 비교를 위해 최초 부팅시 제1 메시지 인증 코드(1st_MAC)를 생성했는지에 대한 여부를 확인하는 플래그이다. 본 플래그는 일반 디버거나 무선(OTA) 업데이트 등 일반적인 경로를 통한 읽기/쓰기를 차단함으로써 데이터의 무결성을 갖게 된다.The secure boot flag is a flag for checking whether or not a first message authentication code (1st_MAC) has been generated at first booting for message authentication code (MAC) comparison. This flag has data integrity by blocking reading/writing through a general path such as a general debugger or over-the-air (OTA) update.

호스트 어플리케이션은 임의의 경로를 통한 접근으로 읽기/쓰기가 가능한 일반적인 어플리케이션 데이터 영역을 의미할 수 있다.The host application may refer to a general application data area capable of reading/writing by accessing through an arbitrary path.

제1 메시지 인증 코드는 호스트 어플리케이션 프로그램과, HSM내 저장된 고유 키 값을 입력으로 하여 HSM 내에 저장된 고유의 암호화 알고리즘을 통해 생성되는(출력되는) 암호화 인증 코드를 의미한다.The first message authentication code refers to an encryption authentication code that is generated (output) through a host application program and a unique encryption algorithm stored in the HSM using, as inputs, a unique key value stored in the HSM.

인스턴트 메시지 인증 코드는 최초 부팅시 제1 메시지 인증 코드가 생성된 이후의 부팅에서 로드된 어플리케이션 데이터를 통해 생성된 메시지 인증 코드를 의미하며, 후술할 보안 부팅 과정에서는 제1 메시지 인증 코드와의 비교를 통해 어플리케이션 데이터의 무결성을 판단할 때 이용된다.The instant message authentication code refers to a message authentication code generated through application data loaded in a boot after the first message authentication code is generated during initial booting. It is used to determine the integrity of application data through

이하에서는, 도 1 및 표 1을 참조하여 상술한 데이터와 데이터별 메모리 설정을 기반으로, 도 2를 참조하여 보안 부팅 과정을 설명한다. 도 2에서 보안 부트 설정은 '1'로 세팅된 상황을 가정한다.Hereinafter, a secure booting process will be described with reference to FIG. 2 based on the data and memory settings for each data described above with reference to FIG. 1 and Table 1. In FIG. 2, it is assumed that the secure boot setting is set to '1'.

도 2를 참조하면, 보안 부트 설정이 '1'로 설정된 상황이므로 보안 부팅 절차가 시작된다. 먼저, HSM 메모리에 최초 부트 플래그(1st Boot Flag)의 설정 여부가 판단될 수 있다(S210). 최초 부트 플래그는 '0'으로 설정되면 보안 부팅 절차가 처음 수행됨을 나타내고, '1'로 설정되면 처음 부팅이 아님을 의미한다.Referring to FIG. 2 , since the secure boot setting is set to '1', the secure boot procedure starts. First, it may be determined whether a first boot flag is set in the HSM memory (S210). When the first boot flag is set to '0', it indicates that the secure boot procedure is performed for the first time, and when set to '1', it means that it is not the first boot.

최초 부트 플래그가 '0'으로 설정된 경우, HSM은 호스트 메모리의 호스트 어플리케이션 프로그램과 HSM 내에 저장된 고유 키 값을 이용하여 제1 메시지 인증 코드를 생성한다(S220).When the initial boot flag is set to '0', the HSM generates a first message authentication code using the host application program in the host memory and the unique key value stored in the HSM (S220).

생성된 제1 메시지 인증 코드는 HSM 메모리의 보안 영역에 저장될 수 있다(S230).The generated first message authentication code may be stored in a secure area of the HSM memory (S230).

제 메시지 인증 코드의 생성 및 저장이 수행됨에 따라, 최초 부트 플래그는 '1'로 설정되며(S240), 시스템은 리셋된다(S280A).As the first message authentication code is generated and stored, the first boot flag is set to '1' (S240), and the system is reset (S280A).

시스템 리셋에 의해 다시 보안 부팅 절차가 개시되되, HSM 메모리에 최초 부트 플래그(1st Boot Flag)가 '1'로 설정되었으므로(S210의 no) HSM은 호스트 메모리의 호스트 어플리케이션 프로그램과 HSM 내에 저장된 고유 키 값을 이용하여 인스턴트 메시지 인증 코드를 생성한다(S250).The secure boot procedure is initiated again by system reset, but since the 1st Boot Flag in the HSM memory is set to '1' (no in S210), the HSM uses the host application program in the host memory and the unique key value stored in the HSM. An instant message authentication code is generated using (S250).

HSM은 인스턴트 메시지 인증 코드를 보안 영역에 저장된 제1 메시지 인증 코드와 비교하여 동일성 여부를 판단한다(S260).The HSM compares the instant message authentication code with the first message authentication code stored in the security area to determine whether or not they are identical (S260).

판단 결과 동일하면 어플리케이션 데이터의 무결성에 이상이 없는 것으로 보아 호스트 시스템을 정상 부팅하며(S280B), 그렇지 않은 경우 기 설정된 회수만큼 인스턴트 메시지 인증 코드의 생성과 비교를 반복한다(S270).If the result of the determination is the same, it is considered that there is no abnormality in the integrity of the application data, and the host system is normally booted (S280B).

만일, 기 설정된 회수만큼 인스턴트 메시지 인증 코드의 생성과 비교를 반복해도 무결성이 확보되지 않는 경우, HSM은 호스트 시스템을 리셋한다(S280C).If integrity is not secured even after repeating instant message authentication code generation and comparison a preset number of times, the HSM resets the host system (S280C).

도 2를 참조하여 설명한 보안 부팅 과정을, 도 3 내지 도 5를 참조하여 메모리 변화 관점에서 설명한다.The secure booting process described with reference to FIG. 2 will be described in terms of memory change with reference to FIGS. 3 to 5 .

도 3 내지 도 5는 일반적인 보안 부팅 과정에서 메모리 상태들의 일례를 나타낸다.3 to 5 show examples of memory states in a general secure booting process.

먼저 도 3을 참조하면, 일반적인 HSM 기능이 적용된 제어기(100)의 메모리 상태가 도시된다. 도 3에 도시된 제어기(100)의 메모리는 어플리케이션(13), 최초 부트 플래그(31), 부팅시 어플리케이션(13)이 로드되는 인스턴트 어플리케이션(33), 인스턴트 메시지 인증 코드(MAC)(25), 제1 메시지 인증 코드(23)가 각각 저장되는 영역을 포함할 수 있다.Referring first to FIG. 3 , a memory state of the controller 100 to which a general HSM function is applied is shown. The memory of the controller 100 shown in FIG. 3 includes an application 13, an initial boot flag 31, an instant application 33 in which the application 13 is loaded during booting, an instant message authentication code (MAC) 25, It may include an area where each of the first message authentication codes 23 is stored.

먼저, 제어기(100)의 메모리가 도 3의 상단과 같이 최초 부트 플래그가 0인 상태에서 보안 부팅 과정이 개시됨에 따라, 도 3의 중단과 같이 어플리케이션(13)이 인스턴트 어플리케이션(33)으로 로드되면서 그(33)를 기반으로 제1 MAC(23)이 생성되어 저장될 수 있다. 또한, 최초 부트 플래그(31)는 1로 설정되고 호스트 시스템은 리셋된다.First, as the memory of the controller 100 initiates a secure booting process in a state where the first boot flag is 0 as shown in the top of FIG. 3, the application 13 is loaded as an instant application 33 as shown in the interruption of FIG. Based on the 33, the first MAC 23 may be generated and stored. Also, the initial boot flag 31 is set to 1 and the host system is reset.

리셋 이후, 재부팅시 도 3의 하단과 같이 최초 부트 플래그(31)가 1로 설정되기 때문에 로드된 인스턴트 어플리케이션(33)을 기반으로 인스턴트 MAC(25)이 생성되며, 인스턴트 MAC(25)이 제1 MAC(23)과 동일한 경우 정상적으로 보안 부팅 과정이 완료된다.After reset, when rebooting, as shown in the lower part of FIG. If the MAC 23 is the same, the secure booting process is normally completed.

만일, 최초 부팅 이후(즉, 최초 부트 플래그=1) 호스트 시스템의 어플리케이션이 무단으로 변조된(strange) 경우에는 도 4와 같이 로드된 인스턴트 어플리케이션(33)을 기반으로 생성된 인스턴트 MAC(25)이 제1 MAC(23)과 동일하지 않을 것이므로, 부팅은 중단된다.If, after the first boot (ie, the first boot flag = 1), the application of the host system is tampered with without permission (strange), the instant MAC 25 created based on the loaded instant application 33 as shown in FIG. Since it will not be the same as the first MAC 23, booting is aborted.

따라서, 어플리케이션의 무결성이 보장될 수 있다.Thus, the integrity of the application can be guaranteed.

그런데, 향후 미래 모빌리티 적용 증가로 인해 양산 이후 무선(OTA: Over The Air) 통한 어플리케이션의 업데이트 수요가 매우 증가할 것으로 예상된다. 그러나, 이처럼 HSM이 적용된 제어기에서는 OTA 방식의 업데이트가 적용되기 어렵다. 이러한 문제점을 도 5를 참조하여 설명한다.However, due to the increasing application of future mobility in the future, it is expected that the demand for updating applications through over-the-air (OTA) will increase significantly after mass production. However, it is difficult to apply the OTA method update to the HSM-applied controller. This problem will be described with reference to FIG. 5 .

최초 부팅 이후(즉, 최초 부트 플래그=1) 호스트 시스템의 어플리케이션이 정상적으로 업데이트된(New) 경우라도, 최초 부트 플래그(31)를 0으로 리셋하지 않는 이상 이전(Legacy) 어플리케이션을 기반으로 생성된 제1 MAC(23)으로 인해 도 5와 같이 로드된 인스턴트 어플리케이션(33)을 기반으로 생성된 인스턴트 MAC(25)이 제1 MAC(23)과 동일하지 않을 것이므로, 부팅은 중단된다.Even if the application of the host system is normally updated (New) after the first boot (ie, the first boot flag = 1), the first boot flag 31 is not reset to 0. Because of the 1 MAC 23, since the instant MAC 25 generated based on the loaded instant application 33 as shown in FIG. 5 will not be the same as the first MAC 23, booting is stopped.

표 1을 참조하여 전술한 바와 같이, 최초 부트 플래그는 보안성이 확보된 디버거, 예컨대, JTAG 디버거(JTAG(Joint Test Action Group) 장비를 통하지 않고는 리셋될 수 없다.As described above with reference to Table 1, the initial boot flag cannot be reset without using a security-secured debugger, for example, a JTAG debugger (Joint Test Action Group (JTAG) device).

결국, 제어기가 생산된 이후 일반적으로 JTAG 디버거 접근이 가능한 장소는 A/S 센터뿐이므로, 무선 업데이트를 성공적으로 마쳤다고 하여도 해당 제어기의 업데이트된 어플리케이션이 정상 동작하기 위해서는 운전자가 A/S 센터를 반드시 방문해야 하는 불편함이 있다.After all, since the A/S center is generally the only place where the JTAG debugger can be accessed after the controller is produced, even if the wireless update is successfully completed, the driver must visit the A/S center in order for the updated application of the controller to operate normally. It is inconvenient to visit.

본 발명은 보안을 유지하면서 무선 업데이트가 가능한 차량용 제어기 및 그 제어 방법을 제공하기 위한 것이다.An object of the present invention is to provide a controller for a vehicle capable of wireless update while maintaining security and a control method thereof.

본 발명에서 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급하지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical problems to be achieved in the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art from the description below. You will be able to.

상기와 같은 과제를 해결하기 위해 본 발명의 일 실시예에 따른 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법은, 호스트 어플리케이션을 기반으로 생성된 제1 메시지 인증 코드가 제1 메모리 영역에 저장된 후 제1 리셋되는 단계; 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드를 호스트 어플리케이션이 저장되는 제2 메모리 영역에 주입되는 단계; 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제2 메시지 인증 코드가 생성되고, 제3 메모리 영역에 저장된 후 제2 리셋되는 단계; 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제3 메시지 인증 코드가 생성되면, 상기 제3 메시지 인증 코드와 상기 제3 메모리 영역에 저장된 상기 제2 메시지 인증 코드가 제1 비교되고, 상기 제2 메모리 영역에 주입된 상기 제1 메시지 인증 코드와 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드가 제2 비교되는 단계; 및 상기 제1 비교의 결과 및 상기 제2 비교의 결과가 모두 동일할 경우 호스팅 시스템이 부팅되는 단계를 포함할 수 있다.In order to solve the above problems, a method for secure booting of a controller including a hardware security module according to an embodiment of the present invention includes storing a first message authentication code generated based on a host application in a first memory area, and then storing a first message authentication code in a first memory area. Step 1 being reset; injecting the first message authentication code of the first memory area into a second memory area storing a host application; generating a second message authentication code based on the first application data into which the first message authentication code is injected, storing the second message authentication code in a third memory area, and performing a second reset; When a third message authentication code is generated based on the first application data into which the first message authentication code is injected, a first comparison is performed between the third message authentication code and the second message authentication code stored in the third memory area. and performing a second comparison between the first message authentication code injected into the second memory area and the first message authentication code in the first memory area; and booting the hosting system when the result of the first comparison and the result of the second comparison are identical.

또한, 본 발명의 일 실시예에 따른 차량용 제어기는, 적어도 호스트 어플리케이션을 저장하는 제1 메모리; 및 상기 호스트 어플리케이션에 의한 접근이 불가한 제2 메모리를 포함하는 하드웨어 보안 모듈(HSM)을 포함하되, 상기 하드웨어 보안 모듈은 상기 호스트 어플리케이션을 기반으로 제1 메시지 인증 코드를 생성하여 상기 제2 메모리의 제1 영역에 저장한 후 호스트 시스템을 제1 리셋시키고, 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드를 상기 제1 메모리 중 상기 호스트 어플리케이션이 저장되는 제2 영역에 주입하며, 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제2 메시지 인증 코드를 생성하여, 상기 제2 메모리의 제3 영역에 저장한 후 제2 리셋시키고, 상기 제1 메시지 인증 코드가 주입된 상기 제1 어플리케이션 데이터를 기반으로 제3 메시지 인증 코드를 생성하여, 상기 제3 메시지 인증 코드와 상기 제3 영역에 저장된 상기 제2 메시지 인증 코드를 제1 비교하고, 상기 제2 영역에 주입된 상기 제1 메시지 인증 코드와 상기 제1 영역의 상기 제1 메시지 인증 코드를 제2 비교하며, 상기 제1 비교의 결과 및 상기 제2 비교의 결과가 모두 동일할 경우 상기 호스팅 시스템을 부팅시킬 수 있다.In addition, a vehicle controller according to an embodiment of the present invention includes a first memory for storing at least a host application; and a hardware security module (HSM) including a second memory that cannot be accessed by the host application, wherein the hardware security module generates a first message authentication code based on the host application to determine the location of the second memory. After storing in the first area, the host system is first reset, and the first message authentication code of the first memory area is injected into the second area of the first memory where the host application is stored. A second message authentication code is generated based on the first application data into which the authentication code has been injected, stored in a third area of the second memory, and then reset, and the second message authentication code into which the first message authentication code is injected. 1 A third message authentication code is generated based on application data, a first comparison is made between the third message authentication code and the second message authentication code stored in the third area, and the first message authentication code injected into the second area is compared. A second comparison is performed between the message authentication code and the first message authentication code of the first area, and when the results of the first comparison and the second comparison are identical, the hosting system may be booted.

본 발명의 적어도 일 실시예에 의하면, 다음과 같은 효과가 있다.According to at least one embodiment of the present invention, there are the following effects.

차량용 네트워크에서 보안성과 업데이트 편의성이 모두 제공될 수 있다.Both security and update convenience can be provided in an in-vehicle network.

특히, 본 발명은 하드웨어 보안 모듈이 적용된 제어기에서 무선 업데이트가 수행되더라도 서비스 센터 방문 없이 정상적으로 업데이트된 어플리케이션의 무결성 검증이 수행될 수 있다.In particular, according to the present invention, even if a wireless update is performed in a controller to which a hardware security module is applied, integrity verification of a normally updated application can be performed without visiting a service center.

본 발명에서 얻은 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The effects that can be obtained in the present invention are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the description below. will be.

도 1은 일반적인 HSM을 구비한 제어기의 메모리 구성의 일례를 나타낸다.
도 2는 일반적인 HSM을 구비한 제어기의 부팅 절차의 일례를 나타내는 순서도이다.
도 3 내지 도 5는 일반적인 보안 부팅 과정에서 메모리 상태들의 일례를 나타낸다.
도 6은 본 발명의 일 실시예에 따른 하드웨어 보안 모듈이 적용된 제어기의 메모리 구조의 일례를 나타낸다.
도 7a 및 도 7b는 본 발명의 일 실시예에 따른 보안 부팅 과정의 일례를 나타내는 순서도이다.
도 8 내지 도 17은 도 7a 및 도 7b에 도시된 과정들이 수행될 때 제어기의 메모리 상태가 변경되는 형태를 설명하기 위한 도면이다.
1 shows an example of a memory configuration of a controller with a general HSM.
2 is a flowchart illustrating an example of a booting procedure of a controller having a general HSM.
3 to 5 show examples of memory states in a general secure booting process.
6 shows an example of a memory structure of a controller to which a hardware security module according to an embodiment of the present invention is applied.
7A and 7B are flowcharts illustrating an example of a secure booting process according to an embodiment of the present invention.
8 to 17 are views for explaining how the memory state of the controller is changed when the processes shown in FIGS. 7A and 7B are performed.

이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시 예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다.Hereinafter, the embodiments disclosed in this specification will be described in detail with reference to the accompanying drawings, but the same or similar elements are given the same reference numerals regardless of reference numerals, and redundant description thereof will be omitted. The suffixes "module" and "unit" for components used in the following description are given or used together in consideration of ease of writing the specification, and do not have meanings or roles that are distinct from each other by themselves.

또한, 본 명세서에 개시된 실시 예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시 예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시 예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.In addition, in describing the embodiments disclosed in this specification, if it is determined that a detailed description of a related known technology may obscure the gist of the embodiment disclosed in this specification, the detailed description thereof will be omitted. In addition, the accompanying drawings are only for easy understanding of the embodiments disclosed in this specification, the technical idea disclosed in this specification is not limited by the accompanying drawings, and all changes included in the spirit and technical scope of the present invention , it should be understood to include equivalents or substitutes.

본 발명의 일 실시예에 의하면, 하드웨어 보안 모듈(HSM)이 적용된 제어기에서 별도의 디버거 연결 없이도 업데이트된 어플레이션의 무결성 검증이 가능하도록, 두 개의 부트 플래그와, 두 개의 메시지 인증 코드를 보안 영역에 저장하되, 호스트 메모리의 어플리케이션에도 메시지 인증 코드를 주입할 것을 제안한다. 이를 위한 메모리 구조를 도 6 및 표 2를 참조하여 설명한다.According to an embodiment of the present invention, in a controller to which a hardware security module (HSM) is applied, two boot flags and two message authentication codes are stored in a security area so that the integrity of an updated application can be verified without a separate debugger connection. However, it is suggested to inject the message authentication code into the application in the host memory as well. A memory structure for this will be described with reference to FIG. 6 and Table 2.

도 6은 본 발명의 일 실시예에 따른 하드웨어 보안 모듈이 적용된 제어기의 메모리 구조의 일례를 나타내고, 표 2는 일 실시예에 따른 메모리 구성의 설정을 나타낸다.6 shows an example of a memory structure of a controller to which a hardware security module according to an embodiment of the present invention is applied, and Table 2 shows memory configuration settings according to an embodiment.

먼저, 도 6을 참조하면 HSM을 구비한 제어기는 적어도 호스트 메모리(210)와 HSM 메모리(220)를 포함할 수 있다. 여기서, 호스트 메모리(210)는 HSM을 이용한 보안 부팅의 설정 여부를 나타내는 보안 부트 설정(Secure Boot Enable, 211)과 제어기 구동용 어플리케이션과 관련 데이터를 저장하는 호스트 어플리케이션 프로그램 및 데이터(213)를 저장할 수 있다. 또한, 호스트 메모리(210)에는 호스트 어플리케이션 프로그램 및 데이터(213)와 함께 메시지 인증 코드(즉, 주입 MAC)가 주입될 수 있는 영역(215)과, 호스트 어플리케이션 프로그램이 업데이트될 경우 업데이트 전에 설치되어 있던 호스트 어플리케이션 프로그램과 데이터를 백업할 수 있는 영역(217)이 더 준비될 수 있다.First, referring to FIG. 6 , a controller having an HSM may include at least a host memory 210 and an HSM memory 220 . Here, the host memory 210 may store a secure boot enable 211 indicating whether secure booting using HSM is set, and a host application program and data 213 that stores an application for driving a controller and related data. there is. In addition, the host memory 210 includes an area 215 into which a message authentication code (ie, injection MAC) can be injected together with the host application program and data 213, and when the host application program is updated, the host application program and data 213 are installed before the update. An area 217 capable of backing up host application programs and data may be further prepared.

한편, HSM 메모리(220)는 보안 부트 플래그(Secure Boot Flag, 221), 제1 메시지 인증 코드(1st_MAC, 223) 및 인스턴트 메시지 인증 코드(Instant_MAC, 225)를 저장할 수 있다. 또한, HSM 메모리(220)는 호스트 메모리(210)에 메시지 인증 코드가 주입되었는지 여부를 나타내는 MAC 주입 플래그(MAC_Injection_Flag, 227), 제2 보안 부트 플래그(226) 및 제2 메지시 인증 코드(228)를 더 저장할 수 있다.Meanwhile, the HSM memory 220 may store a secure boot flag (Secure Boot Flag, 221), a first message authentication code (1st_MAC, 223), and an instant message authentication code (Instant_MAC, 225). In addition, the HSM memory 220 includes a MAC injection flag (MAC_Injection_Flag, 227) indicating whether a message authentication code has been injected into the host memory 210, a second secure boot flag 226, and a second message authentication code 228 can store more.

각 메모리(210, 220)에 저장되는 데이터는 서로 다른 메모리 주소로 구분될 수 있으며, 데이터 중 적어도 일부는 각 메모리(210, 220)에서 미리 저장될 영역이 설정되어 있을 수 있다.Data stored in the respective memories 210 and 220 may be divided into different memory addresses, and an area to store at least some of the data in each memory 210 and 220 may be set in advance.

아래 표 2는 각 메모리(210, 220)에 저장되는 데이터별로 저장되는 영역과 업데이트, 접근 가능 여부가 설정되는 형태의 일례를 나타낸다.Table 2 below shows an example of a format in which areas to be stored for each data stored in the memories 210 and 220, updates, and accessibility are set.

데이터 구분data division 저장되는
메모리
영역
saved
Memory
area
유선
리프로그래밍
cable
reprogramming
무선
리프로그래밍
wireless
reprogramming
HOST프로그램에 의한
메모리 접근
by HOST program
memory access
HSM 프로그램에 의한
메모리 접근
by the HSM program
memory access
참조reference
By 일반
디버거
By general
debugger
By 보안 디버거By Security Debugger ReadRead WriteWrite ReadRead WriteWrite
Secure Boot EnableSecure Boot Enable HOST NVMHOST NVM Write
불가
Write
not allowed
Write
불가
Write
not allowed
Write
불가
Write
not possible
가능possible 불가not possible 불가not possible 불가not possible 표 1과
동일
Table 1 and
same
Secure Boot FlagSecure Boot Flag HSM NVMHSM NVM Write
불가
Write
not allowed
Write
가능
Write
possible
Write
불가
Write
not allowed
불가not possible 불가not possible 가능possible 가능possible
Host ApplicationHost Application HOST NVMHOST NVM Write
가능
Write
possible
Write
가능
Write
possible
가능possible 가능possible 가능possible 가능possible
1st_MAC1st_MAC HSM NVMHSM NVM Write
불가
Write
not allowed
Write
불가
Write
not possible
불가not possible 불가not possible 가능possible 가능possible
Instant_MACInstant_MAC HSM VMHSM VMs -- -- -- 불가not possible 불가not possible 가능possible 가능possible Injected_MACInjected_MAC HOST NVMHOST NVM Write
가능
Write
possible
Write
가능
Write
possible
Write
가능
Write
possible
가능possible 가능possible 가능possible 가능possible
실시예
copy
Example
Host ApplicationHost Application HOST NVMHOST NVM Write
가능
Write
possible
Write
가능
Write
possible
Write
가능
Write
possible
가능possible 가능possible 가능possible 가능possible
Back upBack up 2nd Secure Boot Flag2nd Secure Boot Flag HSM NVMHSM NVM Write
불가
Write
not allowed
Write
가능
Write
possible
Write
불가
Write
not allowed
불가not possible 불가not possible 가능possible 가능possible
MAC_InjectionMAC_Injection
_Flag_Flag
HSM NVMHSM NVM Write
불가
Write
not allowed
Write
가능
Write
possible
Write
불가
Write
not allowed
불가not possible 불가not possible 가능possible 가능possible
2nd_MAC2nd_MAC HSM NVMHSM NVM Write
불가
Write
not allowed
Write
가능
Write
possible
Write
불가
Write
not allowed
불가not possible 불가not possible 가능possible 가능possible

표 2에서 보안 부트 설정, 보안 부트 블래그, 호스트 어플리케이션, 제1 MAC 및 인스턴트 MAC에 대한 설명은 표 1과 동일한 바, 생략하기로 한다.In Table 2, descriptions of the secure boot configuration, secure boot block, host application, first MAC, and instant MAC are the same as in Table 1, and thus are omitted.

주입 MAC(Injected_MAC, 215)은 HSM이 생성한 MAC을 호스트 어플리케이션 영역(213) 내부에 넣기 위한 메모리 영역이다. 이때, HOST와 HSM은 주입 MAC이 저장되는 영역(215)에 대해 동일한 메모리 주소로 인지하는 것이 바람직하다. 또한, 호스트는 해당 영역(215)에 어플리케이션 데이터를 기록하지 말고 유보(Reserved)해 두어야 하며, HSM은 해당 영역에 생성된 MAC을 주입(Write)할 수 있다.An injected MAC (Injected_MAC, 215) is a memory area for inserting the MAC generated by the HSM into the host application area 213. At this time, it is preferable that the HOST and the HSM recognize the same memory address for the area 215 where the injected MAC is stored. In addition, the host should not record the application data in the corresponding area 215 but reserve it, and the HSM may inject (write) the generated MAC into the corresponding area.

호스트 어플리케이션 백업(Host Application back up) 영역(217)은 임의의 경로로 접근하여 읽기/쓰기가 가능한 일반적인 어플리케이션 데이터 영역일 수 있다. 다만, 정상적인 사용자에 의해 안전하게 어플리케이션을 리프로그래밍 하는 경우 반드시 정상 사용자는 신(New) 버전의 어플리케이션과 더불어, 이전 버전(Legacy)의 어플리케이션을 본 영역에 저장하여야 한다. 여기서, 호스트 어플리케이션 백업 영역(217)에 이전 버전의 어플리케이션을 저장할 수 있음은, 그 자체가 정상적인 사용자에 의해 접근되었음을 의미하며, 본 실시예에서 해당 영역(217)에 저장된 이전 버전의 어플리케이션은 HSM에 의해 무결성 여부를 검증받기 위한 대상이 된다. 또한, HOST와 HSM은 본 영역(217)에 대하여 동일한 메모리 주소로 인지하여야 한다.The host application back up area 217 may be a general application data area that can be read/written by accessing an arbitrary path. However, when reprogramming an application safely by a normal user, the normal user must store the application of the previous version (Legacy) in this area along with the application of the new version. Here, being able to store an application of a previous version in the host application backup area 217 means that the application itself has been accessed by a normal user. In this embodiment, the application of a previous version stored in the corresponding area 217 is stored in the HSM It is subject to verification of integrity by In addition, HOST and HSM must recognize the same memory address for this area 217.

제2 보안 부트 플래그(2nd Secure Boot Flag, 또는 제2 부트 플래그)는 MAC이 주입된 어플리케이션 데이터(즉, 213 및 215)를 기반으로 제2 MAC을 생성했는지 여부를 나타내며, 정상 동작시 두 번째 부팅에서 제2 MAC이 생성되므로 두 번째 부팅이 수행되었는지 여부를 지시하는 것으로 볼 수도 있다. 본 데이터는 일반 디버거나 OTA 등의 일반적인 경로를 통한 Read/Write를 못하게 차단함으로서 데이터의 무결성을 갖는다.The 2nd Secure Boot Flag (or 2nd Boot Flag) indicates whether a 2nd MAC was generated based on MAC-injected application data (ie, 213 and 215), and during normal operation, 2nd booting Since the second MAC is generated in , it may be regarded as indicating whether or not the second booting has been performed. This data has data integrity by blocking Read/Write through a general path such as a general debugger or OTA.

MAC 주입 플래그(MAC Injection Flag)는 제1 MAC을 어플리케이션 데이터에 주입했는지 여부를 나타낸다. 제1 MAC이 주입된 어플리케이션은 제2 MAC의 생성 과정을 거치면서 제1 MAC이 잘 주입되었는지에 대한 여부를 다시 한번 더 검증 받게 된다.The MAC Injection Flag indicates whether a first MAC is injected into application data. The application into which the first MAC is injected undergoes a process of generating the second MAC, and whether or not the first MAC has been successfully injected is verified once again.

제2 메시지 인증 코드(또는 제2 MAC, 2nd_MAC)은 제1 MAC이 주입된 어플리케이션을 대상으로 재차 생성한 MAC을 의미하며, 어플리케이션의 갱신 여부를 검증하기 위해 사용될 수 있다.The second message authentication code (or second MAC, 2nd_MAC) refers to a MAC regenerated for the application into which the first MAC is injected, and can be used to verify whether the application is updated.

이하에서는 도 7a 내지 도 17을 참조하여 본 실시예에 따른 보안 부팅 과정을 설명한다. 도 7a 및 도 7b는 본 발명의 일 실시예에 따른 보안 부팅 과정의 일례를 나타내는 순서도이다. 도 7a 및 도 7b에서는 하나의 순서도가 분리되어 도시된다. 또한, 도 8 내지 도 17은 도 7a 및 도 7b에 도시된 과정들이 수행될 때 제어기의 메모리 상태가 변경되는 형태를 설명하기 위한 도면이다.Hereinafter, a secure boot process according to the present embodiment will be described with reference to FIGS. 7A to 17 . 7A and 7B are flowcharts illustrating an example of a secure booting process according to an embodiment of the present invention. In Figures 7a and 7b, one flow chart is shown separately. Also, FIGS. 8 to 17 are diagrams for explaining how the memory state of the controller is changed when the processes shown in FIGS. 7A and 7B are performed.

먼저, 도 7a에서 리프로그래밍이 발생하기 이전 과정을, 도 8을 함께 참조하여 설명한다.First, a process before reprogramming occurs in FIG. 7A will be described with reference to FIG. 8 .

도 8의 상단을 먼저 참조하면, 실시예에 따른 제어기(200)의 메모리는 호스트 어플리케이션 영역(213), MAC 주입 영역(215), 호스트 어플리케이션 백업 영역(217), 최초 부트 플래그(231), 제2 부트 플래그(226), 인스턴트 어플리케이션 영역(233), 인스턴트 MAC 영역(225), 제2 MAC 영역(228), 제1 MAC 영역(223) 및 MAC 주입 플래그(227)를 포함할 수 있다. 별도의 언급이 없는 한, 도 9 내지 도 17에 도시되는 제어기(200)의 메모리는 도 8과 같은 구성을 갖는다.Referring first to the top of FIG. 8 , the memory of the controller 200 according to the embodiment includes a host application area 213, a MAC injection area 215, a host application backup area 217, an initial boot flag 231, a second 2 may include a boot flag 226, an instant application area 233, an instant MAC area 225, a second MAC area 228, a first MAC area 223 and a MAC injection flag 227. Unless otherwise noted, the memory of the controller 200 shown in FIGS. 9 to 17 has the same configuration as in FIG. 8 .

이하의 설명에서 보안 부트 설정은 '1'로 세팅된 상황을 가정한다.In the following description, it is assumed that the secure boot setting is set to '1'.

먼저, 보안 부트 설정이 '1'로 설정된 상황이므로 보안 부팅 절차가 시작된다. 먼저, HSM 메모리에 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227)가 모두 0인지 여부가 판단된다(S701). 도 8의 상단과 같이 모든 플래그가 0이므로, HSM은 도 8의 하단과 같이 인스턴트 어플리케이션 영역(233)에 로드된 호스트 어플리케이션 HSM 내에 저장된 고유 키 값을 이용하여 제1 MAC을 생성한다(S702).First, since the secure boot setting is set to '1', the secure boot process starts. First, it is determined whether the first boot flag 231, the second boot flag 226, and the MAC injection flag 227 in the HSM memory are all 0 (S701). Since all flags are 0 as shown in the upper part of FIG. 8 , the HSM generates a first MAC using the unique key value stored in the host application HSM loaded in the instant application area 233 as shown in the lower part of FIG. 8 (S702).

생성된 제1 MAC은 제1 MAC 영역(223)에 저장될 수 있다(S703).The generated first MAC may be stored in the first MAC area 223 (S703).

제1 MAC의 생성 및 저장이 수행됨에 따라, 최초 부트 플래그(231)는 '1'로 설정되며(S704), 시스템은 리셋된다(S705).As the first MAC is generated and stored, the initial boot flag 231 is set to '1' (S704), and the system is reset (S705).

다음으로, 도 7a와 도 9를 함께 참조하여 다음 과정을 설명한다.Next, the following process will be described with reference to FIGS. 7A and 9 together.

시스템 리셋에 의해 다시 보안 부팅 절차가 개시되므로 다시 HSM 메모리에 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227)가 모두 0인지 여부가 판단되며(S701), HSM 메모리에 최초 부트 플래그(231)가 '1'로 설정되었으므로(no), HSM 메모리에 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227) 중 최초 부트 플래그(231)만 1인지 여부가 판단된다(S711).Since the secure boot procedure is initiated again by system reset, it is determined whether the initial boot flag 231, the second boot flag 226, and the MAC injection flag 227 are all 0 in the HSM memory (S701), and Since the first boot flag 231 is set to '1' (no), only the first boot flag 231 among the first boot flag 231, the second boot flag 226, and the MAC injection flag 227 is stored in the HSM memory. 1 is determined (S711).

HSM 메모리에 최초 부트 플래그(231)가 '1'로 설정되었으므로(yes), HSM은 제1 MAC을 주입 MAC 영역(215)에 주입한다(S712).Since the initial boot flag 231 is set to '1' in the HSM memory (yes), the HSM injects the first MAC into the injection MAC area 215 (S712).

주입된 제1 MAC은 다시 인스턴트 MAC 영역(225)에 로드되며(S713), 인스턴트 MAC 영역(225)에 로드된 제1 MAC은 제1 MAC 영역(223)에 저장된 MAC과 비교되어(S714), 동일한 경우 제1 MAC이 정상적으로 주입된 것으로 판단하여 MAC 주입 플래그(227)가 1로 설정된다. 만일, 비교(S714)결과가 동일하지 않은 경우 기 설정된 횟수만큼 S712 단계 내지 S714 단계가 반복되며(S716), 기 설정된 횟수를 초과한 경우 제1 MAC의 주입이 실패한 것으로 판단되어 호스트 시스템의 부팅은 제한된다(S717).The injected first MAC is loaded into the instant MAC area 225 again (S713), and the first MAC loaded into the instant MAC area 225 is compared with the MAC stored in the first MAC area 223 (S714). In the same case, it is determined that the first MAC is normally injected, and the MAC injection flag 227 is set to 1. If the result of the comparison (S714) is not the same, steps S712 to S714 are repeated a preset number of times (S716), and if the preset number is exceeded, it is determined that the injection of the first MAC has failed and the host system boots It is limited (S717).

다음으로, 도 7a와 도 10을 함께 참조하여 그 다음 과정을 설명한다.Next, the next process will be described with reference to FIGS. 7A and 10 together.

제1 MAC의 주입에 성공한 경우, 즉, MAC 주입 플래그가 1로 설정된 후(S715) HSM은 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227) 중 제2 부트 플래그(226)만 0인지 여부를 판단한다(S721).If the injection of the first MAC is successful, that is, after the MAC injection flag is set to 1 (S715), the HSM selects the first boot flag 231, the second boot flag 226, and the second boot flag among the MAC injection flags 227. It is determined whether only (226) is 0 (S721).

제2 부트 플래그(226)만 0인 경우, HSM은 인스턴트 어플리케이션 영역(223)에 로드된 제1 MAC이 주입된 호스트 어플리케이션을 기반으로 제2 MAC을 생성하고(S722), 이를 제2 MAC 영역(228)에 저장한다(S723). 이후 HSM은 제2 부트 플래그(226)를 1로 설정하고(S724), 호스트 시스템을 리셋한다(S725).When only the second boot flag 226 is 0, the HSM generates a second MAC based on the host application into which the first MAC loaded in the instant application area 223 is injected (S722), and generates the second MAC area (S722). 228) (S723). Thereafter, the HSM sets the second boot flag 226 to 1 (S724) and resets the host system (S725).

호스트 시스템이 리셋되면, 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227) 모두가 1로 설정되므로 S701 단계, S711 단계 및 S721 단계를 거쳐 도 7b의 S731 단계로 진행된다.When the host system is reset, the initial boot flag 231, the second boot flag 226, and the MAC injection flag 227 are all set to 1, so the process proceeds to step S731 of FIG. 7B through steps S701, S711, and S721. do.

이하에서는 도 7b와 도 11을 함께 참조하여 이어지는 과정을 설명한다.Hereinafter, a subsequent process will be described with reference to FIGS. 7B and 11 together.

먼저 HSM은 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227) 모두가 1인지 여부를 판단한다(S731). 모든 플래그가 1인 경우, HSM은 HSM은 인스턴트 어플리케이션 영역(223)에 로드된 제1 MAC이 주입된 호스트 어플리케이션을 기반으로 인스턴트 MAC(225)을 생성할 수 있다(S732).First, the HSM determines whether all of the initial boot flag 231, the second boot flag 226, and the MAC injection flag 227 are 1 (S731). If all flags are 1, the HSM may generate an instant MAC 225 based on the host application loaded with the first MAC loaded into the instant application area 223 (S732).

HSM은 주입된 MAC(215)과 제1 MAC(223)의 동일성 및 제2 MAC(223)과 생성된 인스턴트 MAC(225)의 동일성을 각각 판단하고(S733), 서로 동일한 경우 호스트 어플리케이션의 무결성이 검증된 것으로 보아 호스트 시스템을 정상 부팅한다(S735).The HSM determines the identity of the injected MAC 215 and the first MAC 223 and the identity of the second MAC 223 and the generated instant MAC 225 (S733), and if they are identical, the integrity of the host application is Considering that it has been verified, the host system is normally booted (S735).

만일, S731 단계에서 모든 플래그가 1이 아니라면, HSM은 비정상 상황으로 판단하여 호스트 시스템의 부팅을 제한시킬 수 있다(S741).If all of the flags are not 1 in step S731, the HSM determines that the situation is abnormal and may restrict booting of the host system (S741).

다음으로, 호스트 시스템의 어플리케이션이 업데이트된 경우의 보안 부팅 과정을 도 7b 및 도 12 내지 도 15를 함께 참조하여 설명한다. 도 12 내지 도 15에서는 업데이트 방식에 무관하게, 호스트 어플리케이션이 정상적인 경로로 업데이트가 완료된 것으로 가정한다.Next, a secure booting process when an application of the host system is updated will be described with reference to FIGS. 7B and 12 to 15 together. 12 to 15 , it is assumed that the update is completed through the normal path of the host application regardless of the update method.

먼저, 도 7b와 도 12를 함께 참조하면, 호스트 어플리케이션의 업데이트에 따라 호스트 어플리케이션 영역(213)에는 업데이트된(NeW) 어플리케이션 데이터가 저장되고, 백업 어플리케이션 영역(217)에는 이전에 설치되었던(Legacy) 어플리케이션 데이터가 저장될 수 있다. 또한, 주입 MAC 영역(215)은 업데이트로 인해 비워지게 된다.First, referring to FIG. 7B and FIG. 12 together, according to the update of the host application, updated (NeW) application data is stored in the host application area 213, and previously installed (legacy) data is stored in the backup application area 217. Application data may be stored. In addition, the injected MAC area 215 is emptied due to updates.

부팅이 시작될 경우, 모든 플래그가 1이기 때문에 S731 단계에서 인스턴트 어플리케이션 영역(233)에 로드된 어플리케이션 데이터를 이용한 인스턴트 MAC(225) 생성이 수행된다(S732).When booting starts, since all flags are 1, an instant MAC 225 is created using the application data loaded in the instant application area 233 in step S731 (S732).

그런데, S733 단계에서는 주입 MAC 영역(215)이 비어있으므로 제1 MAC(223)과의 비교 결과가 상이하게되며, 제2 MAC(228) 또한 이전 버전의 어플리케이션 데이터와 주입된 MAC을 기반으로 생성되었기 때문에 인스턴트 MAC 영역(225)의 업데이트된 데이터 기반의 MAC과 상이하게 된다(즉, S733 단계의 no).However, since the injection MAC area 215 is empty in step S733, the comparison result with the first MAC 223 is different, and the second MAC 228 is also generated based on the application data of the previous version and the injected MAC. Therefore, it is different from the updated data-based MAC of the instant MAC area 225 (ie, no in step S733).

다음 과정은 도 7b와 도 13 및 도 14를 함께 참조하여 설명한다.The following process will be described with reference to FIG. 7B and FIGS. 13 and 14 together.

기 설정된 횟수만큼 인스턴트 MAC의 생성과 비교 과정이 반복된 후에도 무결성 검증이 실패하면(S734의 no), 도 13에 도시된 바와 같이 HSM은 백업 어플리케이션 영역(217)에 저장된 이전 버전(Legacy)의 어플리케이션 프로그램을 기반으로 MAC(225)을 생성하고(S751), 이를 저장된 제1 MAC(223)과 비교한다(S752). 이는 전술한 바와 같이, 백업 어플리케이션 영역(217)에 이전 버전의 어플리케이션 데이터가 저장되어 있음은 정상적인 유저에 의한 업데이트를 의미함을 전제로 한다.If integrity verification fails (no in S734) even after the instant MAC generation and comparison process is repeated a set number of times, as shown in FIG. 13, the HSM uses the legacy application stored in the backup application area 217. A MAC 225 is generated based on the program (S751) and compared with the stored first MAC 223 (S752). As described above, it is assumed that the fact that application data of a previous version is stored in the backup application area 217 means an update by a normal user.

비교 결과 동일한 경우, 도 14에 도시된 바와 같이 HSM은 최초 부트 플래그(231), 제2 부트 플래그(226) 및 MAC 주입 플래그(227)를 모두 0으로 설정할 수 있다(S755). 또한, HSM은 백업 어플리케이션 영역(217)의 데이터 또한 소거할 수 있으며(S756), 제1 MAC(223) 및 제2 MAC(228)도 삭제할 수 있다(S757). 이후, 호스트 시스템은 리셋될 수 있다(S758).If the comparison result is the same, as shown in FIG. 14, the HSM may set all of the first boot flag 231, the second boot flag 226, and the MAC injection flag 227 to 0 (S755). In addition, the HSM may also delete the data of the backup application area 217 (S756), and may also delete the first MAC 223 and the second MAC 228 (S757). After that, the host system may be reset (S758).

다음 과정은 도 7a 및 도 15를 함께 참조하여 설명한다.The following process will be described with reference to FIGS. 7A and 15 together.

호스트 시스템의 리셋에 따라, 도 7a의 S701 과정이 다시 시작될 수 있다. 다만, 이전에(S755) 모든 플래그가 0으로 설정되었으므로 HSM 은 다시 S702 단계부터 S705 단계를 수행하게 된다. 따라서, 도 15에 도시된 바와 같이 업데이트된 어플리케이션이 인스턴트 어플리케이션 영역(233)에 로드되어 제1 MAC이 생성되고 저장될 수 있으며, 최초 부트 플래그(231)는 1로 설정된다. 이후의 과정은 어플리케이션 데이터가 새로운 버전이라는 점을 제외하면, 이전(Legacy) 버전을 기준으로 전술한 바와 같으므로 중복되는 기재는 생략하기로 한다.According to the reset of the host system, the process of S701 of FIG. 7A may be started again. However, since all flags were previously set to 0 (S755), the HSM performs steps S702 to S705 again. Accordingly, as shown in FIG. 15 , an updated application may be loaded into the instant application area 233 to generate and store a first MAC, and the initial boot flag 231 is set to 1. Subsequent processes are the same as those described above based on the legacy version, except that the application data is a new version, so duplicate descriptions will be omitted.

이하에서는 도 7a와 도 16 및 도 17을 함께 참조하여 비정상적인 방법으로 호스트 어플리케이션이 변조된 경우의 HSM 동작 과정을 설명한다.Hereinafter, an HSM operation process when a host application is modulated in an abnormal manner will be described with reference to FIG. 7A and FIGS. 16 and 17 together.

먼저, 도 7b와 도 16을 함께 참조하면, 호스트 어플리케이션이 비정상적인 과정을 통해 변조됨에 따라, 호스트 어플리케이션 영역(213)에는 변조된(Strange) 어플리케이션 데이터가 저장될 수 있다. 또한, 주입 MAC 영역(215)과 백업 어플리케이션 영역(217)은 비워져 있거나 임의의 비정상 데이터가 기록된 상태일 수 있다.First, referring to FIG. 7B and FIG. 16 together, as the host application is modulated through an abnormal process, the host application area 213 may store strange application data. In addition, the injection MAC area 215 and the backup application area 217 may be empty or may be in a state in which abnormal data is recorded.

부팅이 시작될 경우, 모든 플래그가 1이기 때문에 S731 단계에서 인스턴트 어플리케이션 영역(233)에 로드된 변조된 어플리케이션 데이터를 이용한 인스턴트 MAC(225) 생성이 수행된다(S732).When booting starts, since all flags are 1, an instant MAC 225 is generated using modulated application data loaded in the instant application area 233 in step S731 (S732).

그런데, S733 단계에서는 주입 MAC 영역(215)이 비어있거나 비정상 데이터가 기록되어 있으므로 제1 MAC(223)과의 비교 결과가 상이하게되며, 제2 MAC(228) 또한 이전 버전의 어플리케이션 데이터와 주입된 MAC을 기반으로 생성되었기 때문에 인스턴트 MAC 영역(225)의 변조된 데이터 기반의 MAC과 상이하게 된다(즉, S733 단계의 no).However, in step S733, since the injection MAC area 215 is empty or abnormal data is recorded, the result of comparison with the first MAC 223 is different, and the second MAC 228 is also injected with the application data of the previous version. Since it is generated based on the MAC, it is different from the MAC based on the modulated data of the instant MAC area 225 (ie, no in step S733).

다음 과정은 도 7b와 도 17을 함께 참조하여 설명한다.The following process will be described with reference to FIGS. 7B and 17 together.

기 설정된 횟수만큼 인스턴트 MAC의 생성과 비교 과정이 반복된 후에도 무결성 검증이 실패하면(S734의 no), 도 17에 도시된 바와 같이 HSM은 백업 어플리케이션 영역(217)에 저장된 임의의 비정상(Strange) 데이터를 기반으로 MAC(225)을 생성하고(S751), 이를 저장된 제1 MAC(223)과 비교한다(S752).If integrity verification fails even after repeating the instant MAC generation and comparison process a preset number of times (no in S734), as shown in FIG. A MAC 225 is generated based on (S751) and compared with the stored first MAC 223 (S752).

비교 결과 상이할 것이므로, HSM은 기 설정된 횟수만큼 S751 단계 및 S752 단계를 수행하고(S753), 기 설정된 재시도 회수를 초과한 경우 호스트 시스템의 부팅을 제한할 수 있다(S754).Since the comparison result will be different, the HSM may perform steps S751 and S752 as many times as the preset number (S753), and may limit booting of the host system if the preset number of retries is exceeded (S754).

지금까지 설명한 실시예에 따른 제어기가 적용될 경우, 양산 이후 어플리케이션 업데이트가 발생하더라도 JTAG 디버거 등 특정 형태의 유선 보안 연결 없이도 정상적인 보안 부팅 절차가 수행될 수 있다. 따라서, 고객 입장에서는 무선 업데이트가 수행되더라도 서비스 센터를 방문할 필요없이 바로 신규 어플리케이션의 사용이 가능한 장점이 있다.When the controller according to the embodiment described so far is applied, even if an application update occurs after mass production, a normal secure booting procedure can be performed without a specific type of secure wired connection such as a JTAG debugger. Therefore, from the customer's point of view, there is an advantage in that a new application can be used immediately without visiting a service center even when a wireless update is performed.

전술한 본 발명은, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 매체의 예로는, HDD(Hard Disk Drive), SSD(Solid State Disk), SDD(Silicon Disk Drive), ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있다.The above-described present invention can be implemented as computer readable code on a medium on which a program is recorded. The computer-readable medium includes all types of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable media include Hard Disk Drive (HDD), Solid State Disk (SSD), Silicon Disk Drive (SDD), ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. there is

따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.Accordingly, the above detailed description should not be construed as limiting in all respects and should be considered illustrative. The scope of the present invention should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of the present invention are included in the scope of the present invention.

Claims (19)

하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법에 있어서,
호스트 어플리케이션을 기반으로 생성된 제1 메시지 인증 코드가 제1 메모리 영역에 저장된 후 제1 리셋되는 단계;
상기 제1 메모리 영역의 상기 제1 메시지 인증 코드가 호스트 어플리케이션이 저장되는 제2 메모리 영역에 주입되는 단계;
상기 제1 메시지 인증 코드가 주입된 상기 제2 메모리 영역의 상기 호스트 어플리케이션을 기반으로 제2 메시지 인증 코드가 생성되고, 제2 메시지 인증 코드가 제3 메모리 영역에 저장된 후 제2 리셋되는 단계;
상기 제1 메시지 인증 코드가 주입된 상기 제2 메모리 영역의 상기 호스트 어플리케이션을 기반으로 제3 메시지 인증 코드가 생성되는 단계;
상기 제3 메시지 인증 코드와 상기 제3 메모리 영역에 저장된 상기 제2 메시지 인증 코드가 제1 비교되고, 상기 제2 메모리 영역에 주입된 상기 제1 메시지 인증 코드와 상기 제1 메모리 영역의 상기 제1 메시지 인증 코드가 제2 비교되는 단계; 및
상기 제1 비교의 결과 및 상기 제2 비교의 결과가 모두 동일할 경우 호스트 시스템이 부팅되는 단계를 포함하며,
상기 제1 리셋이 수행되기 전에 최초 부팅 여부 또는 상기 제1 메시지 인증 코드의 생성 여부를 나타내는 제1 플래그가 설정되는 단계;
상기 제2 리셋이 수행되기 전에 상기 제2 메시지 인증 코드의 생성 여부를 나타내는 제2 플래그가 설정되는 단계;
상기 주입되는 단계 이후, 상기 제1 메모리 영역에 저장된 상기 제1 메시지 인증 코드와 상기 주입된 제1 메시지 인증 코드가 제3 비교되는 단계; 및
상기 제3 비교의 결과, 동일한 경우 메시지 인증 코드 주입이 성공함을 나타내는 제3 플래그가 설정되는 단계
를 더 포함하는,
하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
A method for secure booting of a controller including a hardware security module,
first resetting a first message authentication code generated based on a host application after being stored in a first memory area;
injecting the first message authentication code of the first memory area into a second memory area storing a host application;
generating a second message authentication code based on the host application of the second memory area into which the first message authentication code is injected, storing the second message authentication code in a third memory area, and performing a second reset;
generating a third message authentication code based on the host application of the second memory area into which the first message authentication code is injected;
The third message authentication code and the second message authentication code stored in the third memory area are first compared, and the first message authentication code injected into the second memory area and the first message authentication code stored in the first memory area are compared. a second comparison of message authentication codes; and
booting the host system when the result of the first comparison and the result of the second comparison are identical;
setting a first flag indicating whether to boot for the first time or whether to generate the first message authentication code before the first reset is performed;
setting a second flag indicating whether the second message authentication code is generated before the second reset is performed;
performing a third comparison between the first message authentication code stored in the first memory area and the injected first message authentication code after the injection; and
Setting a third flag indicating that message authentication code injection is successful if the result of the third comparison is the same.
Including more,
A secure boot method for a controller that includes a hardware security module.
삭제delete 삭제delete 삭제delete 제1 항에 있어서,
상기 제1 비교하는 단계 및 상기 제2 비교하는 단계는,
부팅시 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그 모두가 설정된 경우 수행되는, 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
According to claim 1,
The first comparing step and the second comparing step,
The secure booting method of a controller including a hardware security module, which is performed when all of the first flag, the second flag, and the third flag are set during booting.
제1 항에 있어서,
상기 제1 비교의 결과 및 상기 제2 비교의 결과 중 적어도 하나가 상이한 경우, 업데이트 성공시 이전 버전의 호스트 어플리케이션이 백업되는 제4 메모리 영역에 저장된 데이터에 기반하여 제4 메시지 인증 코드가 생성되는 단계; 및
상기 제4 메시지 인증 코드와 상기 제1 메모리 영역에 저장된 상기 제1 메시지 인증 코드가 제4 비교되는 단계를 더 포함하는, 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
According to claim 1,
Generating a fourth message authentication code based on data stored in a fourth memory area where a host application of a previous version is backed up when the update succeeds, when at least one of the first comparison result and the second comparison result is different. ; and
The secure booting method of a controller including a hardware security module, further comprising a fourth comparison step of the fourth message authentication code and the first message authentication code stored in the first memory area.
제6 항에 있어서,
상기 제4 비교의 결과, 동일한 경우 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그가 0으로 설정되는 단계; 및
상기 제4 메모리 영역, 상기 제1 메모리 영역 및 상기 제3 메모리 영역의 데이터가 소거되는 단계를 더 포함하는, 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
According to claim 6,
setting the first flag, the second flag, and the third flag to 0 if they are the same as a result of the fourth comparison; and
The secure booting method of a controller including a hardware security module, further comprising erasing data in the fourth memory area, the first memory area, and the third memory area.
제6 항에 있어서,
상기 제4 비교의 결과, 상이한 경우 상기 호스트 시스템의 부팅이 제한되는 단계를 더 포함하는, 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
According to claim 6,
The secure booting method of a controller including a hardware security module, further comprising limiting booting of the host system if the result of the fourth comparison is different.
제1 항에 있어서,
상기 제1 리셋되는 단계는,
부팅시 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그 모두가 0인 경우 수행되는, 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법.
According to claim 1,
In the first resetting step,
The secure booting method of a controller including a hardware security module, which is performed when all of the first flag, the second flag, and the third flag are 0 during booting.
제1 항 및 제5 항 내지 제9 항 중 어느 한 항에 따른 하드웨어 보안 모듈을 포함하는 제어기의 보안 부팅 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터 해독 가능 기록 매체.A computer readable recording medium recording a program for executing a secure booting method of a controller including the hardware security module according to any one of claims 1 and 5 to 9. 차량용 제어기에 있어서,
적어도 호스트 어플리케이션을 저장하는 제1 메모리; 및
상기 호스트 어플리케이션에 의한 접근이 불가한 제2 메모리를 포함하는 하드웨어 보안 모듈(HSM)을 포함하되,
상기 하드웨어 보안 모듈은,
상기 호스트 어플리케이션을 기반으로 제1 메시지 인증 코드를 생성하여 상기 제2 메모리의 제1 영역에 저장한 후 호스트 시스템을 제1 리셋시키고,
상기 제1 메모리 영역의 상기 제1 메시지 인증 코드를 상기 제1 메모리 중 상기 호스트 어플리케이션이 저장되는 제2 영역에 주입하며,
상기 제1 메시지 인증 코드가 주입된 상기 제2 영역의 상기 호스트 어플리케이션을 기반으로 제2 메시지 인증 코드를 생성하여, 상기 제2 메시지 인증 코드를 상기 제2 메모리의 제3 영역에 저장한 후 제2 리셋시키고,
상기 제1 메시지 인증 코드가 주입된 상기 제2 메모리 영역의 상기 호스트 어플리케이션을 기반으로 제3 메시지 인증 코드를 생성하며, 상기 제3 메시지 인증 코드와 상기 제3 영역에 저장된 상기 제2 메시지 인증 코드를 제1 비교하고, 상기 제2 영역에 주입된 상기 제1 메시지 인증 코드와 상기 제1 영역의 상기 제1 메시지 인증 코드를 제2 비교하며,
상기 제1 비교의 결과 및 상기 제2 비교의 결과가 모두 동일할 경우 상기 호스트 시스템을 부팅시키고,
상기 제1 리셋을 수행하기 전에 최초 부팅 여부 또는 상기 제1 메시지 인증 코드의 생성 여부를 나타내는 제1 플래그를 설정하며,
상기 제2 리셋이 수행되기 전에 상기 제2 메시지 인증 코드의 생성 여부를 나타내는 제2 플래그를 설정하고,
상기 제1 메시지 인증 코드를 주입한 후, 상기 제1 영역에 저장된 상기 제1 메시지 인증 코드와 상기 주입된 제1 메시지 인증 코드를 제3 비교하고,
상기 제3 비교의 결과, 동일한 경우 메시지 인증 코드 주입이 성공함을 나타내는 제3 플래그를 설정하는,
차량용 제어기.
In the vehicle controller,
a first memory storing at least a host application; and
A hardware security module (HSM) including a second memory inaccessible by the host application,
The hardware security module,
After generating a first message authentication code based on the host application and storing it in a first area of the second memory, performing a first reset of the host system;
injecting the first message authentication code of the first memory area into a second area of the first memory where the host application is stored;
A second message authentication code is generated based on the host application of the second area into which the first message authentication code is injected, the second message authentication code is stored in the third area of the second memory, and then the second message authentication code is stored in the second area. reset,
A third message authentication code is generated based on the host application in the second memory area into which the first message authentication code is injected, and the third message authentication code and the second message authentication code stored in the third area are generated. performing a first comparison, and performing a second comparison between the first message authentication code injected into the second area and the first message authentication code in the first area;
Booting the host system when the result of the first comparison and the result of the second comparison are identical;
Setting a first flag indicating whether to boot for the first time or whether to generate the first message authentication code before performing the first reset;
Setting a second flag indicating whether the second message authentication code is generated before the second reset is performed;
After injecting the first message authentication code, performing a third comparison between the first message authentication code stored in the first area and the injected first message authentication code;
Setting a third flag indicating that message authentication code injection succeeds when the result of the third comparison is the same.
vehicle controller.
삭제delete 삭제delete 삭제delete 제11 항에 있어서,
상기 하드웨어 보안 모듈은,
부팅시 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그 모두가 설정된 경우 상기 제1 비교 및 상기 제2 비교를 수행하는, 차량용 제어기.
According to claim 11,
The hardware security module,
A vehicle controller that performs the first comparison and the second comparison when all of the first flag, the second flag, and the third flag are set upon booting.
제11 항에 있어서,
상기 하드웨어 보안 모듈은,
상기 제1 비교의 결과 및 상기 제2 비교의 결과 중 적어도 하나가 상이한 경우, 상기 제1 메모리 중 업데이트 성공시 이전 버전의 호스트 어플리케이션이 백업되는 제4 영역에 저장된 데이터에 기반하여 제4 메시지 인증 코드를 생성하고,
상기 제4 메시지 인증 코드와 상기 제1 영역에 저장된 상기 제1 메시지 인증 코드를 제4 비교하는, 차량용 제어기.
According to claim 11,
The hardware security module,
If at least one of the result of the first comparison and the result of the second comparison is different, a fourth message authentication code based on data stored in a fourth area in the first memory where the host application of the previous version is backed up when the update is successful. create,
and performing a fourth comparison between the fourth message authentication code and the first message authentication code stored in the first area.
제16 항에 있어서,
상기 하드웨어 보안 모듈은,
상기 제4 비교의 결과, 동일한 경우 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그를 0으로 설정하고,
상기 제4 영역, 상기 제1 영역 및 상기 제3 영역의 데이터를 소거하는, 차량용 제어기.
According to claim 16,
The hardware security module,
If the result of the fourth comparison is the same, the first flag, the second flag, and the third flag are set to 0;
and erasing data of the fourth area, the first area, and the third area.
제16 항에 있어서,
상기 하드웨어 보안 모듈은,
상기 제4 비교의 결과, 상이한 경우 상기 호스트 시스템의 부팅을 제한하는, 차량용 제어기.
According to claim 16,
The hardware security module,
and limiting booting of the host system when the result of the fourth comparison is different.
제11 항에 있어서,
상기 하드웨어 보안 모듈은,
부팅시 상기 제1 플래그, 상기 제2 플래그 및 상기 제3 플래그 모두가 0인 경우 상기 제1 메시지 인증 코드를 생성하는, 차량용 제어기.
According to claim 11,
The hardware security module,
and generating the first message authentication code when all of the first flag, the second flag, and the third flag are 0 at booting.
KR1020180055253A 2018-05-15 2018-05-15 In-vehicle controller and method for performing update therof KR102545102B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180055253A KR102545102B1 (en) 2018-05-15 2018-05-15 In-vehicle controller and method for performing update therof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180055253A KR102545102B1 (en) 2018-05-15 2018-05-15 In-vehicle controller and method for performing update therof

Publications (2)

Publication Number Publication Date
KR20190130756A KR20190130756A (en) 2019-11-25
KR102545102B1 true KR102545102B1 (en) 2023-06-19

Family

ID=68730528

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180055253A KR102545102B1 (en) 2018-05-15 2018-05-15 In-vehicle controller and method for performing update therof

Country Status (1)

Country Link
KR (1) KR102545102B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101806719B1 (en) * 2016-07-04 2017-12-08 현대오트론 주식회사 The electronic control unit possible auto setting of memory area according to secure boot and method for secure boot using the same
KR101820366B1 (en) 2014-03-11 2018-01-19 퀄컴 인코포레이티드 Data integrity protection from rollback attacks for use with systems employing message authentication code tags

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5089593B2 (en) * 2005-09-14 2012-12-05 サンディスク テクノロジィース インコーポレイテッド Hardware driver integrity check for memory card controller firmware
KR20140073384A (en) * 2012-12-06 2014-06-16 삼성전자주식회사 system on chip for performing secure boot, image forming apparatus comprising it, and methods thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101820366B1 (en) 2014-03-11 2018-01-19 퀄컴 인코포레이티드 Data integrity protection from rollback attacks for use with systems employing message authentication code tags
KR101806719B1 (en) * 2016-07-04 2017-12-08 현대오트론 주식회사 The electronic control unit possible auto setting of memory area according to secure boot and method for secure boot using the same

Also Published As

Publication number Publication date
KR20190130756A (en) 2019-11-25

Similar Documents

Publication Publication Date Title
CA2845523C (en) Secure recovery apparatus and method
US10452375B1 (en) Memory-efficient upgrade staging
US11100011B2 (en) Flash translation layer with hierarchical security
US11385902B2 (en) Secure firmware management with hierarchical boot sequence using last known good firmware
US11803366B2 (en) Firmware updating system and method
US8751817B2 (en) Data processing apparatus and validity verification method
CN110286853B (en) Data writing method and device and computer readable storage medium
US11455115B2 (en) Storage device
CN109445705B (en) Firmware authentication method and solid state disk
US11210173B2 (en) Fault tolerant device upgrade
US11698970B2 (en) Double wrapping for verification
CN115576483A (en) Secure identity linking between trusted computing based components
CN113505363B (en) Method and system for realizing memory space replay prevention through software mode
KR101548452B1 (en) Method and apparatus for recovering metadata in electronic device based on non-volatile memeory
KR102545102B1 (en) In-vehicle controller and method for performing update therof
CN113486399A (en) Data storage method and system based on RISC-V architecture
CN112817619B (en) Computer system, safety management method thereof and computer software product
KR101545077B1 (en) Method and apparatus for recovering metadata in electronic device based on non-volatile memeory
CN109460282B (en) vTPM clock security guarantee method and system
JP7341376B2 (en) Information processing device, information processing method, and information processing program
US20230129942A1 (en) Method for locking a rewritable non-volatile memory and electronic device implementing said method
US10901845B2 (en) Erasure coding for a single-image memory
JP6954340B2 (en) Memory device management system, memory device management methods and programs
CN117150496A (en) Device identifier combining engine 3-layer architecture
CN117972731A (en) Firmware loading method, starting method, embedded device and storage medium

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
X091 Application refused [patent]
AMND Amendment
X701 Decision to grant (after re-examination)
GRNT Written decision to grant