A method, apparatus, computer device, and storage medium for constructing a trusted environment
By establishing a virtual hardware communication channel between the ordinary world and the secure world and unifying the operating system, the high cost problems caused by hardware architecture dependence in the existing technology are solved, and efficient construction and maintenance of a secure and trusted environment is achieved.
Patent Information
- Application Number
- CN202211679621.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-12-26
AI Technical Summary
When building a trusted environment, the existing technology relies on hardware architecture to fail to form a trusted solution for the architecture, and requires two operating systems, which are costly to develop and maintain.
Through the initial loader, authenticate the ordinary world, load the operating system, separate the target hardware system, establish a virtual hardware communication channel between the ordinary world and the secure world, and unify it into the same operating system.
It reduces development and maintenance costs, improves project development and maintenance efficiency, and ensures the security of hardware environment communication.
Smart Images

Figure CN115859381B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of system security, and in particular to a method, apparatus, computer equipment, and storage medium for constructing a trusted environment. Background Art
[0002] Currently, most methods for building a trusted environment are based on the trustzone technology of the ARM (Advanced RISC Machine) architecture, which divides the hardware environment into two different worlds: TEE (Trusted Execution Environment) and REE (Rich Execution Environment). REE runs a general operating system, while TEE runs a microkernel operating system.
[0003] However, building a trusted environment through architecture is extremely dependent on the hardware architecture, and it is impossible to form a universal trusted solution for the architecture. It also requires two operating systems, which incurs high costs in subsequent development and is very difficult to maintain. Summary of the Invention
[0004] In order to solve the above technical problems, the embodiments of the present application provide a method, apparatus, computer equipment and storage medium for constructing a trusted environment.
[0005] In a first aspect, an embodiment of the present application provides a method for constructing a trusted environment, the method comprising:
[0006] Run the initial loader;
[0007] authenticating the ordinary world based on the initial loading program, loading the corresponding operating system of the ordinary world through the first hardware system of the ordinary world, and starting the first system environment of the ordinary world;
[0008] Taking the second hardware system of the secure world offline, and separating the target hardware system from the first hardware system of the normal world using hardware separation technology;
[0009] Loading the operating system corresponding to the secure world based on the target hardware system, and starting the second system environment of the secure world;
[0010] A virtual hardware communication channel is established between the first system environment of the normal world and the second system environment of the secure world.
[0011] According to a specific embodiment disclosed in the present application, the step of establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world includes:
[0012] loading virtual hardware in a second system environment of the secure world;
[0013] Mounting the first virtual hardware onto a virtual hardware bus;
[0014] The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
[0015] According to a specific embodiment disclosed in the present application, after the step of establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world, the method further includes:
[0016] Authenticating the CA program within the first system environment of the ordinary world;
[0017] After the CA program is authenticated, the CA program is run;
[0018] The TA program is authenticated based on the CA program, and after the authentication is passed, the TA program is loaded into the second system environment of the secure world through the virtual hardware communication channel.
[0019] According to a specific embodiment disclosed in the present application, after the step of authenticating the TA program based on the CA program and loading the TA program into the second system environment of the secure world through the virtual hardware communication channel after the authentication is passed, the method further includes:
[0020] Controlling the first system environment to generate a trusted program operation request, and sending the request to the second system environment through the virtual hardware communication channel;
[0021] The trusted operation result generated by the second system environment is sent to the first system environment through the virtual hardware communication channel.
[0022] According to a specific embodiment disclosed in the present application, the step of loading the operating system corresponding to the ordinary world includes:
[0023] The kernel of the normal world and the file system of the normal world are loaded.
[0024] According to a specific embodiment disclosed in this application, the step of loading the operating system corresponding to the secure world includes:
[0025] The kernel of the secure world and the file system of the secure world are loaded.
[0026] In a second aspect, an embodiment of the present application provides a device for building a trusted environment, the device comprising:
[0027] Run module, used to run the initial loader;
[0028] a loading module, configured to authenticate the ordinary world based on the initial loading program, load the operating system corresponding to the ordinary world through the first hardware system of the ordinary world, and start the first system environment of the ordinary world;
[0029] a separation module, configured to take the second hardware system of the secure world offline and separate the target hardware system from the first hardware system of the ordinary world using a hardware separation technology;
[0030] a startup module, configured to load the operating system corresponding to the secure world based on the target hardware system and start the second system environment of the secure world;
[0031] The connection module is used to establish a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world.
[0032] According to a specific embodiment disclosed in this application, the connection module is specifically used to:
[0033] loading virtual hardware in a second system environment of the secure world;
[0034] Mounting the first virtual hardware onto a virtual hardware bus;
[0035] The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
[0036] In a third aspect, an embodiment of the present application provides a computer device comprising a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is run by the processor, the method for constructing a trusted environment provided in the first aspect is executed.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a processor, executes the method for constructing a trusted environment provided in the first aspect.
[0038] The above-mentioned method for constructing a trusted environment provided by the present application is as follows: running an initial loader; authenticating the ordinary world based on the initial loader, loading the corresponding operating system of the ordinary world through the first hardware system of the ordinary world, and starting the first system environment of the ordinary world; taking the second hardware system of the secure world offline, and separating the target hardware system from the first hardware system of the ordinary world through hardware separation technology; loading the corresponding operating system of the secure world based on the target hardware system, and starting the second system environment of the secure world; establishing a virtual hardware communication channel between the first system environment of the ordinary world and the second system environment of the secure world. By establishing a virtual hardware communication channel between the first system environment of the ordinary world and the second system environment of the secure world, the security of the hardware environment communication of the first system environment can be guaranteed. Loading the operating system of the secure world based on the target hardware system facilitates project development and maintenance, and reduces costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solution of this application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of this application and should not be regarded as limiting the scope of protection of this application. In each of the drawings, similar components are numbered similarly.
[0040] Figure 1 Shows one of the flow diagrams of a method for building a trusted environment provided in an embodiment of the present application;
[0041] Figure 2 The second flowchart of the method for building a trusted environment provided in an embodiment of the present application is shown;
[0042] Figure 3 A schematic diagram of the structure of a device for building a trusted environment provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0043] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0044] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0045] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0046] Furthermore, the terms “first,” “second,” “third,” etc., are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0047] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present application.
[0048] Example 1
[0049] The embodiment of the present disclosure provides a method for constructing a trusted environment.
[0050] For details, see Figure 1 , the method for constructing the trusted environment includes:
[0051] Step S101: running the initial loading program.
[0052] Specifically, after powering on, the computer device can initialize the hardware system and establish a memory space mapping map, thereby bringing the system's hardware and software environment to a suitable state so as to load the correct environment for the final call to the operating system kernel.
[0053] Step S102: authenticating the ordinary world based on the initial loading program, loading the corresponding operating system of the ordinary world through the first hardware system of the ordinary world, and starting the first system environment of the ordinary world.
[0054] Specifically, authentication verifies whether the program is authorized to run. This authentication allows the next process step to be executed, ensuring the absolute security of the trusted environment. After initializing the first hardware system, the normal world is authenticated. Once authentication is successful, the normal world's corresponding operating system, specifically the kernel and file system, is loaded. Once loaded, the first system environment of the normal world is entered.
[0055] Step S103: The second hardware system of the secure world is taken offline, and the target hardware system is separated from the first hardware system of the ordinary world by hardware separation technology.
[0056] In a specific embodiment, a jailhouse is used to remove the hardware of the secure world from the first hardware system of the normal world.
[0057] Step S104: loading the operating system corresponding to the secure world based on the target hardware system, and starting the second system environment of the secure world.
[0058] In another specific embodiment, the target hardware system is loaded with the corresponding operating system of the secure world from the first hardware system of the normal world. This means that the secure world is loaded with the same operating system as the normal world, providing a secure and trusted environment for the normal world. By unifying the normal and secure worlds with the same operating system, project development and maintenance efficiency is improved, effectively reducing solution development and maintenance costs.
[0059] Step S105 : establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world.
[0060] Specifically, this can achieve hardware communication between the normal world and the secure world, and no process can obtain and parse intermediate data during the communication process.
[0061] Specifically, the step of establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world includes:
[0062] loading virtual hardware in a second system environment of the secure world;
[0063] Mounting the first virtual hardware onto a virtual hardware bus;
[0064] The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
[0065] Specifically, for example, a virtual PCI (Physical Cell Identifier) network card device is created within the secure world's second system environment and connected to the PCI bus. The normal world's first system environment then accesses the PCI network card device from the PCI bus and establishes a virtual hardware communication channel between the normal world's first system environment and the secure world's second system environment based on the PCI network card device. This virtual hardware communication channel ensures secure communication between the normal world's first system environment and the secure world's second system environment.
[0066] Specifically, see Figure 2 After the step of establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world, the method further includes:
[0067] Step S201, authenticating the CA program in the first system environment of the ordinary world;
[0068] Step S202: After the CA program is authenticated, the CA program is run;
[0069] Step S203: Authenticate the TA program based on the CA program, and after the authentication is passed, load the TA program into the second system environment of the secure world through the virtual hardware communication channel.
[0070] The security service running in the secure world is called TA (Trusted Application, abbreviated as TA), and the corresponding application running in the ordinary world that calls the security service is called CA (Client Application, abbreviated as CA). Usually, the computer device runs the CA program in the first system environment of the ordinary world, and processes the security business corresponding to CA in the second system environment of the secure world. For example, the computer device runs the first application and the second application in the first system environment, and processes the first security business and the second security business in the second system environment. The first system environment mainly includes a rich operating system running on a general-purpose processor, and a CA running on the rich operating system. The second system environment is an independent operating environment running outside the first system environment, mainly including a trusted operating system and one or more trusted applications running on the trusted operating system.
[0071] After the step of authenticating the TA program based on the CA program and loading the TA program into the second system environment of the secure world through the virtual hardware communication channel after the authentication is passed, the method further includes:
[0072] Controlling the first system environment to generate a trusted program operation request, and sending the request to the second system environment through the virtual hardware communication channel;
[0073] The trusted operation result generated by the second system environment is sent to the first system environment through the virtual hardware communication channel.
[0074] Specifically, the TA program and the CA program can be developed using the same software development kit, which can reduce development costs and improve development efficiency.
[0075] The step of loading the operating system corresponding to the ordinary world includes:
[0076] The kernel of the normal world and the file system of the normal world are loaded.
[0077] It can be understood that the corresponding operating system of the ordinary world includes the kernel and operating file system of the ordinary world.
[0078] The step of loading the operating system corresponding to the secure world includes:
[0079] The kernel of the secure world and the file system of the secure world are loaded.
[0080] It can be understood that the operating system corresponding to the secure world includes the kernel and operating file system of the secure world.
[0081] The method for constructing a trusted environment provided in this embodiment runs an initial loader; authenticates the normal world based on the initial loader, loads the corresponding operating system of the normal world through the first hardware system of the normal world, and starts the first system environment of the normal world; takes the second hardware system of the secure world offline, and separates the target hardware system from the first hardware system of the normal world through hardware separation technology; loads the corresponding operating system of the secure world based on the target hardware system, and starts the second system environment of the secure world; establishes a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world. By unifying the normal world and the secure world with the same operating system, the development and maintenance efficiency of the project is improved, and the development and maintenance costs of the solution can be actually reduced. By establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world, the hardware environment communication security of the first system environment can be guaranteed. Loading the operating system of the secure world based on the target hardware system facilitates the development and maintenance of the project and reduces costs.
[0082] Example 2
[0083] In addition, see Figure 3, an embodiment of the present disclosure provides a device 300 for constructing a trusted environment.
[0084] The running module 301 is used to run the initial loading program;
[0085] A loading module 302 is configured to authenticate the ordinary world based on the initial loading program, load the operating system corresponding to the ordinary world through the first hardware system of the ordinary world, and start the first system environment of the ordinary world;
[0086] Separation module 303, configured to take the second hardware system of the secure world offline and separate the target hardware system from the first hardware system of the normal world using hardware separation technology;
[0087] A startup module 304 is configured to load the operating system corresponding to the secure world based on the target hardware system and start the second system environment of the secure world;
[0088] The connection module 305 is configured to establish a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world.
[0089] Specifically, the connection module is specifically used to:
[0090] loading virtual hardware in a second system environment of the secure world;
[0091] Mounting the first virtual hardware onto a virtual hardware bus;
[0092] The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
[0093] The trusted environment construction apparatus 300 provided in this embodiment can execute the trusted environment construction method shown in Example 1, and will not be described again here to avoid repetition.
[0094] The trusted environment construction device provided in this embodiment runs an initial loader; authenticates the normal world based on the initial loader, loads the normal world's corresponding operating system through the normal world's first hardware system, and starts the normal world's first system environment; takes the secure world's second hardware system offline, and separates the target hardware system from the normal world's first hardware system using hardware separation technology; loads the secure world's corresponding operating system based on the target hardware system, and starts the secure world's second system environment; establishes a virtual hardware communication channel between the normal world's first system environment and the secure world's second system environment. By unifying the normal world and the secure world with the same operating system, the project's development and maintenance efficiency is improved, and the development and maintenance costs of the solution can be effectively reduced. By establishing a virtual hardware communication channel between the normal world's first system environment and the secure world's second system environment, the hardware environment communication security of the first system environment can be guaranteed. Loading the secure world's operating system based on the target hardware system facilitates project development and maintenance, reducing costs.
[0095] Example 3
[0096] The computer device provided in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed on the processor, the method for constructing a trusted environment in the aforementioned embodiment 1 is implemented.
[0097] Example 4
[0098] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0099] The computer-readable storage medium provided in this embodiment 4 can execute the method for constructing a trusted environment shown in embodiment 1, and will not be described again here to avoid repetition.
[0100] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or terminal comprising the element.
[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be constructed by means of software plus the necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0102] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A method for constructing a trusted environment, characterized in that: The method comprises: Run the initial loader; authenticating the ordinary world based on the initial loading program, loading the corresponding operating system of the ordinary world through the first hardware system of the ordinary world, and starting the first system environment of the ordinary world; Taking the second hardware system of the secure world offline, and separating the target hardware system from the first hardware system of the normal world using hardware separation technology; Loading the operating system corresponding to the secure world based on the target hardware system, and starting the second system environment of the secure world; Establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world; authenticating a CA program in a first system environment of the ordinary world, wherein the CA program is an application program running in the ordinary world and calling a security service; After the CA program is authenticated, the CA program is run; The TA program is authenticated based on the CA program, and after the authentication is passed, the TA program is loaded into the second system environment of the secure world through the virtual hardware communication channel. The TA program is a security service running in the secure world.
2. The method according to claim 1, characterized in that The step of establishing a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world includes: loading virtual hardware in a second system environment of the secure world; Mounting the virtual hardware onto a hardware bus; The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
3. The method according to claim 1, characterized in that After the step of authenticating the TA program based on the CA program and loading the TA program into the second system environment of the secure world through the virtual hardware communication channel after the authentication is passed, the method further includes: Controlling the first system environment to generate a trusted program operation request, and sending the request to the second system environment through the virtual hardware communication channel; The trusted operation result generated by the second system environment is sent to the first system environment through the virtual hardware communication channel.
4. The method according to claim 1, wherein The step of loading the operating system corresponding to the ordinary world includes: The kernel of the normal world and the file system of the normal world are loaded.
5. The method according to claim 1, wherein The step of loading the operating system corresponding to the secure world includes: The kernel of the secure world and the file system of the secure world are loaded.
6. A device for constructing a trusted environment, characterized in that: The device comprises: Run module, used to run the initial loader; a loading module, configured to authenticate the ordinary world based on the initial loading program, load the operating system corresponding to the ordinary world through the first hardware system of the ordinary world, and start the first system environment of the ordinary world; a separation module, configured to take the second hardware system of the secure world offline and separate the target hardware system from the first hardware system of the ordinary world using a hardware separation technology; a startup module, configured to load the operating system corresponding to the secure world based on the target hardware system and start the second system environment of the secure world; a connection module, configured to establish a virtual hardware communication channel between the first system environment of the normal world and the second system environment of the secure world; authenticating a CA program in a first system environment of the ordinary world, wherein the CA program is an application program running in the ordinary world and calling a security service; After the CA program is authenticated, the CA program is run; The TA program is authenticated based on the CA program, and after the authentication is passed, the TA program is loaded into the second system environment of the secure world through the virtual hardware communication channel. The TA program is a security service running in the secure world.
7. The device according to claim 6, characterized in that The connection module is specifically used for: loading virtual hardware in a second system environment of the secure world; Mounting the virtual hardware onto a hardware bus; The first system environment of the normal world recognizes the virtual hardware through the hardware bus and establishes a virtual hardware communication channel with the second system environment of the secure world, wherein the virtual hardware communication channel includes any one of a network, a PCI, and a serial port.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, the method for constructing a trusted environment according to any one of claims 1 to 5 is executed.
9. A computer-readable storage medium, characterized in that The device stores a computer program, which executes the method for constructing a trusted environment according to any one of claims 1 to 5 when the computer program is run on a processor.
Citation Information
Patent Citations
Implementation system for trusted execution environment of mobile terminal application program
CN113239329A
Secure virtual machine system design method and system based on trusted execution environment
CN113703924A
Virtual encryption machine platform based on trusted technology and creation method thereof
CN114117412A