A method and system for secure boot of an in-vehicle controller
By using a dynamic signature mechanism that combines a device’s unique private key and a random challenge value, along with step-by-step verification and version number comparison, the system solves the problems of firmware cloning, binding failure, and version downgrading of the vehicle controller, thereby improving the security and defense capabilities of the startup process.
Patent Information
- Application Number
- CN202611337549.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-24
AI Technical Summary
Existing secure boot solutions for vehicle controllers suffer from issues such as firmware cloning, device binding failure, static signatures failing to prevent tampering, and version downgrades. Attackers can use signature verification to validate unauthorized code or clone legitimate firmware to another device, exploiting old vulnerabilities to launch attacks.
A dynamic signature mechanism using a device-unique private key and a random challenge value, combined with step-by-step verification and version number comparison, ensures the legitimacy and uniqueness of the firmware image through the collaborative work of the main control chip and security elements, preventing cloning and version downgrade.
It achieves strong binding between firmware and hardware devices, prevents firmware cloning, dynamically defends against replay attacks, ensures that the system always runs on the latest security version, and improves the startup security of the vehicle controller.
Smart Images

Figure CN123158640A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive electronic information security technology, specifically to a secure startup method and system for an on-board controller. Background Technology
[0002] With the rapid development of intelligent connected vehicles, on-board controllers (such as domain controllers and ECUs) are undertaking more and more critical control functions, and their security is directly related to vehicle driving safety. Secure Boot, as the first line of defense for the information security of on-board controllers, aims to ensure that the code loaded and executed by the device is authorized and has not been tampered with.
[0003] In related technologies, vehicle controllers typically employ a static trust chain-based boot mechanism using digital signatures. However, existing secure boot solutions still suffer from the following technical problems: (1) Although static signatures can prevent tampering, if the key is leaked, unauthorized code may still pass the signature verification.
[0004] (2) Attackers may downgrade the system to an older firmware version with known vulnerabilities and exploit those vulnerabilities to launch an attack.
[0005] (3) Static signatures cannot prevent attackers from cloning legitimate Flash images to another device (because different devices have different private keys) or bypassing signature checks by physically moving memory data. Summary of the Invention
[0006] This application provides a safe startup method and system for an on-board controller, which can solve the technical problems of firmware cloning and device binding failure in the prior art.
[0007] In a first aspect, embodiments of this application provide a secure startup method for an on-board controller, comprising: In response to power-on, the device's unique private key is read using the main control chip, and the firmware image is loaded. After all firmware images are loaded, a random challenge value is generated using the security element and sent to the main control chip. The main control chip is controlled to call the device's unique private key to digitally sign the joint data formed by the random challenge value and the system kernel image hash value, generate a signature result, and return it to the secure element. The control unit uses a preset verification key to authenticate the signature result; if the authentication is successful, it outputs an enable signal to start execution; otherwise, it outputs a hardware reset signal to the power management unit.
[0008] Preferably, before loading each firmware image level, the following is also included: The security version number of the firmware image is compared with the current version number recorded in the secure storage area; If the security version number is less than the current version number, the startup process is terminated; otherwise, the firmware image loading step is executed, and the current version number is updated to the security version number after verification.
[0009] Preferably, before loading each firmware image level, the following is also included: The root public key hash is read from the firmware inside the main control chip and used as the root of trust. The digital signature of the firmware image is verified step by step based on the root of trust to complete the step of loading the firmware image.
[0010] Preferably, the firmware of the main control chip is a BootROM, and the root public key hash is stored in a one-time programmable memory inside the main control chip. The digital signature of the firmware image is verified step by step based on the root of trust, specifically including: The bootloader image is read using the BootROM, and the digital signature of the bootloader is verified using the root public key corresponding to the root public key hash. If the verification is successful, the bootloader is loaded and run; if the verification fails, the startup process is terminated. The secondary bootloader image is loaded using the primary bootloader, and the digital signature of the secondary bootloader is verified using the public key carried in its own code; if the verification is successful, the secondary bootloader is loaded and run; if the verification fails, the startup process is terminated. The operating system kernel and device tree file of the vehicle controller are loaded using the secondary bootloader, and the digital signature of the operating system kernel and device tree file is verified using the public key carried in its own code; if the verification is successful, the operating system kernel is loaded and run; if the verification fails, the startup is terminated.
[0011] Preferably, the primary bootloader is SPL, the secondary bootloader is U-Boot, and the operating system kernel is in zImage or Image format; The public key used to verify the secondary bootloader, carried in the code of the primary bootloader itself, is pre-written into the image file of the primary bootloader during the image compilation stage of the primary bootloader. The public key used to verify the operating system kernel and device tree file, carried in the code of the secondary bootloader itself, is pre-written into the image file of the secondary bootloader during the image compilation stage. The system kernel image hash value is obtained by the main control chip performing a hash operation on the operating system kernel image data loaded into memory.
[0012] Preferably, controlling the security element to authenticate the signature result using a preset verification key specifically includes: The control security element verifies the returned signature based on a preset verification key and monitors the response time from sending the random challenge value to receiving the signature result; If the signature verification is successful, and the system kernel image hash value is consistent with the local calculation result of the security element, and the response time does not exceed the preset threshold, then the control security pin outputs a valid level, allowing the operating system kernel to execute; If the signature verification fails or the response time exceeds a preset threshold, the safety element is controlled to directly output a hardware reset signal to the power management unit.
[0013] Preferably, the digital signatures of firmware images at all levels adopt static signatures; the static signature means that the signature value is only bound to the content of the firmware image itself and does not change over time.
[0014] Preferably, the secure storage area is a one-time programmable memory or a replay protection storage block; The current version number is provided by a monotonically increasing counter maintained in the secure storage area, and the monotonically increasing counter cannot be rolled back after the version number is updated.
[0015] Preferably, the security element is a security element chip independent of the main control chip, and the security element integrates a hardware random number generator; the random challenge value is generated by the hardware random number generator, and the random challenge value is a 128-bit random number; Before using the secure element to generate a random challenge value and send it to the main control chip, the process also includes: The secondary bootloader sends a readiness query and a firmware summary of the current firmware image to the secure element. Upon receiving the readiness query, the control element triggers the hardware random number generator to generate the random challenge value.
[0016] Secondly, a safe start system for an on-board controller is provided, which includes: a main control chip, a safety element, a safety storage area, and a power management unit; The secure storage area is used to store firmware images and the device's unique private key; The main control chip is used to read the device's unique private key in response to power-on, load the firmware image, and after all firmware images have been loaded, call the device's unique private key to sign the joint data formed by the random challenge value and the kernel image hash value. The security element is used to generate the random challenge value and send it to the main control chip, and to authenticate the signature returned by the main control chip using a preset verification key; if the authentication is successful, it outputs an enable start execution signal, and if the authentication fails, it outputs a hardware reset signal to the power management unit; the power management unit is used to receive the hardware reset signal and perform a system reset.
[0017] The beneficial effects of the technical solutions provided in this application include: First, at the identity binding level, because the device's unique private key is permanently stored in the secure area inside the main control chip and cannot be cloned, a strong binding between the firmware and the hardware device is achieved. Even if an attacker copies legitimate firmware to other devices, the security element will determine that the signature verification has failed and trigger a reset because the target device cannot provide a unique private key signature that matches the source device, thus completely blocking the firmware cloning path.
[0018] Secondly, at the dynamic defense level, the random challenge value generated by the security element is unpredictable and one-time, forcing the main control chip to perform a real-time signature response. This mechanism fundamentally eliminates the possibility of attackers replaying attacks by recording past signatures. Thirdly, at the defense-in-depth level, this dynamic challenge mechanism serves as a fallback protection after static signature verification. Even if the manufacturer's static private key is leaked, allowing malicious firmware to pass the pre-verification stage, attackers will still be unable to pass the final authentication due to the lack of the device's unique private key. Finally, at the enforcement level, the security element directly controls the boot permission and reset signals through hardware pins, ensuring that even if the main control chip's software layer is compromised, the hardware reset command cannot be blocked, guaranteeing the enforcement of the security policy. This application significantly improves the security of the vehicle controller's boot process through multi-dimensional collaboration of hardware binding, dynamic challenges, and hardware enforcement control. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the safe startup method of the vehicle controller in this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0021] First, some of the technical terms used in this application will be explained to help those skilled in the art understand this application.
[0022] Vehicle controller: refers to the electronic control unit (ECU) or control unit containing the main control chip MCU in a vehicle used to control specific functions.
[0023] Main control chip: refers to the core processing unit in the vehicle controller, which is responsible for executing firmware and operating system. In this application, it includes on-chip firmware (such as BootROM) and a secure storage area.
[0024] Secure Element (SE): A security chip independent of the main control chip, which integrates a hardware random number generator (HRNG) and a secure storage area for storing keys, performing secure operations, and generating random challenge values.
[0025] Root of Trust: The absolutely trusted initial code or data during startup. In this application, it is the root public key hash embedded in the one-time programmable memory (OTP / eFuse) inside the main control chip.
[0026] Static Signature: The signature value is only bound to the content of the firmware image itself, does not change over time, and is generated once when the firmware is released.
[0027] Dynamic Random Challenge: A mechanism in which a random number is generated by a security element before operation, and the main control chip is required to sign the response using the Device Unique Private Key.
[0028] Device Unique Private Key: A unique private key injected into each device at the factory, stored in the secure area of the main control chip, and not transferred when the firmware image is cloned.
[0029] Security Pin: The physical pin of the security element used to output control signals, which are used to send start-up or reset signals to the main control chip or power management unit.
[0030] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0031] In a first aspect, embodiments of this application also provide a safe start system for an on-board controller, which includes: a main control chip, a safety element (SE), a memory, and a power management unit (PMU).
[0032] The secure storage area is used to store firmware images and the device unique private key (Note: This refers to the index of the private key or the protected storage area. The actual private key is usually located in the chip's secure area, which logically belongs to the memory storage category). The main control chip is used to read the root public key hash as the root of trust in response to power-on. Before loading each level of firmware image, it performs security version number comparison and digital signature verification. After all firmware images are loaded, it calls the device's unique private key to sign the joint data formed by the random challenge value and the kernel image hash value. The security element is used to generate random challenge values and send them to the main control chip, and to authenticate the signature returned by the main control chip using a preset verification key; if the authentication is successful, it outputs an Allow BootExecute Signal, and if the authentication fails, it outputs a Hardware ResetSignal to the power management unit. The power management unit is used to receive hardware reset signals and perform system reset.
[0033] ① Main control chip configuration requirements: Secure storage area: Must have an immutable one-time programmable memory (OTP / eFuse) or replay protection block (RPMB) to store the root public key hash and security version number counter.
[0034] Key protection: A hardware security area must be provided to store the device's unique private key, ensuring that the private key cannot be read or cloned by external parties.
[0035] Boot Logic: The on-chip firmware (BootROM) must support signature verification logic and version number comparison logic based on hardware root of trust.
[0036] Hash operation capability: The main control chip must have the ability to perform hash operations on the operating system kernel image data loaded into memory in order to generate the system kernel image hash value.
[0037] ② Safety element (SE) configuration requirements: It must be a security chip independent of the main control chip to prevent the security components from being damaged along with the main control chip if the main control chip is compromised.
[0038] Random number generation: An internal hardware random number generator (HRNG) must be integrated to generate at least 128-bit high-entropy random challenge values.
[0039] Secure storage: The internal storage must store a pre-set verification key (the public key corresponding to the device's unique private key) for signature verification.
[0040] Monitoring capabilities: It has a timer function, which can monitor the response time from sending the challenge value to receiving the signature result, and has preset threshold judgment logic.
[0041] Control interface: It has a security pin output capability, which can directly control the reset / enable signal of the power management unit or the main control chip.
[0042] ③ Memory configuration requirements: Used to store firmware images (excluding BootROM), device tree files, and operating system kernels.
[0043] If the device's unique private key is logically stored in the memory, then that storage area must have access control permissions, and access is restricted to the main control chip's secure area.
[0044] ④ Power Management Unit (PMU) Configuration Requirements: It has the ability to receive external hardware reset signals and can perform a system reset operation when it receives a reset signal from a safety element. It has controlled power-on / power-off logic and works in conjunction with the safety element's enable start signal.
[0045] ⑤ Other configuration requirements: Bootloader: The primary bootloader (SPL) and secondary bootloader (U-Boot) need to have a public key written in advance during the compilation stage to verify the next level image.
[0046] Firmware images at all levels must use static signatures, and the signature value must be bound to the content. Firmware images must include a security version number, and this version number must be compatible with the counter policy (monotonically increasing) in the secure storage area. Communication protocol: A communication protocol for readiness query and firmware digest transmission must be defined between the secondary bootloader and the secure element.
[0047] Secondly, embodiments of this application provide a secure startup method for an on-board controller, comprising: Step S10: In response to the power-on of the vehicle controller, the firmware (BootROM) of the main control chip reads the root public key hash and uses it as the root of trust, and reads the device unique private key; loads the firmware image.
[0048] Step S20: (Anti-rollback version control and static signature chain): Before loading each level of firmware image, compare the security version number of the firmware image with the current version number recorded in the secure storage area; if the security version number is less than the current version number, terminate the startup process; if the security version number is not less than the current version number, verify the digital signature of the firmware image level by level based on the root of trust, and after the verification is passed, update the current version number in the secure storage area to the security version number, and load and execute the firmware image.
[0049] Step S30: After all firmware images have been loaded, a random challenge value is generated using the Secure Element (SE) and sent to the Main Control Chip.
[0050] Step S40: The main control chip calls the Device Unique Private Key to digitally sign the combined data of the random challenge value and the system kernel image hash value, generating a signature result (Response) and returning it to the Secure Element (SE). The system kernel image hash value is obtained by the main control chip through hashing the operating system kernel image data loaded into memory.
[0051] Step S50: The Security Element (SE) authenticates the signature result (Response) using a preset Verification Key; if the authentication is successful, it outputs an Allow Boot ExecuteSignal; if the authentication fails, it outputs a Hardware ResetSignal to the Power Management Unit (PMU).
[0052] In this embodiment, a four-layer protection system consisting of "hardware trust root -> static signature chain -> anti-rollback version control -> dynamic random challenge" is constructed to solve the technical problems of physical tampering, unauthorized code, version downgrade and firmware cloning in the secure startup of vehicle controllers in related technologies.
[0053] To address the risk of static signature key leakage, this embodiment employs a dynamic random challenge mechanism in steps S30-S50. Specifically, traditional static signatures only verify whether the firmware is signed with the vendor's private key. If the vendor's private key is leaked, an attacker can sign arbitrary malicious code. This application adds a dynamic challenge step after static verification passes. The secure element (SE) generates a random challenge value, and the main control chip must sign the challenge value and the kernel hash using the "Device Unique Private Key" stored in its local secure area. Since the "Device Unique Private Key" is independently generated for each device and cannot be cloned (usually embedded in the chip's OTP / eFuse, not in Flash), even if an attacker leaks the vendor's static signature private key and flashes malicious firmware, the attacker cannot obtain the current device's "Device Unique Private Key" to correctly respond to the secure element's random challenge. Therefore, the secure element fails the signature verification, outputs a hardware reset signal, and prevents malicious code execution. This ensures that even if the static signature system is breached, there is still a dynamic mechanism to prevent unauthorized code from running.
[0054] To address the risk of version downgrades, this embodiment solves the problem through version number comparison logic in step S20. Specifically, attackers often attempt to flash the system back to an older version with known vulnerabilities. This embodiment forces a version comparison before loading each firmware image level. The key point is: If the security version number is lower than the current version number recorded in the security storage area, the startup process will terminate directly without further signature verification. This means that even if the older firmware version has a valid official signature, it will be rejected because the version number is too low.
[0055] The current version number is maintained in One-Time Programmable Memory (OTP / eFuse) or Replay Protection Block (RPMB). When a new firmware version is verified and loaded, the current version number is updated to the new security version number. Due to the physical characteristics of the storage medium (e.g., eFuse can only break and not recover), the version number can only monotonically increase and cannot be rolled back. Version number verification is performed independently of digital signature verification; a valid digital signature does not overwrite a failed version number comparison. This eliminates the possibility of downgrades at both the logical and physical storage levels, ensuring that the system always runs on the latest security patch version.
[0056] To address the risk of cloning, this embodiment solves the problem through device-unique private key binding and response time monitoring in steps S30-S50. Specifically, static signatures cannot distinguish whether the firmware is running on the original device or a cloned device. In this application, step S40 requires the main control chip to sign using the "device-unique private key." Specifically: The device's unique private key is stored in a secure storage area inside the main control chip, not in external Flash memory. When an attacker clones a legitimate Flash image (containing firmware code) to another device, the target device's unique private key differs from the source device's. In step S50, the secure element uses a preset public key (corresponding to the target device's unique private key) for signature verification. Since the cloned firmware cannot provide a correct private key signature for the target device (or the firmware does not contain a private key and requires calling the chip's internal key), the signature verification will fail, and the system will reset. This achieves a strong binding between the firmware and the hardware device. Additionally, response time monitoring is included. The secure element monitors the response time from sending the challenge value to receiving the signature result. If an attacker attempts to interfere with the signing process or replace data through physical means (such as probes or memory data manipulation), it often leads to processing delays. If the response time exceeds a preset threshold, the secure element determines it as abnormal and directly forces a system reset. This prevents attacks that bypass signature checks through physical means.
[0057] Furthermore, the step-by-step verification in step S20 specifically includes: The firmware inside the main control chip is a BootROM, and the root public key hash is stored in the one-time programmable memory (OTP / eFuse) inside the main control chip. BootROM reads the first-level bootloader image (such as SPL) and uses the root public key hash corresponding to the root public key to verify the digital signature of the first-level bootloader. If the verification passes, the first-level bootloader will be loaded and run; if the verification fails, the startup process will be terminated. The primary bootloader loads the secondary bootloader (such as U-Boot) image and uses the public key carried in its own code to verify the digital signature of the secondary bootloader; if the verification is successful, the secondary bootloader is loaded and run; if the verification fails, the startup process is terminated. The secondary bootloader loads the operating system kernel (zImage / Image) image and device tree file (DTB), and uses the public key carried in its own code to verify the digital signature of the operating system kernel and device tree file; if the verification is successful, the operating system kernel is loaded and run; if the verification fails, the boot process is terminated.
[0058] The above ensures that each level of code must be signed and verified by the level above before execution, guaranteeing that the boot process will terminate at that level if any level of firmware is maliciously tampered with or replaced. Even if a level of firmware has a vulnerability, because the next level of firmware must be verified before loading, attackers find it difficult to exploit vulnerabilities in the previous level to load malicious code at the next level, thus limiting the spread of the attack surface.
[0059] Furthermore, the primary bootloader is SPL, the secondary bootloader is U-Boot, and the operating system kernel is in zImage or Image format; The public key used to verify the secondary bootloader is carried in the code of the primary bootloader itself and is pre-written into the image file of the primary bootloader during the image compilation stage of the primary bootloader; The public key used to verify the operating system kernel and device tree file, carried in the code of the secondary bootloader itself, is pre-written into the image file of the secondary bootloader during the image compilation stage.
[0060] The above implementation pre-writes the public key into the image file during the compilation phase, making the public key part of the firmware image and participating in signature protection. This prevents attackers from replacing the public key at runtime to bypass signature verification. The explicit definition of the bootloader (SPL / U-Boot) and kernel format (zImage / Image) allows this secure boot method to adapt to mainstream embedded Linux boot processes, facilitating engineering implementation and standardization. With the public key embedded in the code, it does not need to be read from external insecure storage at runtime, reducing I / O operations and the risk of potential key leakage.
[0061] Furthermore, the digital signatures for each level of firmware image adopt static signatures; static signatures mean that the signature value is only bound to the content of the firmware image itself and does not change over time. The signature is strongly bound to the content, and as long as the firmware content does not undergo any bit changes, the signature verification will pass, which can effectively detect bit flips or physical tampering that occur during firmware storage.
[0062] Furthermore, the secure storage area is either a one-time programmable memory (OTP / eFuse) or a replay protection block (RPMB); the current version number is provided by a monotonically increasing counter maintained in the secure storage area, and the monotonically increasing counter cannot be rolled back after the version number is updated.
[0063] By utilizing the physical characteristic of a monotonically increasing and non-reversible counter, the system is forced to load firmware with a version number equal to or higher than the current version. Even if an attacker obtains a legitimate signature for an older firmware version, it will be rejected from booting because the version number is lower than the currently recorded value, preventing the system from reverting to an older version with known vulnerabilities.
[0064] Furthermore, the signature returned by the security element (SE) authentication in step S50 specifically includes: The control security element verifies the returned signature based on a preset verification key and monitors the response time from sending a random challenge value to receiving the signature result. If the signature verification is successful, and the system kernel image hash value is consistent with the local calculation result of the security element, and the response time does not exceed the preset threshold, then the control security pin outputs a valid level, allowing the operating system kernel to execute; If the signature verification fails or the response time exceeds the preset threshold, the control safety element directly outputs a hardware reset signal to the power management unit.
[0065] The above approach combines digital signature verification, kernel hash comparison, and response time monitoring into a triple verification system, significantly increasing the difficulty for attackers to bypass security checks. By monitoring response time, abnormal delays caused by physical probe intervention, step-by-step debugging, or memory tampering can be identified. If a response times out, it is identified as a potential attack and a forced reset is initiated, effectively defending against time-based side-channel attacks or physical interference attacks.
[0066] Furthermore, the security element is a security element chip independent of the main control chip, and the security element integrates a hardware random number generator (HRNG); the random challenge value is generated by the hardware random number generator, and the random challenge value is a 128-bit random number; after the security element sends the random challenge value to the main control chip, it records the status of the random challenge value locally as pending verification.
[0067] The above security components are independent of the main control chip, ensuring that even if the main control chip's operating system is completely controlled, attackers cannot directly read or tamper with the keys and random number generation logic within the security components, achieving physical isolation between key storage and the usage environment. A hardware random number generator produces 128-bit high-entropy random challenge values, ensuring the uniqueness and unpredictability of each challenge launch and preventing attackers from recording previous signed responses for replay attacks. The challenge value state is recorded locally, ensuring that the security components can track the challenge-response process lifecycle and preventing logical vulnerabilities caused by state machine chaos.
[0068] Furthermore, before step S30, the process includes: the secondary bootloader (U-Boot) sending a readiness query and a firmware digest (Hash) of the current firmware image to the secure element; after receiving the readiness query, the secure element triggers a hardware random number generator to generate a random challenge value.
[0069] The above-described readiness query mechanism ensures that the secure element generates a challenge value only after the main control chip has completed loading all firmware and is ready to jump to the kernel. This avoids resource consumption or timeouts caused by premature challenge value generation, thus optimizing the startup sequence. The secondary bootloader sends the current firmware digest, allowing the secure element to know the identity of the currently loaded firmware before generating the challenge. This can be used not only for log auditing but also for the secure element to pre-verify the legality of the firmware digest, further ensuring that the challenge-response mechanism is tailored to the current operating environment.
[0070] Thirdly, embodiments of this application also provide a computer-readable storage medium.
[0071] The present application provides a computer-readable storage medium storing a secure boot program for an on-board controller, wherein when the secure boot program for the on-board controller is executed by a processor, it implements the steps of the secure boot method for the on-board controller as described above.
[0072] The method implemented when the vehicle controller's safe startup procedure is executed can be referred to in various embodiments of the vehicle controller's safe startup method of this application, and will not be repeated here.
[0073] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0074] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0075] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0076] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0077] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0079] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for securely starting an in-vehicle controller, the method comprising: It includes: Upon power-on, the device's unique private key is read using the main control chip, and the firmware image is loaded. After all firmware images have been loaded, a random challenge value is generated using the security element and sent to the main control chip; The main control chip is controlled to call the device's unique private key to digitally sign the joint data formed by the random challenge value and the system kernel image hash value, generate a signature result, and return it to the secure element. The security element is controlled to authenticate the signature result using a preset verification key; If authentication is successful, a signal indicating that execution is permitted to begin will be output. Otherwise, output a hardware reset signal to the power management unit.
2. The method of claim 1, wherein the vehicle controller is a vehicle engine controller. Before loading each firmware image level, the following is also included: The security version number of the firmware image is compared with the current version number recorded in the secure storage area; If the security version number is less than the current version number, the startup process is terminated; otherwise, the firmware image loading step is executed, and the current version number is updated to the security version number after verification.
3. The method of claim 2, wherein the vehicle controller is a vehicle engine controller. Before loading each firmware image level, the following is also included: The root public key hash is read from the firmware inside the main control chip and used as the root of trust. The digital signature of the firmware image is verified step by step based on the root of trust to complete the step of loading the firmware image.
4. The safe start method for the vehicle controller as described in claim 3, characterized in that: The firmware of the main control chip is a BootROM, and the root public key hash is stored in a one-time programmable memory inside the main control chip. The digital signature of the firmware image is verified step by step based on the root of trust, specifically including: The bootloader image is read using the BootROM, and the digital signature of the bootloader is verified using the root public key corresponding to the root public key hash. If the verification is successful, the bootloader is loaded and run; if the verification fails, the startup process is terminated. The secondary bootloader image is loaded using the primary bootloader, and the digital signature of the secondary bootloader is verified using the public key carried in its own code; if the verification is successful, the secondary bootloader is loaded and run; if the verification fails, the startup process is terminated. The operating system kernel and device tree file of the vehicle controller are loaded using the secondary bootloader, and the digital signature of the operating system kernel and device tree file is verified using the public key carried in its own code; if the verification is successful, the operating system kernel is loaded and run; if the verification fails, the startup is terminated.
5. The safe start method for the vehicle controller as described in claim 4, characterized in that: The primary bootloader is SPL, the secondary bootloader is U-Boot, and the operating system kernel is in zImage or Image format. The public key used to verify the secondary bootloader, carried in the code of the primary bootloader itself, is pre-written into the image file of the primary bootloader during the image compilation stage of the primary bootloader. The public key used to verify the operating system kernel and device tree file, carried in the code of the secondary bootloader itself, is pre-written into the image file of the secondary bootloader during the image compilation stage. The system kernel image hash value is obtained by the main control chip performing a hash operation on the operating system kernel image data loaded into memory.
6. The method of claim 1, wherein the vehicle controller is a vehicle engine controller. Controlling the security element to authenticate the signature result using a preset verification key specifically includes: The control security element verifies the returned signature based on a preset verification key and monitors the response time from sending the random challenge value to receiving the signature result; If the signature verification is successful, and the system kernel image hash value is consistent with the local calculation result of the security element, and the response time does not exceed the preset threshold, then the control security pin outputs a valid level, allowing the operating system kernel to execute; If the signature verification fails or the response time exceeds a preset threshold, the safety element is controlled to directly output a hardware reset signal to the power management unit.
7. The safe start method for the vehicle controller as described in claim 4, characterized in that: The digital signatures of firmware images at all levels adopt static signatures; the static signature means that the signature value is only bound to the content of the firmware image itself and does not change over time.
8. The safe start method for the vehicle controller as described in claim 2, characterized in that: The secure storage area is a one-time programmable memory or a replay protection storage block; The current version number is provided by a monotonically increasing counter maintained in the secure storage area, and the monotonically increasing counter cannot be rolled back after the version number is updated.
9. The safe start method for the vehicle controller as described in claim 1, characterized in that: The security element is a security element chip independent of the main control chip, and the security element integrates a hardware random number generator; the random challenge value is generated by the hardware random number generator, and the random challenge value is a 128-bit random number; Before using the secure element to generate a random challenge value and send it to the main control chip, the process also includes: The secondary bootloader sends a readiness query and a firmware summary of the current firmware image to the secure element. Upon receiving the readiness query, the control element triggers the hardware random number generator to generate the random challenge value.
10. A secure boot system for an in-vehicle controller, the system comprising: It includes: Main control chip, security element, security storage area and power management unit; The secure storage area is used to store firmware images and the device's unique private key; The main control chip is used to read the device's unique private key in response to power-on, load the firmware image, and after all firmware images have been loaded, call the device's unique private key to sign the joint data formed by the random challenge value and the kernel image hash value. The security element is used to generate the random challenge value and send it to the main control chip, and to authenticate the signature returned by the main control chip using a preset verification key; if the authentication is successful, it outputs an enable start execution signal, and if the authentication fails, it outputs a hardware reset signal to the power management unit; the power management unit is used to receive the hardware reset signal and perform a system reset.
