Authentication information writing method and authentication information writing system

By writing authentication information into the data reset register during the development stage and performing security verification, the problem of one-time programmable memory miswrite in the prior art is solved, and the effect of reducing development costs is achieved.

CN119475306APending Publication Date: 2025-02-18REALTEK SEMICON CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310990692.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

During the development process, the prior art is prone to accidentally write incorrect information due to the storage characteristics of one-time programmable memory, resulting in chip damage and increasing development costs.

Method used

By configuring the processor, perform the following steps: write the predetermined authentication information into the data reset register (ODR), execute the boot program, read the ODR according to the safety attribute table to obtain the authentication information to be verified, and perform safe verification in the boot program, If passed, the authentication information to be verified is written to the OTP memory.

Benefits of technology

During the development stage, the verification process can be pre-simulated to reduce the risk of writing error messages and reduce development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475306A_ABST
    Figure CN119475306A_ABST
Patent Text Reader

Abstract

The invention discloses an authentication information writing method and an authentication information writing system. The method is suitable for a single-chip system and comprises the following steps: configuring a processor to execute the following steps: writing predetermined authentication information into an ODR (Overlay Data Register); the method comprises the following steps: executing a startup program, and reading an ODR according to a security attribute table stored in a read-only memory so as to obtain authentication information to be verified corresponding to preset authentication information, and the authentication information to be verified is used for replacing the authentication information which is preset to be read from an One-time programmable (OTP) memory; executing a security verification program in the startup program on the to-be-verified authentication information to judge whether the to-be-verified authentication information can pass security verification or not; and in response to the fact that the to-be-verified authentication information passes the security verification, writing the to-be-verified authentication information into the OTP memory to serve as the authentication information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of authentication information writing, and in particular to an authentication information writing method and an authentication information writing system. Background Art

[0002] In recent years, there are more and more malicious programs targeting firmware, so the issue of information security has gradually received attention. Among them, the "secure boot" solution combined with hardware implementation has attracted the most attention. The so-called "secure boot" solution means that before the system starts the program code, it must first be authenticated according to the hardware settings before it can continue the boot process.

[0003] During the authentication process, the hardware must perform the verification mechanism in conjunction with the read-only key or security credential data stored in the one-time programmable (OTP) memory. The verification mechanism provided by secure boot can block unsigned programs, thereby reducing the possibility of firmware being attacked to ensure that the boot software is the expected manufacturer version.

[0004] However, during the development of the above architecture, due to the storage characteristics of the OTP memory, if the manufacturer accidentally writes wrong information, the chip will be damaged and cannot be used again, thus increasing the risk of cost loss. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an authentication information writing method and an authentication information writing system in view of the deficiencies in the prior art, which can improve the data writing process for a one-time programmable memory in a single-chip system and reduce development costs.

[0006] In order to solve the above-mentioned technical problems, one of the technical solutions adopted by the present invention is to provide an authentication information writing method, which is applicable to a single-chip system. The authentication information writing method includes configuring a processor to perform the following steps: writing predetermined authentication information into an Overlay Data Register (ODR); executing a boot program, in which the ODR is read according to a secure attribute table (Secure Attribute Table) stored in a read-only memory to obtain a to-be-verified authentication information corresponding to the predetermined authentication information, wherein the to-be-verified authentication information is used to replace a predetermined authentication information read from a one-time programmable (OTP) memory in the boot program; executing a security verification program in the boot program on the to-be-verified authentication information to determine whether the to-be-verified authentication information can pass the security verification; and in response to the to-be-verified authentication information passing the security verification, writing the to-be-verified authentication information into the OTP memory as the authentication information.

[0007] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide an authentication information writing system, including a single-chip system. The single-chip system includes a read-only memory, an overlay data register (ODR), a one-time programmable (OTP) memory and a processor. The read-only memory stores a boot program and a secure attribute table. The one-time programmable (OTP) memory is predetermined to store authentication information. The processor is electrically connected to the read-only memory, the ODR and the OTP memory. Among them, the processor is configured to perform the following steps: writing the predetermined authentication information into the ODR; executing the boot program, reading the ODR according to the security attribute table in the boot program to obtain the authentication information to be verified corresponding to the predetermined authentication information, wherein the authentication information to be verified is used to replace the authentication information predetermined to be read from the OTP memory in the boot program; executing the security verification program in the boot program on the authentication information to be verified to determine whether the authentication information to be verified can pass the security verification; and in response to the authentication information to be verified passing the security verification, writing the authentication information to be verified into the OTP memory as the authentication information.

[0008] One of the beneficial effects of the present invention is that the authentication information writing method and authentication information writing system provided by the present invention can pre-simulate the verification process for the authentication information stored in the register during the development stage, and then formally write the contents of the register into the one-time programmable memory after completing the verification of the authentication information, thereby reducing the risk of writing erroneous information and reducing development costs.

[0009] In order to further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not used to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 A functional module diagram of an authentication data writing system according to an embodiment of the present invention;

[0011] Figure 2 A flowchart of a method for writing authentication data according to an embodiment of the present invention;

[0012] Figure 3 This is a flow chart of the authentication information writing method according to an embodiment of the present invention actually applied to the booting procedure.

[0013] Description of reference numerals:

[0014] 1: Authentication information written into system 10: SoC 100: Read-only memory

[0015] 101: Read-only memory controller 102: ODR 103: OTP memory controller

[0016] 104: OTP memory 106: processor 107: read-only memory

[0017] 108: OCR 20: Host D01: Boot procedure

[0018] D02: Core program D03: Security attribute table D1: Authentication information

[0019] D2: Authentication information to be verified D3: Computer readable instructions DETAILED DESCRIPTION

[0020] The following is an explanation of the implementation methods of the "authentication information writing method and authentication information writing system" disclosed in the present invention through specific specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the contents disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and the details in this specification can also be modified and changed in various ways based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only simple schematic illustrations and are not depicted in actual size. It is stated in advance. The following implementation methods will further explain the relevant technical content of the present invention in detail, but the disclosed content is not intended to limit the scope of protection of the present invention. In addition, the term "or" used in this specification may include any one or more combinations of the associated listed items depending on the actual situation.

[0021] like Figure 1As shown, an embodiment of the present invention provides an authentication information writing system 1, including a single chip system (system on a chip, SoC) 10.

[0022] The SoC 10 generally integrates many components into a single device, including a read-only memory 100 , an overlay data register (ODR) 102 , a one-time programmable (OTP) memory 104 , and a processor 106 .

[0023] The host 20 may be connected to the SoC 10 via an input / output interface. The host 20 may be a consumer electronic device, such as a mobile phone, a tablet device, a laptop computer, a desktop computer, etc. The host 20 may include a central processing unit and a computer-readable storage medium for storing host data of the host 20. The computer-readable storage medium may be a random access memory (RAM), a static RAM (SRAM), a dynamic RAM (DRAM), a non-volatile RAM (NVRAM), a read-only memory (ROM), a flash memory, etc. The host data may include an operating system and a plurality of application programs.

[0024] The operating system generally manages the hardware and software resources of the host 20 and provides common services for application programs. The operating system and application programs can generally be executed by the SoC 10 to achieve communication with the host and user interaction.

[0025] like Figure 1 As shown, the processor 106 can be directly or indirectly electrically connected to the ROM 100, the ODR 102, and the OTP memory 104. The ROM 100 can be a flash memory, and the processor 106 can be connected to the ROM 101 through the ROM controller 101 to access the data stored in the ROM 100, such as the boot program D01, the core program D02, and the secure attribute table D03.

[0026] For security reasons, an OTP memory 104 is provided in the SoC 10, and the processor 106 can be connected to the OTP memory 104 through the OTP memory controller 103 to access the data stored in the OTP memory 104. Since the OTP memory 104 has the characteristic of being tamper-proof, it can be used to store the firmware of the SoC 10 and related authentication information D1. In the existing architecture of the SoC 10, the authentication information D1 including security credentials, root key (Root Key, RK), hardware unique key (Hardware Unique Key, HUK), etc. can be written into the OTP memory 104 during the development stage, and since the written information cannot be modified, the security of the authentication information D1 can be guaranteed.

[0027] In addition, in the existing boot process, after the SoC 10 is booted and initialized, the processor 106 can read the authentication information D1 in the OTP memory 104 to confirm whether it exists. If it exists, the boot software can be loaded only after the authentication information D1 is successfully verified to complete the subsequent secure boot process.

[0028] However, the above existing architecture has certain risks for developers. For example, during the development process, if wrong information is accidentally written, the chip will be damaged and cannot be used again, thus there is a risk of cost loss.

[0029] Therefore, the authentication information writing system 1 provided by the embodiment of the present invention can improve the existing data writing process for OTP memory.

[0030] Please refer to Figure 2 , Figure 2 The figure is a flow chart of a method for writing authentication data according to an embodiment of the present invention.

[0031] The embodiment of the present invention provides a method for writing authentication data, which is suitable for Figure 1 The SoC 10 further includes a system memory 107, and the processor 106 can implement the above authentication data writing method by executing a plurality of computer-readable instructions D3 stored therein. In addition, the authentication data writing method is also assisted by the ODR 102 and the security attribute table D03, which will be described in detail below.

[0032] like Figure 2 As shown, the authentication information writing method may include configuring the processor 106 to perform the following steps:

[0033] Step S20: Write the predetermined authentication information into the ODR. In the development stage, the prepared predetermined authentication information can be written into the ODR 102. In the case of power failure, the content of the ODR 102 will be retained in the SoC 10. It should be noted that although Figure 1The authentication information D1 is shown to be stored in the OTP memory 104, but it only means that the OTP memory 104 is reserved for storing the authentication information D1. When this step is executed, the OTP memory 104 is in a state where no information has been written. The so-called reserved authentication information may include firmware, security credentials, RK, HUK and other data that are scheduled to be written to the OTP memory 104 in the end.

[0034] It should be noted that when step S21 is executed, step S20A must be executed in conjunction with the execution of the security attribute table pre-established in the read-only memory 100. In this step, the security attribute table D03 defines the security attribute fields in the OTP memory 104 that allow the content of the ODR 102 to temporarily replace the authentication information of the OTP memory 104. The security attribute table D03 may include the following information:

[0035] 1. Security attribute code SATattr, used to indicate the authentication information type of the predetermined authentication information, such as RK and HUK. When the value is 0, it means no effect, while the code for RK is "SATattr = 1" and the code for HUK is "SATattr = 2".

[0036] 2. The starting position parameter SATstart is used to indicate the starting position of the predetermined authentication information in the OTP memory 104, and corresponds to the aforementioned authentication information type, in bits. For example, when the predetermined authentication information is RK, its starting position is bit 0, then "SATstart = 0". When the predetermined authentication information is HUK, its starting position is bit 1024, then "SATstart = 1024".

[0037] 3. The length parameter SATlen is used to indicate the data length of the predetermined authentication information in the OTP memory 104, which can be expressed in bits. For example, when the predetermined authentication information is RK and its length is 256 bits, then "SATlen = 256". When the predetermined authentication information is HUK and its length is 24 bits, then "SATlen = 24".

[0038] Therefore, in step S20, the predetermined authentication information can be stored in the ODR 102 according to the corresponding length parameter. For example, if RK is to be written into the ODR 102, the length parameter of RK is 256 bits, and 256 bits of information are filled into the positions of ODR0[31:0] to ODR7[31:0] in the ODR 102. If the length parameter of HUK is 24 bits, 24 bits of information are filled into the position of ODR0[23:0].

[0039] In addition, please refer to Figure 1SoC 10 also includes an Overlay Configuration Register (OCR) 108. OCR 108 can store an OCR attribute OCRattr, which is used to indicate the authentication information type corresponding to the predetermined authentication information. More precisely, the OCR attribute OCRattr is used to specify which security attribute the content written by ODR 102 is used to simulate, and its definition is the same as the security attribute code SATattr. For example, when ODR 102 writes 256 bits of RK information, "OCRattr≡OCR[15:0]=1" is set; if ODR writes 24 bits of HUK information, "OCRattr≡OCR[15:0]=2" is set.

[0040] Therefore, if Figure 2 As shown, when the predetermined authentication information is written into the ODR in step S20, step S20B may be simultaneously performed to set the OCR properties of the OCR.

[0041] Step S21: Execute the boot procedure, and read the ODR according to the secure attribute table in the boot procedure to obtain the authentication information to be verified corresponding to the predetermined authentication information. In this step, the boot procedure is a hot boot procedure, and the SoC 10 remains in a power-on state when the hot boot procedure is executed, which can ensure that the content of the ODR 102 will be maintained in the SoC 10. When the SoC 10 is in a power-on state, the content of the ODR 102 will always exist until the power is turned off or a command is issued by the software executed in the operating system to indicate the step of clearing the register.

[0042] Specifically, during the boot process of the SoC 10 , the authentication information D1 stored in the OTP memory 104 is generally verified, and the authentication information D2 to be verified in step S21 is used to replace the authentication information D1 scheduled to be read from the OTP memory 104 during the boot process.

[0043] Step S22: Execute a security verification procedure on the authentication information to be verified.

[0044] Step S23: Determine whether the authentication information to be verified can pass the security verification.

[0045] In response to the determination in step S23 that the authentication information to be verified D2 has passed the security verification, the authentication information writing method enters step S24: the authentication information to be verified is written into the OTP memory as the authentication information. At the same time, the boot program continues to execute. In this step, since the authentication information to be verified D2 is only used to temporarily replace the real authentication information D1, the verification process is simulated in advance. After completing the legitimacy verification, the operating system of the host 20 can send a secure monitor call command (SecureMonitor Call, SMC), and the processor 106 can formally write the content of the ODR 102 (that is, the verified authentication information to be verified D2) into the OTP memory 104 in response to receiving the SMC from the host 20 and store it as the authentication information D1.

[0046] In response to the determination in step S23 that the authentication information to be verified D2 has not passed the security verification, the authentication information writing method enters step S25: the authentication information to be verified is not written into the OTP memory.

[0047] Therefore, by executing the above-mentioned authentication information writing method, the verification process can be pre-simulated for the authentication information stored in the register during the development stage, and the contents of the register can be formally written into the one-time programmable memory after the authentication information verification is completed, thereby reducing the risk of writing erroneous information and reducing development costs.

[0048] Please refer to Figure 3 , Figure 3 This is a flow chart of the authentication information writing method according to an embodiment of the present invention actually applied to the booting procedure.

[0049] like Figure 3 As shown, the boot process includes configuring the processor 106 to perform the following steps:

[0050] Step S300: Read the read-only memory and initialize the OTP memory.

[0051] Step S301: Determine whether the OTP memory has not been written with authentication information.

[0052] If yes, proceed to step S302: determine whether the SoC is hot-started.

[0053] If not, then enter step S303: perform security verification on the authentication information in the OTP memory. After that, it is a general boot process. If the authentication information passes the security verification, the boot process continues to be executed. If the authentication information fails the security verification, the boot process is terminated. No further details are given here.

[0054] In response to the determination in step S302 that the SoC has been hot-started, the process proceeds to step S304: determining whether the security attribute code is not a null value.

[0055] In response to the determination in step S304 that the SoC security attribute code is not a null value, the process proceeds to step S305 : determining whether the authentication information to be verified belongs to the defined security attribute code.

[0056] In response to the determination in step S305 that the authentication information to be verified belongs to the defined security attribute code, step S306 is entered: a security verification procedure is performed on the authentication information to be verified in the ODR. For example, after reading ODR 102 according to the security attribute table D03 stored in the read-only memory 100, the security verification procedure is performed on the authentication information to be verified in ODR0~ODR n The authentication information to be verified is subjected to a security verification procedure.

[0057] Step S307: Determine whether the authentication information to be verified has passed the security verification.

[0058] It should be noted that OCR 108 can also be used to store OCR valid parameters, which can indicate whether to allow the authentication information D2 to be written into the OTP memory 102 when the authentication information to be verified passes or fails the security verification.

[0059] Therefore, in response to determining in step S307 that the authentication information D2 to be verified passes the security verification, the process proceeds to step S308 : setting the OCR validity parameter to 1 to indicate that the authentication information D2 to be verified is allowed to be written into the OTP memory 102 .

[0060] In response to the determination in step S307 that the authentication information D2 to be verified has not passed the security verification, the process proceeds to step S309 : setting the OCR validity parameter to 0 to indicate that the authentication information D2 to be verified is not allowed to be written into the OTP memory 102 .

[0061] In addition, in response to determining in step S302 that the SoC is not hot-started, determining in step S304 that the security attribute code is a null value, in step S305 that the authentication information to be verified does not belong to the defined security attribute code, or after step S309 is executed, step S310 is entered: continue to execute the general boot procedure.

[0062] After step S308 is executed, the process proceeds to step S311: allowing the processor to write the contents of the ODR into the OTP memory in response to receiving the SMC.

[0063] Beneficial effects of the embodiments:

[0064] The authentication information writing method and authentication information writing system provided by the present invention can pre-simulate the verification process for the authentication information stored in the register during the development stage, and then formally write the contents of the register into the one-time programmable memory after completing the verification of the authentication information, thereby reducing the risk of writing erroneous information and reducing development costs.

[0065] The contents disclosed above are only preferred feasible embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention description and drawings are within the protection scope of the present invention.

Claims

1. A method for writing authentication information, applicable to a single-chip system, characterized in that: The authentication information writing method comprises configuring a processor to perform the following steps: Writing a predetermined authentication information into a data reset register; executing a booting procedure, in which the data reset register is read according to a security attribute table stored in a read-only memory to obtain a to-be-verified authentication information corresponding to the predetermined authentication information, The authentication information to be verified is used to replace authentication information predetermined to be read from a one-time programmable memory in the boot procedure; executing a security verification procedure in the boot procedure on the authentication information to be verified to determine whether the authentication information to be verified can pass the security verification; and In response to the authentication information to be verified passing the security verification, the authentication information to be verified is written into the one-time programmable memory as the authentication information.

2. The authentication information writing method according to claim 1, characterized in that: It also includes obtaining a security attribute table established in the read-only memory.

3. The authentication information writing method according to claim 2, characterized in that: The security attribute table includes: a security attribute code, used to represent an authentication information type of the predetermined authentication information; a starting position parameter, used to indicate a starting position of the predetermined authentication information in the one-time programmable memory; and A length parameter is used to indicate a data length of the predetermined authentication information in the one-time programmable memory.

4. The authentication information writing method according to claim 3, characterized in that: The predetermined authentication information is stored in the data reset register according to the corresponding length parameter.

5. The authentication information writing method according to claim 3, characterized in that: The method further includes setting an OCR attribute of a reset configuration register when writing the predetermined authentication information into the data reset register, wherein the OCR attribute is used to indicate the authentication information type corresponding to the predetermined authentication information.

6. The authentication information writing method according to claim 5, characterized in that: The method further includes setting an OCR valid parameter of the reset configuration register when the authentication information to be verified passes the security verification to indicate whether the authentication information to be verified is allowed to be written into the one-time programmable memory.

7. The authentication information writing method according to claim 1, characterized in that: The boot procedure is a hot boot procedure, and the single chip system is kept in a non-power-off state when the hot boot procedure is executed.

8. The authentication information writing method according to claim 3, characterized in that: It also includes configuring the processor to pre-determine in the boot program that the security attribute code is not a null value, determine that the authentication information to be verified belongs to the defined security attribute code, and determine that the one-time programmable memory has not yet been written with the authentication information, and then read the data reset register according to the security attribute table stored in the read-only memory.

9. The authentication information writing method according to claim 1, characterized in that: The method also includes configuring the processor to write the authentication information to be verified into the one-time programmable memory as the authentication information in response to receiving a security monitoring call command from a host.

10. A system for writing authentication information, characterized in that: include: A single chip system, including: A read-only memory storing a boot program and a security attribute table; A data reset register; A one-time programmable memory, intended for storing authentication information; a processor electrically connected to the read-only memory, the data reset register and the one-time programmable memory, wherein the processor is configured to perform the following steps: Writing a predetermined authentication information into the data reset register; Executing the boot program, reading the data reset register according to the security attribute table in the boot program to obtain a to-be-verified authentication information corresponding to the predetermined authentication information, wherein the to-be-verified authentication information is used to replace the authentication information predetermined to be read from the one-time programmable memory in the boot program; executing a security verification procedure in the boot procedure on the authentication information to be verified to determine whether the authentication information to be verified can pass the security verification; and In response to the authentication information to be verified passing the security verification, the authentication information to be verified is written into the one-time programmable memory as the authentication information.