BootROM expansion method, device, electronic device and storage medium

By separating the parts of BootROM that meet the preset conditions into extended images and establishing a protocol channel with the server, the problems of traditional BootROM's insufficient flexibility and security in the face of new algorithms and security patch requirements are solved, and BootROM's Elastic expansion and security improvements.

CN114880166BActive Publication Date: 2024-09-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210411166.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2024-09-13
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

When faced with the challenges of quantum computing and supercomputers, traditional BootROM has difficulty upgrading cryptographic algorithms, resulting in insufficient security and flexibility, unable to respond to the needs of new algorithms or security patches in a timely manner, and because the solidified code cannot be encrypted, there is a risk of being attacked. risk.

Method used

By separating the part of BootROM that meets the preset conditions into an extended image (SBX image), which has the same security level as BootROM, and establishing a protocol channel with the server through the extended image, partial logical expansion of BootROM is achieved, improving its security and flexibility. sex.

Benefits of technology

It achieves the elastic expansion of BootROM, ensures security, reduces design complexity, improves stability and robustness, avoids vulnerabilities and attack surfaces in communication protocols, and reduces the possibility of excessive production and miscarriage of goods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880166B
    Figure CN114880166B
Patent Text Reader

Abstract

The embodiment of the present application provides a BootROM expansion method, device, electronic device and storage medium, and is designed in the field of data processing technology. By separating the part of the BootROM that meets the preset conditions, an extended image of the BootROM is formed, wherein the extended image has the same security level as the BootROM; a protocol channel is established with the server through the extended image, so that a part of the protocol logic of the BootROM can be implemented through the extended image with the same security level as the BootROM, and the BootROM is elastically expanded, thereby improving the security and flexibility of the BootROM.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a BootROM expansion method, device, electronic device and storage medium. Background Art

[0002] In the secure boot solution of System on Chip (SoC), a one-time programmable storage device (OTP) / (electric-Fuse, eFuse) and BootROM are usually used as the trusted anchor points of the security link, and the integrity and authenticity of the loaded image are verified through cryptographic algorithms.

[0003] The current security verification logic in BootROM is to first determine all the cryptographic algorithms that need to be supported, then write these cryptographic algorithms into the software code of BootROM, and write the hash of the root key and root certificate of the secure boot link into OTP / eFuse, thereby realizing the link logic of step-by-step verification.

[0004] However, with the rapid development and unpredictability of technology, traditional cryptography often faces challenges in the face of quantum computing and supercomputers, which makes it necessary to upgrade the cryptographic algorithms of chips that have already been taped out before the end of their life cycle. At present, regarding the need to upgrade cryptographic algorithms or patch, BootROM can only be re-taped or implemented in iterative chips, resulting in a lack of flexibility in BootROM and difficulty in ensuring the security of BootROM. Summary of the invention

[0005] The embodiments of the present application provide a BootROM expansion method, device, electronic device and storage medium to improve the above-mentioned problems.

[0006] In a first aspect, an embodiment of the present application provides a BootROM expansion method, which includes: separating a portion of the BootROM that meets a preset condition to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM; and establishing a protocol channel with a server through the extended image.

[0007] In a second aspect, an embodiment of the present application provides a BootROM expansion device. The device includes a separation module and a communication module. The separation module is used to separate the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM. The communication module is used to establish a protocol channel with the server through the extended image.

[0008] In a third aspect, an embodiment of the present application provides an electronic device. The electronic device includes a memory, one or more processors, and one or more applications. The one or more applications are stored in the memory and are configured to execute the BootROM expansion method provided in the embodiment of the present application when called by the one or more processors.

[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a program code stored therein, wherein the program code is configured to execute the BootROM expansion method provided in the embodiment of the present application when called by a processor.

[0010] The embodiment of the present application provides a BootROM expansion method, device, electronic device and storage medium. By separating the part of the BootROM that meets the preset conditions, an extended image of the BootROM is formed, wherein the extended image has the same security level as the BootROM; a protocol channel is established with the server through the extended image, so that a part of the protocol logic of the BootROM can be implemented through the extended image with the same security level as the BootROM, and the BootROM is elastically expanded, thereby improving the security and flexibility of the BootROM. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 It is a schematic diagram of an application scenario of the BootROM expansion method provided in an embodiment of the present application;

[0013] Figure 2 It is a flowchart of a BootROM expansion method provided in an embodiment of the present application;

[0014] Figure 3 is a flowchart of a BootROM expansion method provided in another embodiment of the present application;

[0015] Figure 4 is a flowchart of step S250 in a BootROM expansion method provided by another embodiment of an exemplary embodiment of the present application;

[0016] Figure 5 1 is a flowchart of a BootROM expansion method provided in another embodiment of the present application;

[0017] Figure 6 1 is a flowchart of a BootROM expansion method provided in yet another embodiment of the present application;

[0018] Figure 7 It is a flowchart of a BootROM expansion method provided by an exemplary embodiment of the present application;

[0019] Figure 8 It is a structural block diagram of a BootROM expansion device provided in an embodiment of the present application;

[0020] Fig. 9 is a structural block diagram of an electronic device provided in an embodiment of the present application;

[0021] Fig.10 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0023] As mentioned above, in the current SoC secure boot solution, OTP / eFuse and BootROM are usually used as trusted anchors for the security link, and the integrity and authenticity of the loaded image are verified through cryptographic algorithms. Since the code in BootROM is fixed on the chip, the cryptographic algorithms supported by BootROM will also be fixed. The need for new algorithms or security patches can only be re-taped, resulting in the inability to upgrade the algorithm in a timely and effective manner. In other words, the security verification algorithm in BootROM is not flexible. In addition, since BootROM is the first software stage executed by SoC, the content of BootROM is usually not encrypted. It can only be exported by BootROM for special research, such as targeted analysis of the logic and algorithm of security verification, which leads to the risk of attack on the secure boot link.

[0024] Based on this, the embodiments of the present application provide a BootROM expansion method, device, electronic device and storage medium, which separate the part of the BootROM that meets the preset conditions into a BootROM extension (Secure BootROM eXtension, SBX) image, and implement a part of the BootROM generation protocol logic through the SBX image with the same security level as the BootROM, thereby flexibly expanding the BootROM, improving the flexibility of the BootROM while ensuring the security of the BootROM.

[0025] See also Figure 1 , Figure 1 Schematic diagram of application scenario of the BootROM expansion method provided in the embodiment of the present application. The BootROM expansion system 10 includes hardware OTP / eFuse 11, production line tool 12, and server 13. The server 13 can establish a protocol channel with OTP / eFuse 11 through the production line tool 12.

[0026] In some embodiments, OTP / eFuse 11 may include BootROM 111 , SBX image 112 , and boot loader (BootLoader) 113 .

[0027] BootROM111 is the part that is fixed on the chip after it is manufactured and cannot be changed.

[0028] SBX image 112 is a customized part of the chip according to the needs of the equipment customer after the chip arrives at the chip manufacturer. SBX image 112 can be considered as an elastic extension of BootROM 111. After burning OTP / eFuse 11, SBX image 112 cannot be changed like BootROM 111, making the security strength of SBX image 112 close to that of BootROM 111. Therefore, it can be considered that SBX image 112 has the same security level as BootROM 111.

[0029] BootLoader 113 is the first code executed by the embedded system after power-on. After it completes the initialization of the central processing unit (CPU) and related hardware, it loads the operating system image or the solidified embedded application into the memory, then jumps to the space where the operating system is located and starts the operating system. BootLoader 113 is loaded and verified by SBX image 112 to guide the subsequent startup process.

[0030] It should be noted that after the device leaves the factory, BootROM111 and SBX image 112 will not be upgraded or changed in any way (e.g., over-the-air upgrade, wire flash), that is, BootROM111 and SBX image 112 cannot be changed after the device leaves the factory. However, after the device leaves the factory, BootLoader113 can be updated through over-the-air upgrade, wire flash, or other methods not mentioned here, that is, BootLoader can still be modified after the device leaves the factory.

[0031] The production line tool 12 may be a communication device with a network connection function, such as a personal computer (PC). The embodiment of the present application does not impose any specific limitation on the production line tool 12.

[0032] The server 13 may be a network access server, a database server, a cloud server, etc. The embodiment of the present application does not impose any specific restrictions on the server 13.

[0033] The production line tool 12 and the server 13 may both include a processor (not shown in the figure), and the processors in the server 13 and the production line tool 12 may call and execute the code in OTP / eFuse11, so that the processor implements the function corresponding to the called code.

[0034] See also Figure 2 , Figure 2 1 is a flowchart of a BootROM expansion method provided in an embodiment of the present application. The BootROM method can be applied to the above-mentioned BootROM expansion system 10 and the following Figure 8 The BootROM expansion device 500 is shown. The BootROM expansion method includes the following steps S110 to S120.

[0035] Step S110, separating the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM.

[0036] Among them, the preset conditions include codes with expansion requirements or codes with separate encryption protection requirements, and their specific contents can be set according to actual business needs. The preset conditions can be input by the user or generated by the system by default. The embodiments of the present application do not make specific restrictions here. For example, in the secure boot feature, the chip supplier can separate the key code from the BootROM into the SBX image, customize different cryptographic algorithm modes and key lengths for the key code according to the needs of different customers, and encrypt the part of the code. By separating the part of the BootROM that meets the preset conditions and forming an SBX image based on the separated part, it is not only possible to avoid writing all the cryptographic algorithm modes and key lengths into the chip in order to be compatible with the needs of all customers, causing data redundancy, but also to streamline the code in the BootROM, reduce the design complexity of the BootROM, and improve the stability and robustness of the BootROM.

[0037] Among them, the SBX image is an image that can be loaded independently. As an extended image of BootROM, the SBX image can be regarded as a part of BootROM. As mentioned above, the SBX image can be upgraded before being burned to OTP / eFuse, that is, the SBX image has the ability to be updated before being burned to OTP / eFuse, making the SBX image more flexible, more stable and robust than the BootROM that has been solidified after chip manufacturing.

[0038] A BootROM in an embodiment of the present application may include an SBX image, and an SBX image may include multiple parts. Each part in the SBX image may correspond to different codes. For example, the above-mentioned code with expansion requirements or the code with separate encryption protection requirements can be stored in two different parts of the SBX image.

[0039] In some embodiments, the SBX image can be encrypted before being burned into the OTP / eFuse, thereby protecting the code inside the SBX image (e.g., the code for security verification, the code for key deployment), thereby improving the security of the code in the SBX image. As mentioned above, the SBX image is also solidified after being burned through the OTP / eFuse and cannot be changed. Therefore, the SBX image has the same security level as the BootROM.

[0040] In some embodiments, the processor may separate the code in the BootROM that meets preset conditions (for example, the code that has expansion requirements or the code that has separate encryption protection requirements) from the BootROM to form an SBX image.

[0041] As an implementation method, before the chip is manufactured and all algorithms that need to be supported are deployed in the BootROM, the specific implementation method of separating the code that meets the preset conditions from the BootROM may include the following steps 1 to 5:

[0042] Step 1: Accept the above preset conditions.

[0043] Step 2: Copy the code that meets the preset conditions in the BootROM (for example, the security verification code and the key deployment code), and write the copied code into the SBX image.

[0044] Step 3: Verify the code copied to the SBX image to determine whether the code copied to the SBX image is complete. Specifically, the hash value of the code copied to the SBX image and the hash value of the code in the BootROM that meets the preset conditions can be obtained respectively, and the hash value of the code copied to the SBX image is compared with the hash value of the code in the BootROM that meets the preset conditions.

[0045] Step 4: If the hash values ​​of the code copied to the SBX image and the code in the BootROM that meets the preset conditions are the same, it is determined that the code copied to the SBX image is complete. At this time, the code in the BootROM that meets the preset conditions can be deleted and the separation process ends.

[0046] Step 5. If the hash values ​​of the code copied to the SBX image and the code in the BootROM that meets the preset conditions are different, it is determined that the code copied to the SBX image is incomplete. At this time, the code in the BootROM that meets the preset conditions can be copied again and written into the SBX image, that is, jump to step 2.

[0047] As another implementation method, before the chip is manufactured, when the BootROM has not yet been deployed or has not yet started to be deployed, the code that meets the preset conditions is separated from the BootROM, and the code that meets the preset conditions that should have been deployed in the BootROM can be directly deployed to the SBX image, and the part of the code that meets the preset conditions is not deployed to the BootROM.

[0048] Step S120, establishing a protocol channel with the server through the extended mirror.

[0049] The SBX image includes code for establishing a protocol channel. For example, the code for establishing a protocol channel may be code for establishing a protocol channel obtained by a production line tool from a BootROM via a serial port or a Universal Serial Bus (USB).

[0050] In some embodiments, the processor calls and executes the code for establishing a protocol channel in the SBX image, and establishes a protocol channel with the server. Specifically, the processor can send the root certificate, root key and other contents to the server through the production line tool, so that the server can perform device authentication and key deployment based on the public key infrastructure (KPI) system according to the root certificate, root key and other contents. In this embodiment, by connecting the production line tool to the server through the SBX image to establish a protocol channel, the production line tool can be prevented from directly connecting to the BootROM, thereby effectively protecting the BootROM and avoiding vulnerabilities or attack surfaces of the communication protocol itself, and using the modifiable nature of the SBX image to assume and reduce possible risks in the BootROM, thereby improving the security of the BootROM.

[0051] The BootROM expansion method provided in the embodiment of the present application separates the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, and the extended image has the same security level as the BootROM. By implementing part of the protocol logic in the BootROM through the extended image, the BootROM can be elastically expanded, thereby improving the flexibility of the BootROM while ensuring the security of the BootROM. In addition, by establishing a protocol channel between the production line tool and the server through the SBX image docking, the production line tool can be prevented from directly docking with the BootROM, thereby effectively protecting the BootROM and avoiding vulnerabilities or attack surfaces of the communication protocol itself, and using the modifiable characteristics of the SBX image to assume and reduce possible risks in the BootROM, thereby improving the security of the BootROM.

[0052] See also Figure 3 , Figure 3 1 is a flowchart of a BootROM expansion method provided by another embodiment of the present application. The BootROM method can be applied to the above-mentioned BootROM expansion system 10 and the following Figure 8 The BootROM expansion device 500 is shown. The BootROM expansion method includes the following steps S210 to S260.

[0053] Step S210, separating the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM.

[0054] For the detailed description of step S210, please refer to step S110, which will not be repeated here.

[0055] Step S220, obtaining a hash value of the extended image and a hash value of the signature verification public key of the target image, wherein the code in the target image is executed after the code in the extended image is executed.

[0056] The target image may be the image where the code to be executed after the code of the SBX image is executed. For example, the code of the SBX image is currently being executed, and the code in the BootLoader will be called and executed next, so the BootLoader is the target image.

[0057] In some embodiments, the processor may obtain a hash value of the SBX image and a hash value of a signature verification public key of a target image (eg, BootLoader).

[0058] Step S230: Perform hash calculation on the hash value of the extended image and the hash value of the signature verification public key to obtain a digest value.

[0059] In some embodiments, the processor may concatenate the hash value of the extended image and the hash value of the signature verification public key to obtain a concatenation result; and perform a hash calculation on the concatenation result to obtain a digest value.

[0060] Step S240: If the digest value is the same as the preset value in the one-time programmable memory, a protocol channel is established with the server through the extended image.

[0061] The one-time programmable memory may be the above-mentioned OTP / eFuse. The preset value in the one-time programmable memory may be a hash value of the code data related to the public key in the OTP / eFuse, and different public keys correspond to different preset values, that is, the preset value in the OTP / eFuse may be determined according to the public key actually deployed, and the embodiment of the present application does not make any specific restrictions here.

[0062] In some embodiments, if the summary value is the same as the preset value of OTP / eFuse, it means that the signature verification public keys of the SBX image and the target image are complete. At this time, the processor can establish a protocol channel with the server by calling and executing the code for establishing the protocol channel in the SBX image.

[0063] In some embodiments, if the digest value is different from the preset value of OTP / eFuse, a prompt message may be issued to indicate that the signature verification public key of the SBX image and the target image is incomplete. The prompt message may be output in the form of voice, text, code, etc., so that the user can make corresponding solutions according to the prompt message.

[0064] In other embodiments, if the digest value is different from the preset value of OTP / eFuse, the first repair program can be called and executed to repair the incomplete SBX image and / or the target image's signature verification public key, obtain the repaired SBX image and / or the target image's signature verification public key, perform hash calculation on the repaired SBX image and / or the target image's signature verification public key, obtain a new digest value, and compare the new digest value with the preset value of OTP / eFuse until the complete SBX image and / or the target image's signature verification public key is determined. The first repair program can be pre-deployed by the developer in OTP / eFuse or SBX image or BootROM to repair the incomplete SBX image and / or the target image's signature verification public key, so that the repaired SBX image and the target image's signature verification public key are in a complete state. The specific content of the repair program can be set according to the actual deployment of the signature verification public key, and is not specifically limited here.

[0065] In some other embodiments, if the digest value is different from the preset value of OTP / eFuse, after issuing the above prompt information, the second repair program can be called to repair the incomplete SBX image and / or the target image's signature verification public key, obtain the repaired SBX image and / or the target image's signature verification public key, perform hash calculation on the repaired SBX image and / or the target image's signature verification public key, obtain a new digest value, and compare the new digest value with the preset value of OTP / eFuse until the complete SBX image and / or the target image's signature verification public key is determined. Among them, the second repair program can be deployed in OTP / eFuse by the developer after receiving the above prompt information, and is used to repair the incomplete SBX image and / or the target image's signature verification public key, so that the repaired SBX image and the target image's signature verification public key are in a complete state. The specific content of the repair program can be set according to the actual deployment of the signature verification public key, and is not specifically limited here.

[0066] Step S250, performing a validity check on the target image to obtain a validity check result.

[0067] In a conventional secure boot, the upper-level image usually performs a legitimacy check on the lower-level image (that is, the target image mentioned above). Only after the check can the processor jump from executing the code in the upper-level image to executing the code in the lower-level image to ensure the security of the data processing process. Among them, the upper-level image and the lower-level image are relative concepts and are not fixed. For example, the processor is currently executing the code in the SBX image, and after executing the code in the SBX image, it will execute the code in the BootLoader. In this case, the SBX image can be considered as the upper-level image, and accordingly, the BootLoader can be considered as the lower-level image. Therefore, in order to ensure the security of data processing, it is necessary to perform a legitimacy check on the target image.

[0068] In some embodiments, the implementation method of the legitimacy check on the target image can be as follows: the processor can parse the target image to obtain the public key, signature value and code data to be checked of the target image; use the public key to decrypt the signature value to obtain a first hash value; calculate the code data to be checked to obtain a second hash value; if the first hash value is the same as the second hash value, generate a legitimacy check result indicating that the legitimacy check has passed.

[0069] As an implementation method, the processor can call and execute the code in the SBX image (the code can be pre-deployed in the SBX image, and when called by the processor, the processor can execute Figure 4 Steps S251 to S256 are shown to perform Figure 4 Steps S251 to S256 are shown, thereby performing a validity check on the target image:

[0070] Step S251, load the target image from the Flash into a random access memory (RAM), and parse the public key, signature value and code data to be verified of the target image.

[0071] Among them, Flash is a kind of storage chip, and the data in Flash can be modified through specific programs. RAM is an internal memory that directly exchanges data with the CPU and can read and write data at any time.

[0072] In some embodiments, the public key, signature value, and code data to be verified of the target image can be parsed according to the deployment location of the public key, signature value, and code data to be verified in the target image. The deployment location of the public key, signature value, and code data to be verified in the target image can be default or customized by the developer, and the embodiments of the present application do not make specific restrictions here.

[0073] As an implementation method, if the deployment location of the public key, signature value and code data to be verified in the target image is the default, the public key, signature value and code data to be verified in the default location in the target image can be directly obtained respectively.

[0074] As another implementation method, if the deployment location of the public key, signature value, and code data to be verified in the target image is customized by the developer, it is necessary to first obtain the comments or customized program about the customized part of the code from the target image. Decrypt the comments or customized program of the customized part of the code to obtain the deployment location of the public key, signature value, and code data to be verified in the target image. Obtain the public key, signature value, and code data to be verified in the default location of the target image respectively.

[0075] In other embodiments, the public key, signature value and code data to be verified can also be directly searched in the target image based on the key information of the public key, signature value and code data to be verified, so as to parse the public key, signature value and code data to be verified of the target image. Among them, the key information of the public key, signature value and code data to be verified can be specific keywords, strings, code snippets and other information that can be used to search for the public key, signature value and code data to be verified. The specific content of the key information can be customized by the developer in the actual application scenario, and the embodiments of the present application are not specifically limited here.

[0076] Step S252, obtaining the hash value of the public key of the target image.

[0077] Step S253: If the hash value of the public key is the same as the hash value in the OTP / eFuse, it is determined that the public key is complete, and steps S255 to S256 are executed.

[0078] In some embodiments, if the hash value of the public key is different from the hash value in the OTP / eFuse, the public key is determined to be incomplete, and a prompt message is issued to indicate that the public key is incomplete. The prompt message can be output in the form of voice, text, code, etc., so that the user can make a corresponding solution according to the prompt message.

[0079] In other embodiments, if the hash value of the public key is different from the hash value in OTP / eFuse, the first repair program can be called and executed to repair the public key of the incomplete target image, obtain the public key of the repaired target image, perform hash calculation on the public key of the repaired target image, obtain the hash value of the new public key, and compare the hash value of the new public key with the hash value in OTP / eFuse until the complete public key is determined. Among them, the first repair program can be pre-deployed by the developer in OTP / eFuse or SBX image or BootROM to repair the public key of the incomplete target image so that the public key of the repaired target image is in a complete state. The specific content of the repair program can be set according to the deployment of the public key of the actual target image, and is not specifically limited here.

[0080] In some other embodiments, if the hash value of the public key is different from the hash value in OTP / eFuse, after issuing the above prompt information, a second repair program can be called to repair the public key of the incomplete target image to obtain the public key of the repaired target image, perform hash calculation on the public key of the repaired target image to obtain the hash value of the new public key, and compare the hash value of the new public key with the hash value in OTP / eFuse until the complete public key is determined. Among them, the second repair program can be deployed in OTP / eFuse by the developer after receiving the above prompt information, and is used to repair the public key of the incomplete target image so that the public key of the repaired target image is in a complete state. The specific content of the repair program can be set according to the deployment of the public key of the actual target image, and the embodiments of the present application are not specifically limited here.

[0081] Step S254: Decrypt the signature value of the target image using the public key to obtain a first hash value.

[0082] Step S255 , calculating the hash value of the code data to be verified of the target image to obtain a second hash value.

[0083] In some embodiments, the code data to be verified of the target image may be calculated by first obtaining a hash algorithm in the target image, and then calculating the code data to be verified of the target image using the same hash algorithm as the target image.

[0084] Step S256, if the first hash value and the second hash value are the same, a legality check result is generated indicating that the legality check has passed. If the first hash value and the second hash value are different, a prompt message indicating that the legality check has not passed is generated, and the code in the target image is not executed. The prompt message can be output in the form of voice, text, code, etc., and the embodiment of the present application does not make specific restrictions here.

[0085] In particular, if the public key, signature value and code data to be verified of the target image are encrypted, before executing the above steps S251 to S256, it is also necessary to obtain the symmetric encryption key from OTP / eFuse and use the symmetric encryption key to decrypt the public key, signature value and code data to be verified of the target image.

[0086] Step S260: If the validity check result indicates that the validity check has passed, the code in the target image is executed.

[0087] In some embodiments, if the legitimacy check result indicates that the legitimacy check has passed, the processor can call and execute the code in the target image to implement the function corresponding to the code. The code can be pre-written in the SBX image, and the specific content of the code can be designed according to actual needs, and no specific restrictions are made here.

[0088] The embodiment of the present application provides a method for separating the portion of the BootROM that meets preset conditions into an extended image of the BootROM. The extended image has the same security level as the BootROM, and some protocol logic in the BootROM can be implemented through the extended image, for example, the target image is verified, thereby realizing the elastic expansion of the BootROM, thereby improving the flexibility of the BootROM while ensuring the security of the BootROM.

[0089] See also Figure 5 , Figure 5 1 is a flowchart of a BootROM expansion method provided by another embodiment of the present application. The BootROM method can be applied to the above-mentioned BootROM expansion system 10 and the following Figure 8 The BootROM expansion device 500 is shown. The BootROM expansion method includes the following steps S310 to S370.

[0090] Step S310, separating the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM.

[0091] The specific description of step S310 can be found in step S110 , which will not be repeated here.

[0092] Step S320, obtaining the unique device identifier and the hash value of the extended image.

[0093] The unique device identifier may refer to information used to uniquely identify hardware, and the unique device identifier is usually a 128-bit or 256-bit value fixed in the hardware. For example, the unique device identifier may be a hardware unique identifier (HUK), a unique device secret (UDS), a chip unique identity document (CUID), or a device identity document (DID).

[0094] In some embodiments, the processor may obtain a unique device identifier and a hash value of the extended image.

[0095] Step S330, generating a device secret value (DSV) according to the hash value of the extended image and the device unique identifier.

[0096] In some embodiments, the processor may use a key derive function (KDF) to generate a device secret value based on the hash value of the SBX image and the device unique identifier. Among them, KDF may implement algorithms such as logical XOR, HMAC-SHA256, AES-ECB, and AES-CMAC.

[0097] Step S340: pass the device secret value into the extended image, and control the extended image to generate an asymmetric key according to the device secret value.

[0098] As an implementation method, the processor can perform the following operations by calling and executing the code in the SBX image (the code can be pre-set in the SBX image, and when called by the processor, the following steps 1 to 5 can be executed), thereby obtaining the asymmetric key:

[0099] Step 1: Get the 256-bit device secret value from the BootROM.

[0100] Step 2: Select Counter=1 to perform the hash operation "SHA256(DSV, Counter)" to obtain a 256-bit hash value.

[0101] Step 3: Perform a modular operation on the 256-bit hash value to obtain the elliptic curve private key.

[0102] Step 4: If the elliptic curve private key does not meet the preset algorithm requirements, increment the Counter value by 1 and repeat the hash operation "SHA256(DSV,Counter)" until the public key is derived from the private key.

[0103] Step 5: If the private key of the elliptic curve meets the preset algorithm requirements, the private key of the elliptic curve is used as the public key. The preset algorithm requirements can be set according to actual needs, and the embodiment of the present application does not make specific restrictions here.

[0104] Step S350: Establish a protocol channel with the server through the extended image based on the asymmetric key.

[0105] In some embodiments, the processor can transmit asymmetric keys, device root certificates and other contents to the server through production line tools, so that the server can perform device authentication and key deployment based on the KPI system according to the root certificate and root key.

[0106] Step S360, performing a validity check on the target image to obtain a validity check result.

[0107] Step S370: If the validity check result indicates that the validity check has passed, the code in the target image is executed.

[0108] Among them, the specific description of steps S360 to S370 can be found in steps S250 to S260, and the embodiments of the present application will not be repeated here.

[0109] The embodiment of the present application provides a method for separating the part of the BootROM that meets the preset conditions into an extended image of the BootROM. The extended image has the same security level as the BootROM, and some protocol logic in the BootROM can be implemented through the extended image. For example, an asymmetric key is generated according to the device unique identifier and the hash value of the extended image, thereby realizing the elastic expansion of the BootROM, thereby improving the flexibility of the BootROM while ensuring the security of the BootROM.

[0110] See also Figure 6 , Figure 6 1 is a flowchart of a BootROM expansion method provided by another embodiment of the present application. The BootROM method can be applied to the above-mentioned BootROM expansion system 10 and the following Figure 8 The BootROM expansion device 500 is shown. The BootROM expansion method includes the following steps S410 to S490.

[0111] Step S410, separating the part of the BootROM that meets the preset condition to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM.

[0112] For the detailed description of step S410, please refer to step S110, which will not be repeated here.

[0113] Step S420, obtaining a hash value of the extended image and a hash value of the signature verification public key of the target image, wherein the code in the target image is executed after the code in the extended image is executed.

[0114] Step S430: Perform hash calculation on the hash value of the extended image and the hash value of the signature verification public key to obtain a digest value.

[0115] For the detailed description of step S420 to step S430, please refer to step S220 to step S230, which will not be repeated here.

[0116] Step S440: If the digest value is the same as the preset value in the one-time programmable memory, the hash value of the device unique identifier and the extended image is obtained.

[0117] Step S450: Generate a device secret value according to the hash value of the extended image and the device unique identifier.

[0118] Step S460: pass the device secret value into the extended image, and control the extended image to generate an asymmetric key according to the device secret value.

[0119] Step S470: Establish a protocol channel with the server through the extended image based on the asymmetric key.

[0120] Among them, the specific description of steps S440 to S470 can be found in steps S320 to S350, and the embodiments of the present application will not be repeated here.

[0121] Step S480, performing a validity check on the target image to obtain a validity check result.

[0122] Step S490: If the validity check result indicates that the validity check has passed, the code in the target image is executed.

[0123] Among them, the specific description of steps S480 to S490 can be found in steps S250 to S260, and the embodiments of the present application will not be repeated here.

[0124] The embodiment of the present application provides a method for separating the part of the BootROM that meets the preset conditions into an extended image of the BootROM. The extended image has the same security level as the BootROM, and some protocol logic in the BootROM can be implemented through the extended image. For example, the target image is verified and an asymmetric key is generated according to the device unique identifier and the hash value of the extended image, thereby realizing the elastic expansion of the BootROM, thereby improving the flexibility of the BootROM while ensuring the security of the BootROM.

[0125] See also Figure 7 , Figure 71 is a flowchart of a BootROM expansion method provided by an exemplary embodiment of the present application. The BootROM method can be applied to the above-mentioned BootROM expansion system 10 and the following Figure 8 The BootROM expansion device 500 is shown. The BootROM expansion method may include the following steps 1 to 5:

[0126] Step 1: Separate the parts of BootROM that need to be expanded and / or have separate encryption protection to form an independent SBX image. The SBX image is an extended image of BootROM. The SBX image and BootROM have the same security level, and SBX does not support any modification in the market commodity stage.

[0127] Step 2: BootROM verifies SBX. Specifically, BootROM performs an overall HASH calculation on the hash value of the SBX image and the hash value of the signature verification public key of the target image (BootLoader) to obtain a summary value, and compares the obtained summary value with the hash value in OTP / eFuse to confirm the integrity of the signature verification public key of the SBX image and the target image. If the summary value is the same as the hash value in OTP / eFuse, it is determined that the signature verification public key of the SBX image and the target image is complete, and steps 3 to 5 are executed; if the summary value is different from the hash value in OTP / eFuse, it is determined that the signature verification public key of the SBX image and the target image is incomplete, and a prompt message is issued to indicate that the signature verification public key of the SBX image and the target image is incomplete.

[0128] Step 3: BootROM generates a device secret value based on the hash value of the SBX image and the device unique identifier, and transfers the device secret value to the SBX image.

[0129] In step 4, the SBX image generates an asymmetric key based on the device secret value, and sends the asymmetric key and device root certificate to the server through the production line tool, so that the server can perform device authentication and key deployment based on the KPI system according to the root certificate and root key.

[0130] Step 5: SBX image verifies the legitimacy of the target image. Subsequent images will be verified step by step by the previous image to form a complete trusted image chain.

[0131] In particular, the SBX image can further encrypt the code in the SBX image, and the BootROM can decrypt the code.

[0132] For the parts of steps 1 to 5 above that are not described in detail, please refer to the corresponding parts in the above method embodiment, and the embodiments of this application will not be repeated here.

[0133] In summary, the BootROM expansion method provided in the embodiment of the present application, by separating the parts that meet the preset conditions to form an SBX image, elastically expands the BootROM, and utilizes the semi-solidified characteristics of the SBX image to ensure security and achieve flexibility. The unchangeable mechanism in OTP / eFuse is used to verify the integrity and authenticity of the SBX image, avoids the redundant design of BootROM, reduces the design complexity of BootROM, improves the stability and robustness of BootROM, reduces the size, area, and power consumption of BootROM, and reduces the cost. The SBX image is connected to the production line tool to avoid the production line tool directly connecting to BootROM, which can effectively protect BootROM and avoid the loopholes or attack surfaces of the communication protocol itself, and use the modifiable characteristics of the SBX image to bear and reduce the possible risks in BootROM. In addition, by controlling the burning process and stage of OTP / eFuse and SBX image, the faults and loopholes in BootROM can be solved before the equipment production line, and customized design can be made for the same batch of chips according to market segmentation, thereby effectively reducing the possibility of overproduction and cross-products.

[0134] See also Figure 8 , Figure 8 It is a structural block diagram of the BootROM expansion device provided in the embodiment of the present application. The BootROM expansion device 500 can be applied to the above-mentioned BootROM expansion system 10 to execute the BootROM expansion method provided in the embodiment of the present application. The BootROM expansion device 500 includes a separation module 510 and a communication module 520. Among them, the separation module 510 is used to separate the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM. The communication module 520 is used to establish a protocol channel with the server through the extended image.

[0135] In some embodiments, the preset conditions may include a code that has an extension requirement and a code that has a separate encryption protection requirement.

[0136] In some embodiments, the communication module 520 includes a first acquisition submodule, a first calculation submodule and a first communication submodule. Among them, the first acquisition submodule is used to obtain the hash value of the extended image and the hash value of the signature verification public key of the target image, wherein the code in the target image is executed after the code in the extended image is executed. The first calculation submodule is used to perform hash calculation on the hash value of the extended image and the hash value of the signature verification public key to obtain a summary value. The first communication submodule is used to establish a protocol channel with the server through the extended image if the summary value is the same as the preset value in the one-time programmable memory.

[0137] In some embodiments, the first computing submodule includes a splicing unit and a computing unit. The splicing unit is used to splice the hash value of the extended image and the hash value of the signature verification public key to obtain a splicing result. The computing unit is used to perform hash calculation on the splicing result to obtain a digest value.

[0138] In some embodiments, the BootROM expansion device 500 further includes a verification module and an execution module. The verification module is used to perform a legality check on the target image to obtain a legality check result. The execution module is used to execute the code in the target image if the legality check result indicates that the legality check has passed.

[0139] In some embodiments, the verification module includes a parsing submodule, a decryption submodule, a second calculation submodule and a verification submodule. Among them, the parsing submodule is used to parse the target image to obtain the public key, signature value and code data to be verified of the target image. The decryption submodule is used to decrypt the signature value using the public key to obtain a first hash value. The second calculation submodule is used to calculate the code data to be verified to obtain a second hash value. The verification submodule is used to generate a legitimacy verification result indicating that the legitimacy verification has passed if the first hash value is the same as the second hash value.

[0140] In some embodiments, the communication module 520 also includes a second acquisition submodule, a first generation submodule, a second generation submodule, and a second communication submodule. Among them, the second acquisition submodule is used to obtain the device unique identifier and the hash value of the extended image. The first generation submodule is used to generate a device secret value according to the hash value of the extended image and the device unique identifier. The second generation submodule is used to pass the device secret value into the extended image, and control the extended image to generate an asymmetric key according to the device secret value. The second communication submodule is used to establish a protocol channel with the server through the extended image based on the asymmetric key.

[0141] Those skilled in the art can clearly understand that the BootROM expansion device 500 provided in the embodiment of the present application can implement the BootROM expansion method provided in the embodiment of the present application. The specific working process of the above-mentioned device and module can refer to the process corresponding to the BootROM expansion method in the embodiment of the present application, which will not be repeated here.

[0142] In the embodiments provided in the present application, the coupling, direct coupling or communication connection between the modules shown or discussed may be indirect coupling or communication coupling through some interfaces, devices or modules, and may be electrical, mechanical or other forms, and the embodiments of the present application are not limited to this.

[0143] In addition, each functional module in the embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules, which is not limited in the embodiment of the present application.

[0144] See also Fig. 9 , Fig. 9 600 may include one or more of the following components: a memory 610, one or more processors 620, and one or more applications, wherein the one or more applications may be stored in the memory 610 and configured to, when called by the one or more processors 620, enable the one or more processors 620 to execute the method provided in the embodiment of the present application.

[0145] The processor 620 may include one or more processing cores. The processor 620 uses various interfaces and lines to connect various parts of the entire electronic device 600, and is used to run or execute instructions, programs, code sets or instruction sets stored in the memory 610, and call to run or execute data stored in the memory 610, and execute various functions and process data of the electronic device 600. Optionally, the processor 620 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (ProgrammableLogic Array, PLA). The processor 620 can integrate one or a combination of a central processing unit (CentralProcessing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 620, and may be implemented separately through a communication chip.

[0146] The memory 610 may include a random access memory (RAM) or a read-only memory (ROM). The memory 610 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 610 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may store data created by the electronic device 600 during use, etc.

[0147] See also Fig.10 , Fig.10 The computer-readable storage medium 700 stores a program code 710, which is configured to cause the processor to execute the method provided in the embodiment of the present application when called by the processor.

[0148] Computer readable storage medium 700 can be an electronic storage such as flash memory, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), hard disk or ROM. Optionally, computer readable storage medium 700 includes non-transitory computer readable medium (Non-TCRSM). Computer readable storage medium 700 has storage space for program code 710 that performs any method step in the above method. These program codes 710 can be read from one or more computer program products or written into one or more computer program products. Program code 710 can be compressed in an appropriate form.

[0149] In summary, the BootROM expansion method, device, electronic device and storage medium provided in the embodiments of the present application separate the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the extended image has the same security level as the BootROM; a protocol channel is established with the server through the extended image, so that a part of the protocol logic of the BootROM can be implemented through the extended image with the same security level as the BootROM, and the BootROM is flexibly expanded, thereby improving the security and flexibility of the BootROM.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not drive the essence of the corresponding technical solutions out of the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A BootROM expansion method, characterized in that: The method comprises: Separate the part of the BootROM that meets the preset conditions to form an extended image of the BootROM, wherein the preset conditions include the existence of code with expansion requirements or the existence of code with separate encryption protection requirements, and the extended image is solidified after burning and cannot be changed, and has the same security level as the BootROM; A protocol channel is established with the server through the extended mirror.

2. The method according to claim 1, characterized in that The establishing a protocol channel with the server through the extended image includes: Obtaining a hash value of the extended image and a hash value of a signature verification public key of the target image, wherein the code in the target image is executed after the code in the extended image is executed; Performing hash calculation on the hash value of the extended image and the hash value of the signature verification public key to obtain a digest value; If the digest value is the same as the preset value in the one-time programmable memory, a protocol channel is established with the server through the extended image.

3. The method according to claim 2, characterized in that The step of performing hash calculation on the hash value of the extended image and the hash value of the signature verification public key to obtain a digest value includes: Concatenate the hash value of the extended image and the hash value of the signature verification public key to obtain a concatenation result; The hash calculation is performed on the concatenation result to obtain the digest value.

4. The method according to claim 2, characterized in that: After establishing a protocol channel with the server through the extended image, the method further includes: Performing a validity check on the target image to obtain a validity check result; If the legality check result indicates that the legality check passes, the code in the target image is executed.

5. The method according to claim 4, characterized in that The performing a validity check on the target image to obtain a validity check result includes: Parsing the target image to obtain the public key, signature value and code data to be verified of the target image; Decrypting the signature value using the public key to obtain a first hash value; Calculating the code data to be verified to obtain a second Hash value; If the first Hash value is the same as the second Hash value, a legitimacy check result indicating that the legitimacy check has passed is generated.

6. The method according to any one of claims 1 to 5, characterized in that: The establishing a protocol channel with the server through the extended image includes: Obtaining a unique device identifier and a hash value of the extended image; Generate a device secret value according to the hash value of the extended image and the device unique identifier; The device secret value is passed into the extended image, and the extended image is controlled to generate an asymmetric key according to the device secret value; Based on the asymmetric key, a protocol channel is established with the server through the extended image.

7. A BootROM expansion device, characterized in that: The device comprises: A separation module, used to separate a portion of the BootROM that meets a preset condition to form an extended image of the BootROM, wherein the preset condition includes a code that has an extension requirement or a code that has a separate encryption protection requirement, and the extended image is solidified after burning and cannot be changed, and has the same security level as the BootROM; The communication module is used to establish a protocol channel with the server through the extended image.

8. An electronic device, characterized in that: include: Memory; one or more processors; One or more application programs, wherein the one or more application programs are stored in the memory and configured to, when called by the one or more processors, enable the one or more processors to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, and when the program codes are configured to be called by a processor, the processor executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Fault tolerance design process for update and rollback of embedded processor boot program

    AU2021106084A4

  • Embedded system start method and device

    CN102520992A

  • SoC chip security design method and hardware platform

    CN112784280A

  • Guide memory and its construction method and usage

    CN1437113A