System startup method and electronic device
By implementing the permission management method of authorization marking and public key verification technology in electronic devices, the problem of starting a high-privileged version of the system on commercial electronic devices is solved, ensuring the security of the system and the protection of user data.
Patent Information
- Application Number
- CN202311718298.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The prior art cannot effectively prevent high-privileged version systems from launching on commercial electronic devices, resulting in user privacy leakage and potential filling profits.
By implementing a permission management method in electronic devices, using authorization tags and public key verification technologies, we ensure that only authorized R&D operating system images can start R&D systems in the event of failed trusted startup verification, preventing non-trusted sources System operation.
It effectively prevents the startup of high-privileged version systems, protects user privacy, prevents the operation of non-trusted source systems, and ensures the security of the system and the security of user data.
Smart Images

Figure CN117932592B_ABST
Abstract
Description
[0001] This application is a divisional of the Chinese patent application submitted to the State Intellectual Property Office on August 26, 2022, with application number 202211034152.4, and application name “System startup method and electronic device”. All contents of this application are included in the parent case. Technical Field
[0002] The present application relates to the field of system security, and in particular to a system startup method and electronic equipment. Background Art
[0003] During the startup process of commercial electronic devices, trusted startup verification is required to ensure that the code executed by the electronic device comes from a trusted source and prevent the code from an untrusted source from running.
[0004] However, some privileged versions, such as high-privilege root versions and debug versions, can pass the verification in the existing trusted boot verification process to enable the boot of high-privilege versions of the system, thereby obtaining user data, causing user privacy leakage, or being repackaged by criminals for profit. Therefore, a new method is needed to prevent high-privilege versions of the system from being booted on commercial electronic devices. Summary of the invention
[0005] In view of the problem that the prior art cannot prevent a high-authority version system from starting on an electronic device, the present application provides a permission management method and an electronic device. The present application also provides a computer-readable storage medium.
[0006] The present application embodiment adopts the following technical solutions:
[0007] In a first aspect, the present application provides a system startup method, the method being applied to an electronic device, the electronic device comprising a chip, a small kernel partition, a startup verification public key partition, and an operating system partition, the method comprising:
[0008] receiving an authorization tag, wherein the authorization tag includes a unique value of the electronic device;
[0009] Verifying whether the electronic device unique value in the authorization tag is consistent with the electronic device unique value stored in the electronic device, and if they are consistent, determining that the unlocking authorization is obtained;
[0010] Reading the fuse public key stored in the chip;
[0011] Using the fuse public key to verify the signature of the small kernel image stored in the small kernel partition, and reading the startup verification public key from the small kernel image after the signature verification succeeds;
[0012] Using the startup verification public key to verify the signature of the operating system development public key image stored in the startup verification public key partition, if the signature verification fails, reading the operating system development public key from the operating system development public key image based on the unlock authorization;
[0013] Using the operating system development public key to verify the signature of the development operating system image stored in the operating system partition, and reading the development operating system image after the signature verification is successful;
[0014] The R&D system is started based on the R&D operating system image.
[0015] According to the permission management method provided in the present application, after the electronic device is unlocked and authorized, the R&D system can be started through the R&D operating system image when the electronic device startup verification process fails.
[0016] In an implementation of the first aspect above:
[0017] The boot verification public key in the small kernel image is a boot verification commercial public key;
[0018] Alternatively, the boot verification public key in the small kernel image includes a boot verification R&D public key, wherein the boot verification R&D public key in the small kernel image is a null value or error data.
[0019] Furthermore, in an implementation of the first aspect, the receiving the authorization tag includes:
[0020] Sending a request instruction to a server, wherein the request instruction is used to request the server to issue the unlock authorization;
[0021] The authorization tag sent by the server is received, where the authorization tag corresponds to the unlocking authorization.
[0022] Furthermore, in an implementation of the first aspect above, the request instruction includes address information of the electronic device and a start-up request for starting the research and development system.
[0023] Furthermore, in order to ensure the unlocking authorization of a specific electronic device, in an implementation of the first aspect above, the unique value of the electronic device in the authorization tag is signed by the original factory private key, and the original factory private key is the manufacturer's unique key.
[0024] Furthermore, in an implementation of the first aspect, before sending a request instruction to the server, obtaining unlock authorization further includes:
[0025] Enter fastboot mode.
[0026] In a second aspect, the present application provides a system startup method, the method being applied to an electronic device, the electronic device comprising a chip, a small kernel partition, a startup verification public key partition, and an operating system partition, the method comprising:
[0027] receiving an authorization tag, wherein the authorization tag includes a unique value of the electronic device;
[0028] Verifying whether the electronic device unique value in the authorization tag is consistent with the electronic device unique value stored in the electronic device, and if they are consistent, determining that the unlocking authorization is obtained;
[0029] Reading the fuse public key stored in the chip;
[0030] Using the fuse public key to verify the signature of the small kernel image stored in the small kernel partition, and after the signature verification is successful, reading the startup verification research and development public key from the small kernel image;
[0031] Use the startup verification R&D public key to verify the signature of the operating system R&D public key image stored in the startup verification public key partition, and read the operating system public key from the operating system R&D public key image after the signature verification is successful;
[0032] Using the operating system public key to verify the signature of the R&D operating system image stored in the operating system partition, and in the case of signature verification failure, reading the R&D operating system image based on the unlock authorization;
[0033] The R&D system is started based on the R&D operating system image.
[0034] In an implementation of the first aspect above:
[0035] The operating system public key in the operating system development public key image is the operating system commercial public key;
[0036] Alternatively, the operating system public key in the operating system development public key image includes an operating system development public key, wherein the operating system development public key in the operating system development public key image is a null value or error data.
[0037] In an implementation of the first aspect, the receiving the authorization tag includes:
[0038] Sending a request instruction to a server, wherein the request instruction is used to request the server to issue the unlock authorization;
[0039] The authorization tag sent by the server is received, where the authorization tag corresponds to the unlocking authorization.
[0040] In an implementation manner of the first aspect above, the request instruction includes address information of the electronic device and a start request for starting the research and development system.
[0041] In an implementation of the first aspect above, the unique value of the electronic device in the authorization tag is signed by an original factory private key, and the original factory private key is a manufacturer-unique key.
[0042] In an implementation of the first aspect above, before sending the request instruction to the server, obtaining the unlock authorization further includes:
[0043] Enter fastboot mode.
[0044] In a third aspect, the present application provides an electronic device, the electronic device comprising:
[0045] A chip storing a fuse public key, wherein the fuse public key is used to verify the signature of the small kernel image;
[0046] A small kernel partition storing the small kernel image, wherein the small kernel image includes a boot verification public key, and the boot verification public key is used to verify the operating system development public key image, wherein: the boot verification public key is a boot verification commercial public key; or, the boot verification public key includes a boot verification development public key, and the boot verification development public key is a null value or error data;
[0047] A startup verification public key partition storing the operating system development public key image, wherein the operating system development public key image includes an operating system development public key, the operating system development public key is used to verify the development operating system image, and the development operating system image is used to start the development system;
[0048] The operating system partition is used to store the development operating system image when the development system is installed on the electronic device.
[0049] In a fourth aspect, the present application provides an electronic device, the electronic device comprising:
[0050] A chip storing a fuse public key, wherein the fuse public key is used to verify the signature of the small kernel image;
[0051] A small kernel partition storing the small kernel image, wherein the small kernel image includes a startup verification R&D public key, and the startup verification R&D public key is used to verify the signature of the operating system R&D public key image;
[0052] A boot verification public key partition storing the operating system development public key image, wherein the operating system development public key image includes an operating system public key, the operating system public key is used to verify the development operating system image, and the development operating system image is used to start the development system, wherein: the operating system public key is a commercial operating system public key; or, the operating system public key includes an operating system development public key, and the operating system development public key is a null value or error data;
[0053] The operating system partition is used to store the development operating system image when the development system is installed on the electronic device.
[0054] In a fifth aspect, the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps of the first aspect or the second aspect.
[0055] In a sixth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, which, when executed on a computer, enables the computer to execute the method of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 The figure is a schematic diagram of a partition data structure provided according to an embodiment of the present application;
[0057] Figure 2 The figure is a schematic diagram of a partition data structure provided according to an embodiment of the present application;
[0058] Figure 3 Shown is a flow chart of a trusted boot verification method for a commercial system provided according to an embodiment of the present application;
[0059] Figure 4 Shown is a flow chart of a trusted boot verification method for a research and development system provided according to an embodiment of the present application;
[0060] Figure 5 The figure is a schematic diagram of a distribution area data structure provided according to an embodiment of the present application;
[0061] Figure 6 The figure shows a system startup flow chart for a research and development system provided according to an embodiment of the present application;
[0062] Figure 7 The figure shows a flowchart of authorization unlocking initiated by a research and development system according to an embodiment of the present application;
[0063] Figure 8The figure is a schematic diagram of a distribution area data structure provided according to an embodiment of the present application;
[0064] Fig. 9 The figure shows a system startup flow chart for a research and development system provided according to an embodiment of the present application;
[0065] Fig.10 The figure is a schematic diagram of the hardware structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0067] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0068] Electronic devices need to use operating systems as a basis for performing various specific operations. Any operating instructions need to be executed on the operating system. Therefore, starting the operating system is an essential step when electronic devices are turned on and running. If an electronic device starts an operating system from an untrusted source that has been maliciously implanted with scripts or viruses, the malicious program in the operating system will steal privacy, causing privacy leaks and endangering user information and property safety.
[0069] Therefore, it is necessary to perform a security check on the operating system when the electronic device starts the operating system, start the security system from a trusted source, prevent the startup image from being changed and start the untrusted source system implanted with malicious programs, and protect the user's privacy and security.
[0070] In the existing security verification mechanism, electronic devices are locked before leaving the factory. After being locked, the electronic device needs to perform a trusted boot verification process each time the system is started to ensure that the image file used to start the operating system is the original image. In order to perform the trusted boot verification process, an independent boot verification public key (verifiedboot metadata, vbmeta) partition is added to the electronic device. The vbmeta partition stores the public key used to verify the signature of the operating system partition (for example, the Android partition). During the startup process, the Android partition is verified using the public key stored in the vbmeta partition to obtain the operating system image (boot image) and complete the startup of the operating system.
[0071] Figure 1 Shown is a schematic diagram of a partition data structure provided according to an embodiment of the present application.
[0072] Taking the Android system as an example, Figure 1 As shown, after the electronic device is powered on, the trusted boot verification process is automatically executed. Obtain the fuse public key stored in the chip 100; use the fuse public key to verify the signature of the small kernel image (lk image) stored in the little kernel (lk) partition 110, and obtain the boot verification public key (vbmeta partition public key) in the lk image after the signature verification is passed; use the vbmeta partition public key to verify the signature of the boot verification public key partition image (vbmeta image) stored in the vbmeta partition 120, and obtain the operating system public key in the vbmeta image after the signature verification is passed (for example, taking the Android system as an example, the Android partition public key); use the Android partition public key to verify the signature of the operating system image (boot image) in the Android partition 130, and obtain the boot image stored in the Android partition 130 after the signature verification is passed; flash the boot image into the memory to complete the system startup.
[0073] Further, the Android partition 130 includes multiple sub-partitions, such as a core partition 131, a system partition 132, and a product partition 133. Each sub-partition stores a corresponding sub-partition image. In another embodiment, the Android partition 130 may include other sub-partitions, which are not specifically limited here.
[0074] The vbmeta image saved in the vbmeta partition 120 includes multiple Android partition public keys corresponding to each Android sub-partition in the Android partition 130, for example, a core public key for verifying the sub-partition image in the core partition 131, a system public key for verifying the sub-partition image in the system partition 132, and a product public key for verifying the sub-partition image in the product partition 133.
[0075] Electronic devices can generally be equipped with commercial systems or R&D systems. Commercial systems are for daily use by users, but they have lower permissions and cannot perform some high-privilege operations. R&D systems have higher levels of operating permissions than commercial systems and can execute more operating instructions. When the system equipped in an electronic device is a commercial system, after passing the trusted boot verification, the commercial system can be started through the commercial boot image; when the system equipped in an electronic device is a R&D system, after passing the trusted boot verification, the R&D system can be started through the R&D boot image.
[0076] Figure 2 Shown is a schematic diagram of a partition data structure provided according to an embodiment of the present application.
[0077] like Figure 2 As shown, the lk partition 210 (refer to the lk partition 110 ) stores an lk image, and the lk image includes a boot verification commercial public key (vbmeta commercial public key) 211 and a boot verification R&D public key (vbmeta R&D public key) 212 .
[0078] The vbmeta partition 220 stores a boot verification commercial image (vbmeta commercial image). The vbmeta commercial image needs to be signed by the vbmeta commercial public key 211 before its contents can be read. The vbmeta commercial image contains a commercial core public key 221, a commercial system public key 222, and a commercial product public key 223.
[0079] The vbmeta partition 220 also stores a startup verification R&D image (vbmeta R&D image). The vbmeta R&D image needs to be signed by the vbmeta R&D public key 212 before its contents can be read. The vbmeta R&D image contains the R&D core public key 224, the R&D system public key 225, and the R&D product public key 226.
[0080] The Android partition (operating system partition) 230 includes three sub-partitions: a core partition, a system partition, and a product partition (refer to the Android partition 130 ).
[0081] When a commercial system is installed on the electronic device, the Android partition 230 stores the commercial operating system image.
[0082] Specifically, the commercial operating system image includes a commercial core image 231 , a commercial system image 232 , and a commercial product image 233 .
[0083] The core partition of the Android partition 230 stores a commercial core image 231. The commercial core image 231 needs to be signed by the commercial core public key 221 before the content can be read.
[0084] The system partition of the Android partition 230 stores a commercial system image 232. The commercial system image 232 needs to be signed by the commercial system public key 222 before the content can be read.
[0085] The product partition of the Android partition 230 stores a commercial product image 233. The commercial product image 233 needs to be signed by the commercial product public key 223 before the content can be read.
[0086] The commercial core image 231, the commercial system image 232 and the commercial product image 233 are used together by the electronic device to start the commercial system.
[0087] When a development system is installed on the electronic device, the Android partition 230 stores a development operating system image.
[0088] Specifically, the R&D operating system image includes a R&D core image 231 , a R&D system image 232 , and a R&D product image 233 .
[0089] The core partition of the Android partition 230 stores a research and development core image 234. The research and development core image 234 needs to be signed by the research and development core public key 224 before the content can be read.
[0090] The system partition of the Android partition 230 stores a research and development system image 235. The research and development system image 235 needs to be signed by the research and development system public key 225 before the content can be read.
[0091] The product partition of the Android partition 230 stores a research and development product image 236. The research and development product image 236 needs to be signed by the research and development product public key 226 before the content can be read.
[0092] The R&D core image 234, the R&D system image 235 and the R&D product image 236 are used together for starting the R&D system of the electronic device.
[0093] Figure 3 Shown is a flow chart of a trusted boot verification method for a commercial system provided according to an embodiment of the present application.
[0094] When a commercial system is installed on an electronic device, Figure 2 The electronic device of the partition data structure shown executes the following Figure 3 The following process is shown to achieve the startup of the commercial system.
[0095] S301, the electronic device is powered on and a trusted boot verification is performed.
[0096] Specifically, the electronic device is powered on and the operating system is started. In the process of starting the operating system, the trusted startup verification is automatically performed to determine whether the started operating system is a trusted source system.
[0097] Among them, after the electronic device is powered on, it obtains the fuse public key from the chip (refer to chip 110).
[0098] S302, use the fuse public key to verify the signature of the lk image stored in the lk partition 210, and after the signature verification is passed, read the vbmeta commercial public key 211 used for verifying the signature of the vbmeta partition from the lk image.
[0099] S303, use the vbmeta commercial public key 211 to verify the vbmeta commercial image stored in the vbmeta partition 220, and after the verification is passed, read the operating system commercial public key used for verifying the Android partition from the vbmeta commercial image.
[0100] The commercial public keys of the operating system in the vbmeta commercial image include: a commercial core public key 221 , a commercial system public key 222 , and a commercial product public key 223 .
[0101] S304 , use the commercial operating system public key obtained from the vbmeta commercial image to verify the signature of the commercial operating system image stored in the Android partition 230 to obtain the commercial operating system image stored in the Android partition 230 .
[0102] Specifically, S304 includes:
[0103] The commercial core image 231 stored in the core partition is signed by the commercial core public key 221, and the commercial core image 231 is read after the signature verification is passed;
[0104] The commercial system image 232 stored in the system partition is verified by using the commercial system public key 222, and the commercial system image 232 is read after the verification is passed;
[0105] The commercial product image 233 stored in the product partition is verified by using the commercial product public key 223 , and the commercial product image 233 is read after the verification is passed.
[0106] S305 , starting the commercial system on the electronic device through the commercial operating system image (commercial core image 231 , commercial system image 232 , and commercial product image 233 ).
[0107] Specifically, the commercial operating system images obtained by verifying the signature of the Android partition image, namely the commercial core image 231, the commercial system image 232 and the commercial product image 233, are flashed into the memory to complete the startup of the commercial system.
[0108] Among them, commercial operating system images can only be used to start commercial systems and cannot be used to start R&D systems.
[0109] Figure 4 Shown is a flow chart of a trusted boot verification method for a research and development system provided according to an embodiment of the present application.
[0110] When a research and development system is installed on an electronic device, based on Figure 2 The electronic device of the partition data structure shown executes Figure 4 The following process is shown to start the R&D system.
[0111] S401, the electronic device is powered on and a trusted boot verification is performed.
[0112] S402, use the fuse public key to verify the signature of the lk image stored in the lk partition 210, and after the signature verification is passed, read the vbmeta development public key 212 used for verifying the signature of the vbmeta partition from the lk image.
[0113] S403, use the vbmeta development public key 212 to verify the vbmeta development image stored in the vbmeta partition 220. After the verification is passed, read the operating system development public key used for verifying the Android partition 230 from the vbmeta development image.
[0114] The operating system development public key in the vbmeta development image includes: the development core public key 224, the development system public key 225 and the development product public key 226.
[0115] S404 , use the operating system development public key obtained from the vbmeta development image to verify the development operating system image stored in the Android partition 230 to obtain the development operating system image stored in the Android partition 230 .
[0116] Specifically, the Android partition includes a core partition, a system partition, and a product partition. S404 includes:
[0117] The R&D core public key 224 is used to verify the signature of the R&D core image 234 stored in the core partition, and the R&D core image 234 is read after the signature verification is passed;
[0118] The R&D system image 235 stored in the system partition is verified by using the R&D system public key 225, and the R&D system image 235 is read after the verification is passed;
[0119] The R&D product image 236 stored in the product partition is verified by using the R&D product public key 226, and the R&D product image 236 is read after the verification is passed.
[0120] S405, starting the R&D system on the electronic device through the R&D operating system image.
[0121] Specifically, the R&D operating system images obtained by verifying the signature of the Android partition image, namely the R&D core image 234, the R&D system image 235 and the R&D product image 236, are flashed into the memory to complete the startup of the R&D system.
[0122] Among them, the R&D operating system image can only be used to start the R&D system and cannot be used to start the commercial system.
[0123] During the startup process of the above-mentioned commercial systems and R&D systems, the trusted startup verification process ensures that the operating system started by the electronic device comes from a trusted source, and successfully starts the commercial system or R&D system from a trusted source, avoiding the startup of a system from an untrusted source and preventing the untrusted source system from causing harm to user privacy information.
[0124] Electronic devices need to be locked before leaving the factory so that trusted boot verification can be performed every time the device is turned on and the operating system is started. Although trusted boot verification can be used to determine whether the booted operating system is the system provided by the original manufacturer and prevent other pirated systems from being started, Figure 4 As shown in the flowchart, it is unable to prevent the original manufacturer's high-authority R&D system from starting.
[0125] On the one hand, once the high-authority R&D system of the original factory is leaked, it is easy for criminals to obtain and use it to make a pirated system. Since the boot images issued by the original factory, such as the original factory internal debug image, the image that prints user privacy information, and the high-authority root image, can be verified by trusted boot, when the pirated system based on the original factory R&D system is installed on an electronic device, it can also be started on the electronic device. Therefore, after the high-authority R&D system and the small package are leaked, they can be used by criminals to obtain user privacy information or perform repackaging for profit.
[0126] On the other hand, even if the system started on the electronic device is not a pirated system but a research and development system provided by the original manufacturer, it is very likely that the user will install software from untrusted sources on the electronic device by obtaining excessive usage permissions, which will cause harm to the electronic device and user privacy.
[0127] Therefore, it is necessary to prevent high-authority R&D systems from being started on electronic devices that users use daily.
[0128] In order to prevent the startup of a high-authority version of a research and development system, such as a high-authority root version or a debug version, an embodiment of the present application proposes an electronic device. When a commercial system is installed on the electronic device, the electronic device can be based on Figure 3 The process shown in the figure starts the commercial system normally. If the electronic device has a research and development system installed on it, Figure 4 The process shown performs trusted boot verification, and the electronic device cannot obtain the operating system development public key from the vbmeta partition, making it impossible for the electronic device to use the operating system development public key to verify the operating system partition, resulting in the termination of the trusted boot verification, thereby preventing the electronic device from starting the development system at the root.
[0129] Specifically, in one implementation, the vbmeta R&D public key stored in the lk partition of the electronic device is a null value or erroneous data. For example, the null value may be expressed as not storing the vbmeta R&D public key in the lk partition, or the null value may be expressed as setting all values of the vbmeta R&D public key stored in the lk partition to 1 or 0; the erroneous data may be expressed as the vbmeta R&D public key stored in the lk partition is unavailable, for example, the vbmeta R&D public key is replaced with a vbmeta commercial public key, or other data information.
[0130] Figure 5 The figure shows a schematic diagram of the distribution area data structure provided according to an embodiment of the present application, taking the vbmeta R&D public key as an empty value as an example.
[0131] like Figure 5 As shown, the lk image stored in the lk partition 510 only includes the vbmeta commercial public key 511, but does not include the vbmeta research and development public key.
[0132] The vbmeta partition 520 stores the vbmeta commercial image (including the commercial core public key 521, the commercial system public key 522, and the commercial product public key 523) and the vbmeta R&D image (R&D core public key 524, R&D system public key 525, and R&D product public key 526). (Refer to vbmeta partition 220)
[0133] The Android partition 530 includes three sub-partitions: a core partition, a system partition, and a product partition (refer to the Android partition 230 ).
[0134] When a commercial system is installed on the electronic device, a commercial core image 531 is stored in the core partition of the Android partition 530. The commercial core image 531 needs to be signed by the commercial core public key 521 before the content can be read.
[0135] The system partition stores a commercial system image 532. The commercial system image 532 needs to be signed by the commercial system public key 522 before the content can be read.
[0136] The product partition stores a commercial product image 533. The commercial product image 533 needs to be signed by the commercial product public key 523 before the content can be read.
[0137] The commercial core image 531, the commercial system image 532 and the commercial product image 533 are used together by the electronic device to start the commercial system.
[0138] When the R&D system is installed on the electronic device, the core partition of the Android partition 530 stores the R&D core image 534. The R&D core image 534 needs to be signed by the R&D core public key 524 before the content can be read.
[0139] The system partition stores the R&D system image 535. The R&D system image 535 needs to be signed by the R&D system public key 525 before the content can be read.
[0140] The product partition stores the R&D product image 536. The R&D product image 536 needs to be signed by the R&D product public key 526 before the content can be read.
[0141] The R&D core image 534, the R&D system image 535 and the R&D product image 536 are used together to start the R&D system of the electronic device.
[0142] For application scenarios where commercial systems are installed on electronic devices, electronic devices can be based on Figure 3 The process shown starts the commercial system.
[0143] For application scenarios where R&D systems are installed on electronic devices, Figure 4 In the process of starting the R&D system in the process shown, because the lk image stored in the lk partition 510 does not contain the vbmeta R&D public key, the electronic device cannot verify the signature of the vbmeta R&D image stored in the vbmeta partition 520 (and therefore cannot read the R&D core public key 524, the R&D system public key 525, and the R&D product public key 526), the trusted startup verification is terminated, and the R&D system cannot be started.
[0144] Furthermore, in some application scenarios, users still need to start the R&D system to perform high-authority operations in some special cases. Figure 5 The electronic device shown, the embodiment of the present application also proposes a system startup method for starting the R&D system. For the electronic device installed with the R&D system, in the process of starting the R&D system, the R&D system is started normally by means of authorization unlocking to ensure that the vbmeta R&D image signature verification fails.
[0145] Figure 6 The figure shows a system startup flow chart for a research and development system provided according to an embodiment of the present application.
[0146] Figure 5 The electronic equipment shown is based on the R&D system installed Figure 6 The following steps shown enable the startup of the R&D system.
[0147] S600 , obtaining unlocking authorization for the vbmeta development image stored in the vbmeta partition 520 .
[0148] In the embodiments of the present application, a variety of different methods can be used to obtain the unlocking authorization for the vbmeta development image, and the present application does not limit this.
[0149] Specifically, in one embodiment, a unique electronic device value (different electronic devices have different values) is configured for the electronic device and stored in a flag bit of the electronic device register. Figure 4The process shown in the figure enters the fastboot mode when the R&D system fails to start and attempts to restart the R&D system. The electronic device sends a request instruction to the server in fastboot mode and receives the authorization tag fed back by the server. When the value in the authorization tag fed back by the server is consistent with the unique value of the electronic device stored in the electronic device flag, the electronic device is confirmed to be authorized. The authorized electronic device can still complete the startup of the R&D system even if the trusted startup verification fails.
[0150] Figure 7 The figure shows a flowchart of authorization unlocking initiated by a research and development system according to an embodiment of the present application.
[0151] When the electronic device enters the fastboot mode, the electronic device executes the following Figure 7 The following steps are shown to implement S600 and obtain the unlocking authorization for the vbmeta development image.
[0152] S701, sending a request instruction to the server.
[0153] Specifically, the request instruction sent by the electronic device to the server includes the address information of the electronic device and a start request for starting the research and development system.
[0154] S702, receiving the authorization tag issued by the server according to the request instruction.
[0155] Specifically, after receiving the request instruction sent by the electronic device, the server determines the electronic device unique value that uniquely corresponds to the electronic device according to the address information in the request instruction. The electronic device unique value is signed with the original private key and sent to the electronic device as an authorization mark. After receiving the authorization mark sent by the server, the electronic device stores the authorization mark and uses it to unlock the authorization when restarting the R&D system.
[0156] The original private key is the unique key of the OEM. The OEM configures different public keys for different electronic devices to correspond to the original private key. The authorization mark signed by the original private key can only be verified by the public key of the terminal device itself.
[0157] S703, verify the authorization tag with the public key corresponding to the original private key to obtain the value sent by the server. If the authorization tag is consistent with the value stored in the electronic device, the authorization is completed.
[0158] Specifically, when the electronic device restarts the R&D system, it calls the authorization tag that has been stored in advance, verifies the authorization tag through the public key corresponding to the original factory private key, and obtains the unique value of the electronic device issued by the server.
[0159] The electronic device compares the unique value of the electronic device in the authorization tag with the unique value of the electronic device stored in the register flag bit. When the two values are consistent, the authorization is determined to be completed. When the value in the authorization tag is inconsistent with the unique value of the electronic device stored in the register flag bit, or the unique value of the electronic device stored in the flag bit is cleared due to an attack on the register, the authorization is determined to have failed.
[0160] When the authorization is successful, the authorized electronic device can continue the trusted boot verification process and read the R&D core image 534, the R&D system image 535 and the R&D product image 536 if the signature verification of the vbmeta R&D image fails.
[0161] The electronic device only needs to receive the authorization tag once and store it. When the authorization tag is subsequently compared with the value stored in the electronic device to verify the unlocking authorization, it only needs to call the pre-stored authorization tag for signature verification without repeatedly sending request instructions to the server and repeatedly receiving the authorization tag.
[0162] The embodiment of the present invention authorizes the electronic device to unlock through a server, so that the electronic device can start the research and development system to perform high-authority operations under some special circumstances, while ensuring the privacy and security of the user, providing maximum convenience for the user to use the electronic device.
[0163] Furthermore, the authorization process of the electronic device is to unlock the locked state of the electronic device before it leaves the factory. When the electronic device starts the R&D system after authorization, it is started in the unlocked state, which still has the risk of privacy leakage compared with the normal startup completed in the locked state. Therefore, in some embodiments, when the electronic device performs the trusted startup verification process, it is necessary to display prompt information of different colors according to the different lock states and different startup states of the electronic device to warn the user.
[0164] Specifically, when the electronic device completes the system startup directly through the trusted startup verification process without going through the authorization process, a green prompt message is displayed; when the electronic device is unlocked through the authorization process and the system is successfully started, an orange prompt message is displayed; when the electronic device fails to pass the authorization, a yellow prompt message is displayed; when the electronic device fails to find a valid system to start, a red prompt message is displayed.
[0165] Specifically, in one embodiment, authorized unlocking is implemented based on the following code.
[0166] BOOLEAN IsUnlocked (VOID)
[0167] {
[0168] #ifdef OEM_FEATURE_FASTBOOT_SECURE
[0169] return get_bootinfo_fblock_status(); ------Get the authorization flag
[0170] #else
[0171] return DevInfo.is_unlocked;
[0172] #endif
[0173] }
[0174] BOOLEAN AllowVerificationError = IsUnlocked(); Assign the value unlock to allow verification failure to start normally
[0175] Furthermore, various startup states are assigned to verification failures
[0176] VOID SetBootState(BootInfo *Info, BOOLEAN AllowVerificationError,
[0177] AvbSlotVerifyResult Result)
[0178] {
[0179] if (Info == NULL)
[0180] return;
[0181] if (AllowVerificationError)
[0182] Info->BootState = ORANGE;
[0183] else if (Result == AVB_SLOT_VERIFY_RESULT_OK)
[0184] Info->BootState = GREEN;
[0185] else if (Result == AVB_SLOT_VERIFY_RESULT_ERROR_PUBLIC_KEY_REJECTED)
[0186] Info->BootState = YELLOW;
[0187] else
[0188] Info->BootState = RED;
[0189] }
[0190] After S600, the electronic device performs trusted boot verification, for example, the electronic device restarts in fastboot mode.
[0191] S601, the electronic device obtains the fuse public key from the chip. (Refer to S401)
[0192] S602, use the fuse public key to verify the signature of the lk image stored in the lk partition 510, and after the signature verification is passed, read the vbmeta commercial public key 511 used for verifying the signature of the vbmeta partition from the lk image. (Refer to S402)
[0193] S603, using the vbmeta commercial public key 511 to verify the vbmeta development image stored in the vbmeta partition 520, the verification fails, but because the unlocking authorization has been obtained, the operating system development public key used for verifying the Android partition is read from the vbmeta development image. (Refer to S403)
[0194] S604, using the operating system development public key obtained from the vbmeta development image to verify the development operating system image stored in the Android partition 230, so as to obtain the development operating system image stored in the Android partition 230. (Refer to S404)
[0195] S605, starting the R&D system on the electronic device through the R&D operating system image. (Refer to S405)
[0196] In another implementation of the electronic device, the operating system development public key in the vbmeta development image stored in the vbmeta partition of the electronic device is a null value or erroneous data. For example, the null value may be expressed as not storing the vbmeta development image in the vbmeta partition or not saving the operating system development public key in the vbmeta development image, or the null value may also be expressed as setting all values of the operating system development public key to 1 or 0; the erroneous data may be expressed as the operating system development public key being unavailable, for example, replacing the operating system development public key with the operating system commercial public key, or other data information.
[0197] Figure 8 The figure is a schematic diagram of the distribution area data structure provided according to an embodiment of the present application, taking the operating system development public key as erroneous data as an example.
[0198] like Figure 8 As shown, the lk image stored in the lk partition 810 includes the vbmeta commercial public key 811 and the vbmeta research and development public key 812.
[0199] The vbmeta partition 820 stores a vbmeta commercial image, which includes a commercial core public key 821, a commercial system public key 822, and a commercial product public key 823).
[0200] The vbmeta partition 820 also stores a vbmeta R&D image, which includes a commercial core public key 821 , a commercial system public key 822 , and a commercial product public key 823 .
[0201] The Android partition 830 includes three sub-partitions: a core partition, a system partition, and a product partition (refer to the Android partition 230 ).
[0202] When a commercial system is installed on the electronic device, a commercial core image 831 is stored in the core partition of the Android partition 830. The commercial core image 831 needs to be signed by the commercial core public key 821 before the content can be read.
[0203] The system partition stores a commercial system image 832. The commercial system image 832 needs to be signed by the commercial system public key 822 before the content can be read.
[0204] The product partition stores a commercial product image 833. The commercial product image 833 needs to be signed by the commercial product public key 823 before the content can be read.
[0205] The commercial core image 831, the commercial system image 832 and the commercial product image 833 are used together by the electronic device to start the commercial system.
[0206] When the R&D system is installed on the electronic device, the core partition of the Android partition 830 stores the R&D core image 834. The R&D core image 834 needs to be signed by the R&D core public key before the content can be read.
[0207] The system partition stores the R&D system image 835. The R&D system image 835 needs to be signed by the R&D system public key before the content can be read.
[0208] The product partition stores the R&D product image 836. The R&D product image 836 needs to be signed by the R&D product public key before the content can be read.
[0209] The R&D core image 834, the R&D system image 835 and the R&D product image 836 are used together to start the R&D system of the electronic device.
[0210] For application scenarios where commercial systems are installed on electronic devices, electronic devices can be based on Figure 3 The process shown starts the commercial system.
[0211] For application scenarios where R&D systems are installed on electronic devices, Figure 4 During the process of starting the R&D system in the shown process, because the vbmeta R&D image saved in the vbmeta partition 820 does not contain the public key for verifying the R&D core image 834, the R&D system image 835 and the R&D product image 836, the electronic device cannot verify the R&D core image 834, the R&D system image 835 and the R&D product image 836 saved in the Android partition 830, the trusted startup verification is terminated, and the R&D system cannot be started.
[0212] Further, for Figure 8 The electronic device shown, the embodiment of the present application also proposes a system startup method for starting the R&D system. For the electronic device installed with the R&D system, during the process of starting the R&D system, the R&D system is started normally by authorizing and unlocking the device to ensure that when the signature verification of the Android partition 830 fails.
[0213] Fig. 9 The figure shows a system startup flow chart for a research and development system provided according to an embodiment of the present application.
[0214] Figure 8 The electronic equipment shown is based on the R&D system installed Fig. 9 The following steps shown enable the startup of the R&D system.
[0215] S900 , obtaining unlocking authorization for the R&D core image 834 , the R&D system image 835 , and the R&D product image 836 .
[0216] The start triggering condition of S900 and the method of obtaining unlocking authorization in S900 may refer to S600.
[0217] After S900, the electronic device performs trusted boot verification, for example, the electronic device restarts in fastboot mode.
[0218] S901, the electronic device obtains the fuse public key from the chip. (Refer to S401)
[0219] S902, use the fuse public key to verify the signature of the lk image stored in the lk partition 510, and after the signature verification is passed, read the vbmeta commercial public key 511 used for verifying the signature of the vbmeta partition from the lk image. (Refer to S402)
[0220] S903, using the vbmeta commercial public key 511 to verify the vbmeta development image stored in the vbmeta partition 520, and after the verification is successful, reading the operating system commercial public key used for verifying the Android partition from the vbmeta development image. (Refer to S403)
[0221] S904, use the commercial public key of the operating system obtained from the vbmeta R&D image to verify the signature of the R&D operating system image stored in the Android partition 230. The signature verification fails, but since the unlocking authorization has been obtained, the R&D operating system image stored in the Android partition 230 is read. (Refer to S404)
[0222] S905, starting the R&D system on the electronic device through the R&D operating system image. (Refer to S405)
[0223] An embodiment of the present application further proposes an electronic device, in which, in the LK partition of the electronic device, the vbmeta R&D public key in the LK image is a null value or erroneous data. The electronic device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the terminal device is triggered to execute the method steps described in the embodiment of the present application.
[0224] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0225] An embodiment of the present application further proposes an electronic device, in which, in the vbmeta partition of the electronic device, the operating system development public key in the operating system development public key image is a null value or erroneous data. The electronic device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the terminal device is triggered to execute the method steps described in the embodiment of the present application.
[0226] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0227] For example, Fig.10 FIG. 1 shows a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Fig.10As shown, the electronic device 1000 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0228] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0229] The processor 110 of the electronic device 1000 may be a device on a chip (SOC), which may include a central processing unit (CPU), and may further include other types of processors. For example, the processor 110 may be a PWM control chip.
[0230] The processor involved in the processor 110 may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor 110 may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor 110 may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0231] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 1000 may also include one or more processors 110. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0232] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 1000, and can also be used to transmit data between the electronic device 1000 and a peripheral device.
[0233] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0234] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 1000. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0235] The internal memory 121 of the electronic device 1000 can be used to store one or more computer programs, which include instructions. The processor 110 can run the above instructions stored in the internal memory 121, so that the electronic device 1000 performs the methods provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 121 may include a code storage area and a data storage area. Among them, the code storage area can store an operating system. The data storage area can store data created during the use of the electronic device 1000, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc.
[0236] The internal memory 121 can be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or it can also be any computer-readable medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0237] The processor 110 and the internal memory 121 can be combined into a processing device, or more commonly, they are independent components. The processor 110 is used to execute the program code stored in the internal memory 121 to implement the method described in the embodiment of the present application. In specific implementation, the internal memory 121 can also be integrated into the processor, or independent of the processor.
[0238] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 1000. While the charging management module 140 is charging the battery 142, it may also power the electronic device 1000 through the power management module 141.
[0239] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory interface 120, the mobile communication module 150 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0240] The wireless communication function of the electronic device 1000 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0241] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 1000 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0242] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 1000. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110.
[0243] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0244] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 1000. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0245] In some embodiments, the antenna 1 of the electronic device 1000 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 1000 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0246] The electronic device 1000 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0247] The electronic device 1000 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0248] The electronic device 1000 can implement touch input through the display screen 194, the touch sensor 180K, and the processor 110. For example, the touch sensor 180K and the display screen 194 are integrated into a touch screen, and the user's click operation on the touch screen is collected by the touch sensor 180K as a touch signal, and the touch signal is collected and converted by the sensor module 180 and transmitted to the processor 110. The processor 110 recognizes the touch signal and analyzes it into the user's touch operation behavior.
[0249] Furthermore, the devices, apparatuses, and modules described in the embodiments of the present application may be implemented by computer chips or entities, or by products having certain functions.
[0250] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0251] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0252] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.
[0253] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.
[0254] The description of the embodiments in this application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0255] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0256] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0257] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0258] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0259] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0260] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0261] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0262] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0263] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A system startup method, characterized in that: The method is applied to an electronic device, the electronic device comprising a chip, a small kernel partition, a boot verification public key partition, and an operating system partition, and the method comprises: receiving an authorization tag, wherein the authorization tag includes a unique value of the electronic device; Verifying whether the electronic device unique value in the authorization tag is consistent with the electronic device unique value stored in the electronic device, and if they are consistent, determining that the unlocking authorization is obtained; Reading the fuse public key stored in the chip; Using the fuse public key to verify the signature of the small kernel image stored in the small kernel partition, and reading the startup verification public key from the small kernel image after the signature verification succeeds; Using the startup verification public key to verify the signature of the operating system development public key image stored in the startup verification public key partition, if the signature verification fails, reading the operating system development public key from the operating system development public key image based on the unlock authorization; Using the operating system development public key to verify the signature of the development operating system image stored in the operating system partition, and reading the development operating system image after the signature verification is successful; Starting the R&D system based on the R&D operating system image; The boot verification public key in the small kernel image is a boot verification commercial public key; Alternatively, the boot verification public key in the small kernel image includes a boot verification R&D public key, wherein the boot verification R&D public key in the small kernel image is a null value or error data.
2. The method according to claim 1, characterized in that: The receiving authorization mark includes: Sending a request instruction to a server, wherein the request instruction is used to request the server to issue the unlock authorization; The authorization tag sent by the server is received, where the authorization tag corresponds to the unlocking authorization.
3. The method according to claim 2, characterized in that The request instruction includes address information of the electronic device and a start request for starting the research and development system.
4. The method according to claim 1, characterized in that The unique value of the electronic device in the authorization mark is signed by the original factory private key, and the original factory private key is the manufacturer's unique key.
5. The method according to claim 2, characterized in that: Before sending the request instruction to the server, obtaining the unlock authorization further includes: Enter fastboot mode.
6. A system startup method, characterized in that: The method is applied to an electronic device, the electronic device comprising a chip, a small kernel partition, a boot verification public key partition, and an operating system partition, and the method comprises: receiving an authorization tag, wherein the authorization tag includes a unique value of the electronic device; Verifying whether the electronic device unique value in the authorization tag is consistent with the electronic device unique value stored in the electronic device, and if they are consistent, determining that the unlocking authorization is obtained; Reading the fuse public key stored in the chip; Using the fuse public key to verify the signature of the small kernel image stored in the small kernel partition, and after the signature verification is successful, reading the startup verification research and development public key from the small kernel image; Use the startup verification R&D public key to verify the signature of the operating system R&D public key image stored in the startup verification public key partition, and read the operating system public key from the operating system R&D public key image after the signature verification is successful; Using the operating system public key to verify the signature of the R&D operating system image stored in the operating system partition, and in the case of signature verification failure, reading the R&D operating system image based on the unlock authorization; Starting the R&D system based on the R&D operating system image; The operating system public key in the operating system development public key image is the operating system commercial public key; Alternatively, the operating system public key in the operating system development public key image includes an operating system development public key, wherein the operating system development public key in the operating system development public key image is a null value or error data.
7. The method according to claim 6, characterized in that The receiving authorization mark includes: Sending a request instruction to a server, wherein the request instruction is used to request the server to issue the unlock authorization; The authorization tag sent by the server is received, where the authorization tag corresponds to the unlocking authorization.
8. The method according to claim 7, characterized in that The request instruction includes address information of the electronic device and a start request for starting the research and development system.
9. The method according to claim 6, characterized in that The unique value of the electronic device in the authorization mark is signed by the original factory private key, and the original factory private key is the manufacturer's unique key.
10. The method according to claim 7, characterized in that Before sending the request instruction to the server, obtaining the unlock authorization further includes: Enter fastboot mode.
11. An electronic device, characterized in that: The electronic device comprises: A chip storing a fuse public key, wherein the fuse public key is used to verify the signature of the small kernel image; A small kernel partition storing the small kernel image, wherein the small kernel image includes a boot verification public key, and the boot verification public key is used to verify the operating system development public key image, wherein: the boot verification public key is a boot verification commercial public key; or the boot verification public key includes a boot verification development public key, and the boot verification development public key is a null value or error data; and the boot verification public key fails when verifying the operating system development public key image; A startup verification public key partition storing the operating system development public key image, wherein the operating system development public key image includes an operating system development public key, the operating system development public key is used to verify the development operating system image, and the development operating system image is used to start the development system; The operating system partition is used to store the development operating system image when the development system is installed on the electronic device.
12. An electronic device, characterized in that: The electronic device comprises: A chip storing a fuse public key, wherein the fuse public key is used to verify the signature of the small kernel image; A small kernel partition storing the small kernel image, wherein the small kernel image includes a startup verification R&D public key, and the startup verification R&D public key is used to verify the signature of the operating system R&D public key image; A boot verification public key partition storing the operating system development public key image, wherein the operating system development public key image includes an operating system public key, the operating system public key is used to verify the development operating system image, and the development operating system image is used to start the development system, wherein: the operating system public key is a commercial operating system public key; or, the operating system public key includes an operating system development public key, and the operating system development public key is a null value or error data; and the development operating system image fails to be verified using the operating system public key; The operating system partition is used to store the development operating system image when the development system is installed on the electronic device.
13. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps as described in any one of claims 1-5 or any one of claims 6-10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 5 or any one of claims 6 to 10.
