A method and storage medium for system protection based on an OpenHarmony platform
Patent Information
- Application Number
- CN202310379070.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-04-11
AI Technical Summary
[0003]然而,目前基于OpenHarmony系统的终端并没有相应的机制来实现系统保护,这也是目前该领域面临的一个重要问题
[0007]本发明的有益效果在于:本发明的一种基于OpenHarmony平台的系统保护的方法与存储介质,对recovery 模式进行了扩展,实现系统保护模式。recovery模式是两部分组成,一个是recovery kernel,另一个是recovery userspace。recovery userspace通过recovery下的init来启动,同时解析init.rc后执行recovery bin程序。通过LK传递的模式,决定ro.bootmode的值,规划为recovery,safe,cleardata。那么这三种模式就会对应三个bin程序,这样可以做到相互隔离。系统保护模式的切换则是通过建立的服务端-PC工具端-终端的安全链路通道进行切换指令的透传,更加安全。
Smart Images

Figure CN116401656B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and storage medium for system protection based on the OpenHarmony platform. Background Technology
[0002] With the continuous development of digital financial service terminals and the increasing demand for domestic production, more and more financial terminals will choose to adopt systems based on the OpenHarmony platform. These terminals have very high security requirements because if the terminal is attacked or has security risks, it will directly affect the user's economic interests. Therefore, effective protection of the terminal system is necessary to ensure the security and stability of the terminal.
[0003] However, currently, terminals based on the OpenHarmony system lack corresponding mechanisms for system protection, which is a significant problem facing this field. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a system protection method and storage medium based on the OpenHarmony platform, and to realize the system protection mode and its switching.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for system protection based on the OpenHarmony platform includes the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode.
[0006] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A storage medium having a computer program stored thereon, wherein the computer program, when executed, performs the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode.
[0007] The beneficial effects of this invention are as follows: This invention provides a system protection method and storage medium based on the OpenHarmony platform, which extends the recovery mode to implement a system protection mode. The recovery mode consists of two parts: a recovery kernel and a recovery userspace. The recovery userspace starts through the init file under recovery and executes the recovery bin program after parsing init.rc. The value of ro.bootmode is determined by the mode passed through the LK, and is planned as recovery, safe, and cleardata. These three modes correspond to three bin programs, thus achieving mutual isolation. Switching between system protection modes is achieved through a secure link channel established between the server, PC tool, and terminal, which transmits the switching command transparently, making it more secure. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating a system protection method based on the OpenHarmony platform according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the system protection mode implementation principle of a system protection method based on the OpenHarmony platform according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the main model of a system protection method based on the OpenHarmony platform according to an embodiment of the present invention, consisting of a server-PC tool-terminal interface. Figure 4 This is a timing diagram of the secure link channel establishment steps in a system protection method based on the OpenHarmony platform according to an embodiment of the present invention. Figure 5 This is a timing diagram of the system protection mode switching steps of a system protection method based on the OpenHarmony platform according to an embodiment of the present invention. Detailed Implementation
[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0010] Please refer to Figures 1 to 5 A method for system protection based on the OpenHarmony platform, comprising the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode.
[0011] As described above, the beneficial effects of this invention are as follows: The system protection method and storage medium based on the OpenHarmony platform extend the recovery mode to achieve a system protection mode. The recovery mode consists of two parts: a recovery kernel and a recovery userspace. The userspace starts through the init function under recovery and executes the recovery bin program after parsing init.rc. Based on this approach, the value of ro.bootmode is determined by the mode passed through the LK, and is planned as recovery, safe, and cleardata. These three modes correspond to three bin programs, thus achieving mutual isolation. Switching between system protection modes is achieved through a secure link channel established between the server, PC tool, and terminal, which transmits the switching command transparently, making it more secure.
[0012] Furthermore, the creation of the secure link channel includes the following steps: S01. The PC tool selects the mode switching function of the system protection mode and establishes an operation and maintenance channel with the terminal's operation and maintenance module through Socket to obtain the terminal's SN and CPUID. S02. The PC tool establishes a connection with the Nginx server via HTTPS two-way authentication and registers the command to switch the system protection mode. The command to be registered, the MAC address of the PC, and the SN and CPUID of the terminal are sent via POST and forwarded by Nginx to the command management module. S03. The instruction management module requests the prototype authorization management module to verify the legality of instruction registration. The prototype authorization management module verifies the PC based on the MAC address and verifies whether the CPUID is in the authorization pool. S04. Only after the prototype authorization management module passes the verification, the instruction management module caches the instruction, the CPUID, and the SN in the order requested, waits for the connection of the execution terminal, and notifies the PC tool that the instruction registration into the pool is successful. S05. The PC tool terminal notifies the terminal's security routing module to start creating a security link through the maintenance channel. S06. The secure routing module creates a sockect server based on the preset IP and port. The PC tool acts as a socket client and establishes a transparent transmission channel with the terminal. Then, the PC tool acts as a socket client and the server acts as a sockect server, establishing a transparent transmission channel between the PC tool and the server. S07. The terminal transmits data through the PC tool and performs a TLS handshake with the link module of the server to determine the session key. S08. The terminal sends the first service frame to the link module using the session key encryption based on the secure transport layer protocol. After receiving the service frame, the link module sends the CPUID, SN and terminal capabilities in the frame to the instruction management module and notifies that the secure link channel has been successfully established.
[0013] As described above, a secure link channel is established based on the steps outlined above. The server performs bidirectional verification between the PC tool and the terminal to ensure identity validity. Simultaneously, the transparent transmission between the server and the terminal is based on the Transport Layer Security (TLS) protocol and uses session keys for communication, ensuring communication security.
[0014] Further, step S1 specifically includes: The server-side instruction module receives and retrieves the instruction from the cache based on the CPUID, SN, and terminal capabilities sent by the link module, and sends the instruction and terminal capabilities to the system protection mode switching module. The system protection mode switching module combines the instructions and terminal capabilities to obtain a switching instruction, which is then transmitted to the system protection module of the terminal through the secure link channel.
[0015] As described above, the server sends the CPUID, SN, and terminal capabilities sent by the link module through the secure link channel. Since the secure link channel is used for transmission and the transmission process is encrypted with a session key, the validity of this information can be guaranteed. The server then sends this information to the instruction module to obtain instructions. The instruction module then transmits the instructions through the secure link, thereby ensuring the validity of the instructions.
[0016] Furthermore, it also includes the following steps: When the device restarts, the terminal checks the restart reason information: If the restart reason is an attack, then enter system protection mode; If the reboot reason information is oem-10, the RPMB information is read after entering the LK stage to determine whether it has been attacked. If so, the system enters the protection mode.
[0017] As described above, when the device restarts, it will automatically determine whether to enter system protection mode based on the reason for the restart and the recorded attack information.
[0018] Furthermore, the determination of whether an attack has occurred includes: Root behavior detected; Firmware downgraded; Unauthorized customer customization, incorrect customer form signature, incompatible software customized by the system customizer; Maintenance status check failed; Terminal lifecycle status and system customization information are incomplete; The TA configuration detected suspected attack behavior, including the TA being started multiple times or its configuration data being tampered with.
[0019] As can be seen from the above description, the abnormal information is identified as an attack, which is a specific embodiment of the present invention.
[0020] A storage medium having a computer program stored thereon, wherein the computer program, when executed, performs the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode.
[0021] As described above, the beneficial effects of this invention are as follows: The system protection method and storage medium based on the OpenHarmony platform extend the recovery mode to achieve a system protection mode. The recovery mode consists of two parts: a recovery kernel and a recovery userspace. The userspace starts through the init function under recovery and executes the recovery bin program after parsing init.rc. Based on this approach, the value of ro.bootmode is determined by the mode passed through the LK, and is planned as recovery, safe, and cleardata. These three modes correspond to three bin programs, thus achieving mutual isolation. Switching between system protection modes is achieved through a secure link channel established between the server, PC tool, and terminal, which transmits the switching command transparently, making it more secure.
[0022] Furthermore, the creation of the secure link channel includes the following steps: S01. The PC tool selects the mode switching function of the system protection mode and establishes an operation and maintenance channel with the terminal's operation and maintenance module through Socket to obtain the terminal's SN and CPUID. S02. The PC tool establishes a connection with the Nginx server via HTTPS two-way authentication and registers the command to switch the system protection mode. The command to be registered, the MAC address of the PC, and the SN and CPUID of the terminal are sent via POST and forwarded by Nginx to the command management module. S03. The instruction management module requests the prototype authorization management module to verify the legality of instruction registration. The prototype authorization management module verifies the PC based on the MAC address and verifies whether the CPUID is in the authorization pool. S04. Only after the prototype authorization management module passes the verification, the instruction management module caches the instruction, the CPUID, and the SN in the order requested, waits for the connection of the execution terminal, and notifies the PC tool that the instruction registration into the pool is successful. S05. The PC tool terminal notifies the terminal's security routing module to start creating a security link through the maintenance channel. S06. The secure routing module creates a sockect server based on the preset IP and port. The PC tool acts as a socket client and establishes a transparent transmission channel with the terminal. Then, the PC tool acts as a socket client and the server acts as a sockect server, establishing a transparent transmission channel between the PC tool and the server. S07. The terminal transmits data through the PC tool and performs a TLS handshake with the link module of the server to determine the session key. S08. The terminal sends the first service frame to the link module using the session key encryption based on the secure transport layer protocol. After receiving the service frame, the link module sends the CPUID, SN and terminal capabilities in the frame to the instruction management module and notifies that the secure link channel has been successfully established.
[0023] As described above, a secure link channel is established based on the steps outlined above. The server performs bidirectional verification between the PC tool and the terminal to ensure identity validity. Simultaneously, the transparent transmission between the server and the terminal is based on the Transport Layer Security (TLS) protocol and uses session keys for communication, ensuring communication security.
[0024] Further, step S1 specifically includes: The server-side instruction module receives and retrieves the instruction from the cache based on the CPUID, SN, and terminal capabilities sent by the link module, and sends the instruction and terminal capabilities to the system protection mode switching module. The system protection mode switching module combines the instructions and terminal capabilities to obtain a switching instruction, which is then transmitted to the system protection module of the terminal through the secure link channel.
[0025] As described above, the server sends the CPUID, SN, and terminal capabilities sent by the link module through the secure link channel. Since the secure link channel is used for transmission and the transmission process is encrypted with a session key, the validity of this information can be guaranteed. The server then sends this information to the instruction module to obtain instructions. The instruction module then transmits the instructions through the secure link, thereby ensuring the validity of the instructions.
[0026] Furthermore, it also includes the following steps: When the device restarts, the terminal checks the restart reason information: If the restart reason is an attack, then enter system protection mode; If the reboot reason information is oem-10, the RPMB information is read after entering the LK stage to determine whether it has been attacked. If so, the system enters the protection mode.
[0027] As described above, when the device restarts, it will automatically determine whether to enter system protection mode based on the reason for the restart and the recorded attack information.
[0028] Furthermore, the determination of whether an attack has occurred includes: Root behavior detected; Firmware downgraded; Unauthorized customer customization, incorrect customer form signature, incompatible software customized by the system customizer; Maintenance status check failed; Terminal lifecycle status and system customization information are incomplete; The TA configuration detected suspected attack behavior, including the TA being started multiple times or its configuration data being tampered with.
[0029] As can be seen from the above description, the abnormal information is identified as an attack, which is a specific embodiment of the present invention.
[0030] The present invention provides a system protection method and storage medium based on the OpenHarmony platform, applicable to the implementation of system protection for terminals using systems based on the OpenHarmony platform.
[0031] Please refer to Figure 1 and Figure 2 Embodiment 1 of the present invention is as follows: A method for system protection based on the OpenHarmony platform includes the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode.
[0032] In this embodiment, the recovery mode is extended. In reality, the recovery mode consists of two parts: a recovery kernel and a recovery userspace. The userspace boots through the init file under recovery and executes the recovery bin program after parsing init.rc. Based on this approach, the value of ro.bootmode is determined by the mode passed through LK, and is planned as recovery or safe. Figure 2 The Secure process (i.e., the process in protected mode) and cleardata (in the context of system protection mode) are mentioned. Figure 2 The data erasure process in the context of Wipe data. These three modes would correspond to three separate binaries, ensuring mutual isolation.
[0033] It also includes the following steps: When the device restarts, the terminal checks the restart reason information: If the restart reason is an attack, then enter system protection mode; If the reboot reason information is oem-10, the RPMB information is read after entering the LK stage to determine whether it has been attacked. If so, the system enters the protection mode.
[0034] System protection mode processing flow: In this embodiment, during the power-on process, the terminal needs to read the area in the RPMB containing attack information. If an attack is detected, the terminal enters the system protection mode.
[0035] When attacked, the system enters either immediate or later protection mode. Enter immediately, rebooting due to attack-x. The current plan is to immediately enter system protection mode only when there is a kernel attack. This method uses the bootreason of attack-x to reboot. The risk is that if the battery is removed during the reboot process, the bootreason will be lost and it will be impossible to know that an attack has occurred.
[0036] If the system restarts shortly after recording the attack information, the reason for the restart is OEM-10. After reaching the LK stage, it reads the RPMB information to determine if it has been attacked and then enters the system protection mode. The risk of this mode compared to the first one is that if the battery is removed before or during the recording of the attack information, it will be impossible to determine whether it has been attacked.
[0037] Determining whether an attack has occurred includes: Root behavior detected; Firmware downgraded; Unauthorized customer customization, incorrect customer form signature, incompatible software customized by the system customizer; Maintenance status check failed; Terminal lifecycle status and system customization information are incomplete; The TA configuration detected suspected attack behavior, including the TA being started multiple times or its configuration data being tampered with.
[0038] In this embodiment, the attack behavior is defined as: 1. Reboot attack-1 detected root behavior. 2. Reboot attack-2: Firmware downgraded. 3. Reboot attack-3 Unauthorized customer customization: Customer configuration table signature error, system customization provider and customized software mismatch. 4. Reboot attack-4 maintenance status check failed. 5. Reboot attack-5: Terminal lifecycle status, system customization, and other information are incomplete. 6. Reboot attack-6 indicates that the configuration TA has detected suspected attack behavior (the TA has been started multiple times or the configuration data has been tampered with).
[0039] When the system is in protected mode, it runs in recovery mode, and the modules related to the secure channel run in recovery mode. HDCD can be started in protected mode, so the secure link process on the AP side is the same as described above. However, recovery can use a simplified version of HDCD. Because the HDCD in recovery mode only needs channel creation, it only needs to retain the relevant commands and communication functions. Therefore, for HDCD in recovery mode, unnecessary functions and commands can be trimmed to reduce program size, memory usage, and simplify processing logic.
[0040] Please refer to Figures 1 to 5 Embodiment two of the present invention is as follows: A system protection method based on the OpenHarmony platform differs from Embodiment 1 in that this embodiment provides a detailed explanation of the establishment of a secure link channel between the server, the PC tool, and the terminal.
[0041] For reference Figure 3 and Figure 4 The creation of the secure link channel includes the following steps: S01. The PC tool selects the mode switching function of the system protection mode and establishes an operation and maintenance channel with the terminal's operation and maintenance module through Socket to obtain the terminal's SN and CPUID. S02. The PC tool establishes a connection with the Nginx server via HTTPS two-way authentication and registers the command to switch the system protection mode. The command to be registered, the MAC address of the PC, and the SN and CPUID of the terminal are sent via POST and forwarded by Nginx to the command management module. In this embodiment, the PC tool establishes a connection with Nginx via HTTPS two-way authentication and registers the system protection mode switching command. The parameters are passed in via POST: SN, CPUID, MAC (PC Mac), and tagList (i.e., the command to be registered). Nginx forwards the command to the command management module.
[0042] S03. The instruction management module requests the prototype authorization management module to verify the legality of instruction registration. The prototype authorization management module verifies the PC based on the MAC address and verifies whether the CPUID is in the authorization pool. S04. Only after the prototype authorization management module passes the verification, the instruction management module caches the instruction, the CPUID, and the SN in the order requested, waits for the connection of the execution terminal, and notifies the PC tool that the instruction registration into the pool is successful. S05. The PC tool terminal notifies the terminal's security routing module to start creating a security link through the maintenance channel. S06. The secure routing module creates a sockect server based on the preset IP and port. The PC tool acts as a socket client and establishes a transparent transmission channel with the terminal. Then, the PC tool acts as a socket client and the server acts as a sockect server, establishing a transparent transmission channel between the PC tool and the server. In this embodiment, the transparent transmission channel between the PC tool, the terminal, and the server is established. At this time, the terminal and the server begin to establish a secure link. During this period, the PC tool will continuously poll the terminal to query the status results of the service and the secure link.
[0043] S07. The terminal transmits data through the PC tool and performs a TLS handshake with the link module of the server to determine the session key. In this embodiment, the terminal first performs a TLS handshake with the link module via PC pass-through and completes the negotiation of the session key. The terminal's system has a pre-installed upper-level CA for the server's response certificate. This CA is used to verify the server's identity and complete the TLS transaction.
[0044] S08. The terminal sends the first service frame to the link module using the session key encryption based on the secure transport layer protocol. After receiving the service frame, the link module sends the CPUID, SN and terminal capabilities in the frame to the instruction management module and notifies that the secure link channel has been successfully established.
[0045] In this embodiment, after the TLS handshake is completed, the terminal begins sending the first service frame; the transmitted data is encrypted using the previously negotiated session key via the TLS protocol. Upon receiving this data frame, the link module sends the CPUID, SN number, and terminal capabilities to the instruction management module and notifies it that the secure link has been successfully established.
[0046] After the aforementioned secure link channel is established, the backend and the terminal can switch system protection modes through the secure channel. The main process is as follows: The first service frame between the terminal and the backend contains the CPUID, SN number, and terminal capabilities. This terminal information is collected directly from the terminal by the secure link TA within the TE and transmitted encrypted using the session key negotiated during the previous link establishment process. This ensures that the terminal information is not forged or tampered with during transmission. The link module then sends the CPUID, SN number, and terminal capabilities to the instruction management module.
[0047] For reference Figure 5 Step S1 specifically includes: The server-side instruction module receives and retrieves the instruction from the cache based on the CPUID, SN, and terminal capabilities sent by the link module, and then sends the instruction and terminal capabilities to the system protection mode switching module. In this embodiment, the instruction management module can retrieve the corresponding instruction from the previously cached user instructions using the CPUID, and send the terminal capabilities and instructions to the system protection mode switching module.
[0048] The system protection mode switching module combines the instructions and terminal capabilities to obtain a switching instruction, which is then transmitted to the system protection module of the terminal through the secure link channel.
[0049] In this embodiment, the system protection switching module transmits a combination of switching instructions (including whether to select to enter / exit system protection mode and the reason) to the system protection module TA through a secure channel. Upon receiving the instruction, the protection mode identifier is stored in the TEE.
[0050] Nginx: Acts as a server-side proxy, forwarding data from the PC and implementing two-way HTTPS authentication with PC tools; Command Pool Management: The command management module registers, caches, and routes system protection mode switching commands. After a secure link channel is successfully established between the terminal and the server, the system protection mode switching commands registered by the user are forwarded to the system protection mode switching module on the server for execution. The prototype authorization management module manages the terminals and users authorized to perform system protection mode switching. Only terminals registered in the authorization management module are allowed to switch system protection modes. Only authorized users are allowed to use the system protection mode switching function on the PC.
[0051] Transparent transmission channel: Enables two-way authentication with the terminal and establishes a data transmission channel to transparently transmit interactive data between the terminal and the server system protection mode switching module; PC tool: The module that initiates user operations, and also serves as a channel connecting the terminal and the server to transmit interactive data between the two ends; Operation and maintenance module: In financial terminals, in many scenarios, the hdc command is unloaded or cut off when the terminal leaves the factory (in OpenHarmony, the name of adb is hdc). Here, the operation and maintenance channel is used to realize the communication between the terminal and the PC and transmit data. The secure routing module enables communication between REE and TEE environment programs, forwarding data related to creating secure links and switching system protection modes to the corresponding secure link TA and system protection mode TA (TA stands for Trusted Program, which refers to the application in the TEE environment). Secure Link TA: Enables two-way authentication with the server-side secure link module, and builds a secure link channel consisting of terminal-PC-backend; System Protection TA: The system protection module implements the business processing of switching system protection modes, including functions such as verification commands, storage mode identification, and execution mode switching.
[0052] Embodiment 3 of the present invention is as follows: A storage medium storing a computer program thereon, which, when executed, implements the steps of a system protection method based on the OpenHarmony platform according to Embodiment 1 or 2 above.
[0053] TEE: Trusted Execution Environment, is typically used for digital rights management (DRM), mobile payments, and sensitive data protection.
[0054] TA: Abbreviation for Trusted Application. Applications that run in a TEE environment are usually referred to as TA.
[0055] CA: Certificate Authority.
[0056] TLS: Transport Layer Security, is a secure transport layer protocol used to provide confidentiality and data integrity between two communicating applications. This protocol consists of two layers: the TLS Record protocol and the TLS Handshake protocol.
[0057] Nginx: A high-performance HTTP and reverse proxy web server that also provides IMAP / POP3 / SMTP services.
[0058] RPMB: Replay Protected Memory Block.
[0059] LK: Short for Little Kernel, a type of bootloader. LK is only the boot part of the entire system, so it does not exist independently.
[0060] hdcd: In OpenHarmony, hdc is equivalent to adb in Android, and hdcd is equivalent to adbd. It is a daemon process running on the device side, which is part of hdc in the terminal. It enables communication with the hdc program on the PC and processes hdc commands.
[0061] In summary, this invention provides a system protection method and storage medium based on the OpenHarmony platform, extending the recovery mode to implement a system protection mode. The recovery mode consists of two parts: a recovery kernel and a recovery userspace. The userspace boots through the init file under recovery and executes the recovery bin program after parsing init.rc. Based on this approach, the value of ro.bootmode is determined by the mode passed through the LK, and is planned as recovery, safe, and cleardata. These three modes correspond to three bin programs, thus achieving mutual isolation. Switching between system protection modes is achieved through a secure link channel established between the server, PC tool, and terminal, with the switching command transmitted transparently, making it more secure.
[0062] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for system protection based on the OpenHarmony platform, characterized in that, Including the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode. The creation of the secure link channel includes the following steps: S01. The PC tool selects the mode switching function of the system protection mode and establishes an operation and maintenance channel with the terminal's operation and maintenance module through Socket to obtain the terminal's SN and CPUID. S02. The PC tool establishes a connection with the Nginx server via HTTPS two-way authentication and registers the command to switch the system protection mode. The command to be registered, the MAC address of the PC, and the SN and CPUID of the terminal are sent via POST and forwarded by Nginx to the command management module. S03. The instruction management module requests the prototype authorization management module to verify the legality of instruction registration. The prototype authorization management module verifies the PC based on the MAC address and verifies whether the CPUID is in the authorization pool. S04. Only after the prototype authorization management module passes the verification, the instruction management module caches the instruction, the CPUID, and the SN in the order requested, waits for the connection of the execution terminal, and notifies the PC tool that the instruction registration into the pool is successful. S05. The PC tool terminal notifies the terminal's security routing module to start creating a security link through the maintenance channel. S06. The secure routing module creates a sockect server based on the preset IP and port. The PC tool acts as a socket client and establishes a transparent transmission channel with the terminal. Then, the PC tool acts as a socket client and the server acts as a sockect server, establishing a transparent transmission channel between the PC tool and the server. S07. The terminal transmits data through the PC tool and performs a TLS handshake with the link module of the server to determine the session key. S08. The terminal sends the first service frame to the link module using the session key encryption based on the secure transport layer protocol. After receiving the service frame, the link module sends the CPUID, SN and terminal capabilities in the frame to the instruction management module and notifies that the secure link channel has been successfully established.
2. The system protection method based on the OpenHarmony platform according to claim 1, characterized in that, It also includes the following steps: When the device restarts, the terminal checks the restart reason information: If the restart reason is an attack, then enter system protection mode; If the reboot reason information is oem-10, the RPMB information is read after entering the LK stage to determine whether it has been attacked. If so, the system enters the protection mode.
3. The system protection method based on the OpenHarmony platform according to claim 2, characterized in that, Determining whether an attack has occurred includes: Root behavior detected; Firmware downgraded; Unauthorized customer customization, incorrect customer form signature, incompatible software customized by the system customizer; Maintenance status check failed; Terminal lifecycle status and system customization information are incomplete; The TA configuration detected suspected attack behavior, including the TA being started multiple times or its configuration data being tampered with.
4. The system protection method based on the OpenHarmony platform according to claim 1, characterized in that, Step S1 specifically involves: The server-side instruction module receives and retrieves the instruction from the cache based on the CPUID, SN, and terminal capabilities sent by the link module, and sends the instruction and terminal capabilities to the system protection mode switching module. The system protection mode switching module combines the instructions and terminal capabilities to obtain a switching instruction, which is then transmitted to the system protection module of the terminal through the secure link channel.
5. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it performs the following steps: S1. The server transmits the system protection mode switching command to the system protection module of the terminal through the secure link channel established between the server, PC tool and terminal; S2. The system protection module enters / exits the system protection mode according to the switching instruction. The system protection mode is based on the recovery mode and achieves isolation by executing the recovery bin program associated with the system protection mode. The creation of the secure link channel includes the following steps: S01. The PC tool selects the mode switching function of the system protection mode and establishes an operation and maintenance channel with the terminal's operation and maintenance module through Socket to obtain the terminal's SN and CPUID. S02. The PC tool establishes a connection with the Nginx server via HTTPS two-way authentication and registers the command to switch the system protection mode. The command to be registered, the MAC address of the PC, and the SN and CPUID of the terminal are sent via POST and forwarded by Nginx to the command management module. S03. The instruction management module requests the prototype authorization management module to verify the legality of instruction registration. The prototype authorization management module verifies the PC based on the MAC address and verifies whether the CPUID is in the authorization pool. S04. Only after the prototype authorization management module passes the verification, the instruction management module caches the instruction, the CPUID, and the SN in the order requested, waits for the connection of the execution terminal, and notifies the PC tool that the instruction registration into the pool is successful. S05. The PC tool terminal notifies the terminal's security routing module to start creating a security link through the maintenance channel. S06. The secure routing module creates a sockect server based on the preset IP and port. The PC tool acts as a socket client and establishes a transparent transmission channel with the terminal. Then, the PC tool acts as a socket client and the server acts as a sockect server, establishing a transparent transmission channel between the PC tool and the server. S07. The terminal transmits data through the PC tool and performs a TLS handshake with the link module of the server to determine the session key. S08. The terminal sends the first service frame to the link module using the session key encryption based on the secure transport layer protocol. After receiving the service frame, the link module sends the CPUID, SN and terminal capabilities in the frame to the instruction management module and notifies that the secure link channel has been successfully established.
6. A storage medium according to claim 5, characterized in that, It also includes the following steps: When the device restarts, the terminal checks the restart reason information: If the restart reason is an attack, then enter system protection mode; If the reboot reason information is oem-10, the RPMB information is read after entering the LK stage to determine whether it has been attacked. If so, the system enters the protection mode.
7. A storage medium according to claim 6, characterized in that, Determining whether an attack has occurred includes: Root behavior detected; Firmware downgraded; Unauthorized customer customization, incorrect customer form signature, incompatible software customized by the system customizer; Maintenance status check failed; Terminal lifecycle status and system customization information are incomplete; The TA configuration detected suspected attack behavior, including the TA being started multiple times or its configuration data being tampered with.
8. A storage medium according to claim 5, characterized in that, Step S1 specifically involves: The server-side instruction module receives and retrieves the instruction from the cache based on the CPUID, SN, and terminal capabilities sent by the link module, and sends the instruction and terminal capabilities to the system protection mode switching module. The system protection mode switching module combines the instructions and terminal capabilities to obtain a switching instruction, which is then transmitted to the system protection module of the terminal through the secure link channel.
Citation Information
Patent Citations
Device, terminal and method for preventing illegal updating of terminal
CN102354360A
Method for restarting system, terminal and storage medium
WO2021227926A1