Secure boot program loading method, apparatus, and device, and medium

By compiling and verifying the key within an image file before loading the Secure Boot security boot loading program, the method addresses the error-prone key writing process, reducing the risk of main chip failure and ensuring reliable Secure Boot loading.

WO2025055097A1PCT designated stage expired Publication Date: 2025-03-20TAICANG T&W ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/130380
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-11
Filing Date
2023-11-08
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

The existing Secure Boot secure boot loading process is prone to errors during key file writing, leading to frequent key file miswriting and potential damage to the main chip, as the main chip defaults without a key and cannot load the Secure Boot secure boot loading program, resulting in chip failure if errors occur during the key writing process.

Method used

A method that compiles the key, key verification values, Non Secure Boot non-security boot loading program, and Secure Boot security boot loading program into a single image file, verifies the key, and then loads the Secure Boot security boot loading program, reducing the likelihood of key writing errors and subsequent chip failure by validating the key before writing it to the chip.

Benefits of technology

This approach significantly reduces the error rate during key writing and minimizes the risk of main chip failure by validating the key and ensuring accurate loading of the Secure Boot security boot loading program, thereby enhancing the reliability of the Secure Boot process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023130380_20032025_PF_FP_ABST
    Figure CN2023130380_20032025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network devices of Linux embedded systems such as switches, ONUs, HGUs, and 5G, and in particular to a secure boot program loading method, apparatus, and device, and a medium. The secure boot program loading method comprises: reading and determining a first verification value of a flash key in a flash and a second verification value in a server; reading a flash key, and on the basis of the flash key, calculating a third verification value; determining the third verification value and the first verification value; and finally replacing a not secure boot program with the secure boot program. According to the present application, by utilizing the privacy of an image file, the key, a key verification value, the not secure boot program, and the secure boot program are compiled into one image file according to specific rules, and then the key is verified, so that the error rate in a key writing process is reduced, thereby reducing main chip scrapping caused by the key writing error.
Need to check novelty before this filing date? Find Prior Art

Description

A method, apparatus, device and medium for secure boot loader Technical Field

[0001] The present invention relates to the field of network equipment of Linux embedded systems such as switches, ONUs, HGUs, and 5G, and in particular to a method, apparatus, device, and medium for securely booting a program. Background Art

[0002] As users become increasingly aware of device security, the Secure Boot application has become a standard requirement. To meet safety production requirements, key files cannot be frequently transferred, as this can easily lead to leaks. By default, the main chip does not contain a key and cannot load the Secure Boot application. Therefore, a process is required to write the key, load the Secure Boot application, and then load the kernel and rootfs. During the key writing process, any incorrect or inaccurate key writing can render the entire main chip useless.

[0003] Summary of the Invention

[0004] In order to reduce the error rate during the key writing process and at the same time reduce the main chip being scrapped due to key writing errors, the present invention provides a method, device, equipment and medium for a Secure Boot secure boot loader. The method utilizes the privacy of the image file, compiles the key, key check value, Non Secure Boot non-secure boot loader and Secure Boot secure boot loader into an image file according to specific rules, and then verifies the key, thereby reducing the error rate during the key writing process and further reducing the main chip being scrapped due to key writing errors.

[0005] In a first aspect, the present application provides a method for securely booting a program, which adopts the following technical solutions:

[0006] A method for securely booting a program, comprising the following steps:

[0007] S11, compiling the non-secure boot loader, the secure boot loader, the secret key, and the checksum into an image file according to specific rules, and then loading the non-secure boot loader;

[0008] S12, the non-secure boot loader reads the register and determines whether the security key is stored in the SOC non-volatile memory inside the CPU. If so, it proceeds to step S13; if not, it proceeds to step S14;

[0009] S13, load the Secure kernel software, and then load the Secure file system;

[0010] S14, read the first check value of the flash key in the flash;

[0011] S15, reading the second check value in the server;

[0012] S16, determine whether the second check value matches the first check value, if so, proceed to S17, if not, proceed to S18;

[0013] S17, read the flash key in the flash, and calculate the third check value based on the flash key, and then determine whether the third check value matches the first check value. If so, enter S13, if not, enter S18;

[0014] S18. Input error information and stop running the non-secure boot loader.

[0015] Preferably, the S17 further includes the following steps:

[0016] S171. If the third verification value matches the first verification value, the flash key is burned into the SOC non-volatile memory inside the CPU of the main chip.

[0017] Preferably, the step S17 further includes the following steps:

[0018] S172, the non-secure boot loader reads the register and determines whether the flash key is stored in the SOC non-volatile memory inside the CPU. If so, it enters S13, if not, it enters S18.

[0019] Preferably, the S17 further includes the following steps:

[0020] S1721: If the flash key is stored in the non-volatile memory of the SOC inside the CPU, the Secure Boot secure boot loader in the flash chip is read and overwritten with the Not Secure Boot non-secure boot loader. The system is then restarted and the process proceeds to S13.

[0021] In a second aspect, the present application provides a device for securely booting a program, which adopts the following technical solution:

[0022] A device for secure boot loading program, including the following modules:

[0023] The first loading module is used to load the Not Secure Boot non-secure boot loader and the Secure Boot secure boot loader;

[0024] A judgment module, configured to judge whether a security key is stored in the SOC non-volatile memory inside the CPU, whether the first check value matches the second check value, whether the third check value matches the first check value, and whether a flash key is stored in the SOC non-volatile memory inside the CPU;

[0025] A reading module is used to read the register, the first check value in the flash, the second check value in the server, the calculated third check value, and read the Not Secure Boot non-secure boot loader and the Secure Boot secure boot loader;

[0026] A calculation module, configured to calculate a third check value based on the flash key;

[0027] Overlay module, used to overwrite the Not Secure Boot non-secure boot loader with the Secure Boot secure boot loader;

[0028] A restart module for restarting the system; and

[0029] The second loading module is used to load the Secure kernel software and the Secure file system in sequence.

[0030] In a third aspect, the present application provides a device for securely booting a program, which adopts the following technical solutions:

[0031] A device for a Secure Boot secure boot loader, comprising:

[0032] One or more processors;

[0033] Memory;

[0034] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the method of the Secure Boot secure boot loader described above.

[0035] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0036] A computer-readable storage medium stores a computer program thereon, wherein the program, when executed by a processor, implements the above-mentioned method of a Secure Boot secure boot loader.

[0037] In summary, the present invention has the following beneficial technical effects:

[0038] 1. This application utilizes the privacy of the image file, compiles the secret key, key check value, Non Secure Boot non-secure boot loader and Secure Boot secure boot loader into an image file according to specific rules, and then verifies the secret key, thereby reducing the error rate in the key writing process, thereby reducing the main chip scrapping caused by key writing errors.

[0039] 2. This application verifies whether the first check value of the flash key matches the second check value in the server, then calculates a third check value based on the flash key, and then verifies whether the third check value matches the first check value, which is equivalent to verifying whether the first check value is the true check value of the flash key. When both of the above checks match, the Secure Boot secure boot loader is loaded to overwrite the already loaded Not Secure Boot non-secure boot loader, and finally the system is restarted. After restarting, the Secure kernel software and Secure file system are loaded again. This process not only reduces the error rate in the key writing process, but also greatly reduces the main chip scrapping caused by key writing errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG1 is a flow chart of an embodiment of the present invention.

[0041] FIG2 is a hardware structure diagram of a method for automatically burning a secret key and a Secure Boot secure boot loader and completing software loading according to an embodiment of the present invention.

[0042] FIG3 is a production test flow chart of a method for automatically burning a secret key and a Secure Boot secure boot loader and completing software loading according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present application is further described in detail below with reference to the accompanying drawings.

[0044] After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.

[0045] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0046] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.

[0047] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.

[0048] The embodiments of the present application provide a method for securely booting a program using Secure Boot, which is executed by an electronic device, which can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be, but is not limited to, a smartphone, a tablet computer, a laptop computer, or a desktop computer. The terminal device and the server can be connected directly or indirectly via wired or wireless communication, which is not a limitation of the embodiments of the present application.

[0049] 1 , the Secure Boot method includes the following steps:

[0050] S11, compile the non-secure boot loader and the secure boot loader, the secret key and the checksum into an image file according to specific rules, and then run the Not Secure Boot non-secure boot loader;

[0051] S12, the non-secure boot loader reads the register and determines whether the security key is stored in the SOC non-volatile memory inside the CPU. If so, it enters S13, if not, it enters S14;

[0052] The Not Secure Boot non-secure boot loader reads the register and then determines whether there is a security key stored in the CPU's internal SOC non-volatile memory. If there is a security key, it proceeds to step S13. If not, it proceeds to step S14.

[0053] S13, load the Secure kernel software, and then load the Secure file system;

[0054] First load the Secure kernel software, then load the Secure file system;

[0055] S14, read the first check value of the flash key in the flash;

[0056] S15, reading the second check value in the server;

[0057] S16, determine whether the second check value matches the first check value, if so, proceed to S17, if not, proceed to S18;

[0058] Compare the second check value with the first check value to determine whether the second check value matches the first check value. If the second check value matches the first check value, proceed to step S17. If the second check value does not match the first check value, proceed to step S18.

[0059] S17, read the flash key in the flash, and calculate the third check value based on the flash key, and then determine whether the third check value matches the first check value. If so, enter S13; if not, enter S18;

[0060] 2 and 3 , the flash key in the flash is read, and a third check value is calculated based on the flash key. Then, it is determined whether the third check value matches the first check value. If the third check value matches the first check value, the process proceeds to step S171. If the third check value does not match the first check value, the process proceeds to step S18.

[0061] S171, burning the flash key into the SOC non-volatile memory inside the CPU of the main chip;

[0062] If the third check value matches the first check value, the flash key is burned into the SOC non-volatile memory inside the CPU of the main chip, and then the process proceeds to step S172;

[0063] S172, the Not Secure Boot non-secure boot loader reads the register and determines whether the flash key is stored in the SOC non-volatile memory inside the CPU. If so, it proceeds to step S1721, if not, it proceeds to step S18.

[0064] S1721: If the flash key is stored in the non-volatile memory of the SOC inside the CPU, the Secure Boot secure boot loader in the flash chip is read and overwritten with the Not Secure Boot non-secure boot loader, and then the system is restarted, and then enters S13.

[0065] S18. Input error information and stop running the non-secure boot loader.

[0066] When running and loading the Secure Boot secure boot loader, the above loading process is used to not only reduce the key file transmission process, but also reduce the error probability caused by the transmission process. At the same time, it optimizes the production test process, reduces the probability of erroneous transmission, and reduces the defective rate of products.

[0067] The present application also discloses a device for securely booting a program, which includes the following modules:

[0068] The first loading module is used to load the Not Secure Boot non-secure boot loader and the Secure Boot secure boot loader during use;

[0069] A judgment module, configured to judge whether a security key is stored in the SOC non-volatile memory inside the CPU, whether the first check value matches the second check value, whether the third check value matches the first check value, and whether a flash key is stored in the SOC non-volatile memory inside the CPU;

[0070] A reading module is used to read the register, the first check value in the flash, the second check value in the server, the calculated third check value, and read the Not Secure Boot non-secure boot loader and the Secure Boot secure boot loader;

[0071] A calculation module, configured to calculate a third check value based on the flash key;

[0072] Overlay module, used to overwrite the Not Secure Boot non-secure boot loader with the Secure Boot secure boot loader;

[0073] A restart module for restarting the system; and

[0074] The second loading module is used to load the Secure kernel software and the Secure file system in sequence.

[0075] The various modules mentioned above are used to execute a Secure Boot secure boot loader method disclosed in the above embodiment.

[0076] In an embodiment of the present application, a device for loading a secure boot program using Secure Boot is provided. The device includes a processor and a memory. The processor and the memory are connected, for example, via a bus. Optionally, the device may also include a transceiver. It should be noted that in actual applications, there is not limited to one transceiver, and the structure of the electronic device does not constitute a limitation on the embodiments of the present application.

[0077] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0078] A bus may include a path that transmits information between the components. This bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Buses can be categorized as address buses, data buses, and control buses.

[0079] The memory may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0080] The memory is used to store application code for executing the solution of the present application, and the execution is controlled by the processor. The processor is used to execute the application code stored in the memory to implement the content shown in the above method embodiment.

[0081] The device includes, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. It may also be a server, etc.

[0082] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0083] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0084] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for secure boot loading program, characterized in that: The following steps are involved: S11, compile the non-secure boot loader, the secure boot loader, the secret key and the checksum into an image file according to specific rules, and then load the non-secure boot loader; S12, the non-secure boot loader reads the register and determines whether there is a security key stored in the SOC non-volatile memory inside the CPU. If so, it proceeds to step S13, if not, it proceeds to step S14; S13, load the Secure kernel software, and then load the Secure file system; S14, reading a first check value of a flash key in the flash; S15, reading a second check value in the server; S16, determine whether the second check value matches the first check value, if so, proceed to S17, if not, proceed to S18; S17, read the flash key in the flash, and calculate the third check value according to the flash key, and then determine whether the third check value matches the first check value, if so, enter S13, if not, enter S18; S18. Input error information and stop running the non-secure boot loader.

2. A method for secure boot loading program according to claim 1, characterized in that: The S17 further comprises the following steps: S171. If the third verification value matches the first verification value, the flash key is burned into the SOC non-volatile memory inside the CPU of the main chip.

3. A method for secure boot loading program according to claim 2, characterized in that: The S17 further comprises the following steps: S172, the non-secure boot loader reads the register and determines the non-volatility of the CPU internal SOC Is there a flash key stored in the memory? If so, go to S13; if not, go to S18.

4. A method for secure boot loading program according to claim 3, characterized in that: The S17 further comprises the following steps: S1721. If the flash key is stored in the SOC non-volatile memory inside the CPU, the Secure Boot secure boot loader in the flash chip is read and overwritten with the Not Secure Boot non-secure boot loader, and then the system is restarted, and then enters S13.

5. A device for secure boot loading program, characterized in that: Includes the following modules: A first loading module, used for loading a Not Secure Boot non-secure boot loader and a Secure Boot secure boot loader; A judgment module, used to judge whether a security key is stored in the SOC non-volatile memory inside the CPU, whether the first check value matches the second check value, whether the third check value matches the first check value, and whether a flash key is stored in the SOC non-volatile memory inside the CPU; A reading module, used to read a register, a first check value in the flash, a second check value in the server, a calculated third check value, and read a Not Secure Boot non-secure boot loader and a Secure Boot secure boot loader; A calculation module, used to calculate a third check value according to the flash key; Overlay module, used to overwrite Not Secure Boot non-secure boot loader with Secure Boot secure boot loader; A restart module, used to restart the system; and The second loading module is used to load the Secure kernel software and the Secure file system in sequence.

6. A device for secure boot loader, characterized in that: include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute a method for a Secure Boot secure boot loader according to any one of claims 1 to 5.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for implementing a Secure Boot secure boot loading program as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Safe starting method of terminal equipment, and terminal equipment

    CN103914658A

  • Equipment security starting and authentication method and device based on hierarchical encryption

    CN115062292A

  • Method for generating a secured boot image including an update boot loader for a secured update of the version information

    US8914627B2