Light equipment firmware verification method and device, equipment, medium and product
By establishing a soft bus connection between light devices and rich devices, the target credentials are obtained and verified, which solves the problem of limited anti-tampering storage space of light devices and realizes firmware security verification and rollback protection.
Patent Information
- Application Number
- CN202410858965.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Because light devices do not have or only have limited tamper-proof storage space, firmware verification cannot be performed or the number of verifications that can be achieved is small, making it difficult to implement firmware rollback protection.
By sending a target soft bus connection request to the rich device after the light device is started, the connection is established, and a credential application request is sent to the rich device to obtain the target credential, and the credential is verified. If the verification is successful, the firmware is controlled to run and the firmware is returned. Roll protection.
Without increasing the hardware cost of the light device, the target credentials are securely transmitted through the soft bus connection channel, ensuring the security and latest version number of the light device firmware, and achieving effective rollback protection of the firmware.
Smart Images

Figure CN118551389A
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, equipment, medium and product for verifying firmware of a light device. Background Art
[0002] As devices are updated over time, even if the update process is completely secure and reliable, attackers can still burn old versions of firmware with security flaws into the device, then reboot into the old version and exploit the security flaws to attack the device. The protection measure to prevent such attacks is called rollback protection.
[0003] The usual rollback protection scheme is to record the latest version number of the firmware into a tamper-proof storage space (such as a one-time programming space), compare the running version number with the latest version number when starting the device, and refuse to start if the running version number is lower than the latest version number, thereby achieving the purpose of firmware rollback prevention.
[0004] However, light devices usually have extremely limited hardware resources and have no or only limited tamper-proof storage space, which makes it impossible to perform firmware verification on light devices or the number of achievable verifications is small, making it difficult to implement firmware rollback protection. Summary of the invention
[0005] The embodiments of the present invention provide a method, apparatus, device, medium and product for verifying firmware of a light device, which can solve the problem that firmware verification cannot be performed or the number of achievable verifications is small, making it difficult to implement firmware rollback protection, because the light device has no or only limited tamper-proof storage space.
[0006] According to one aspect of the present invention, a method for verifying firmware of a light device is provided, which is performed by a light device and includes:
[0007] After the light device is started, sending a target soft bus connection request to the rich device, so that the rich device establishes a connection with the light device according to the target soft bus connection request;
[0008] Sending a credential application request to the rich device so that the rich device obtains a target credential corresponding to the light device, wherein the target credential is a credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device;
[0009] receiving a target credential sent by the rich device;
[0010] The target credential is verified, and if the verification is successful, the firmware is controlled to run.
[0011] According to one aspect of the present invention, a method for verifying firmware of a light device is provided, which is performed by a rich device and includes:
[0012] receiving a target soft bus connection request sent by a light device;
[0013] Establishing a connection with the light device according to the target soft bus connection request;
[0014] Receive a credential application request sent by a light device;
[0015] The target credential is sent to the light device according to the credential application request, so that the light device verifies according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
[0016] According to another aspect of the present invention, a light device firmware verification device is provided, which is configured in a light device, and the light device firmware verification device includes:
[0017] A connection request sending module, used for sending a target soft bus connection request to the rich device after the light device is started, so that the rich device establishes a connection with the light device according to the target soft bus connection request;
[0018] An application request sending module, used to send a credential application request to the rich device, so that the rich device obtains a target credential corresponding to the light device, wherein the target credential is a credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device;
[0019] A target credential receiving module, used for receiving a target credential sent by a rich device;
[0020] The target credential verification module is used to verify the target credential, and if the verification is successful, control the firmware to run.
[0021] According to another aspect of the present invention, there is provided a light device firmware verification device, which is configured in a rich device, and the light device firmware verification device comprises:
[0022] A connection request receiving module, used for receiving a target soft bus connection request sent by a light device;
[0023] A connection request establishment module, used to establish a connection with the light device according to the target soft bus connection request;
[0024] An application request receiving module, used to receive a credential application request sent by a light device;
[0025] The target credential sending module is used to send the target credential to the light device according to the credential application request, so that the light device can verify according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
[0026] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0027] at least one processor; and
[0028] a memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the light device firmware verification method described in any embodiment of the present invention.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the light device firmware verification method described in any embodiment of the present invention when executed.
[0031] According to another aspect of the present invention, a computer program product is provided. When the computer program is executed by a processor, the computer program implements the light device firmware verification method as described in any one of the embodiments of the present invention.
[0032] The embodiment of the present invention sends a target soft bus connection request to the rich device after the light device is started, so that the rich device establishes a connection with the light device according to the target soft bus connection request; sends a credential application request to the rich device, so that the rich device obtains the target credential corresponding to the light device, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update of the firmware update data sent by the rich device; receives the target credential sent by the rich device; verifies the target credential, and if the verification is successful, controls the firmware to run, thereby solving the problem that the light device does not have or has only limited tamper-proof storage space, resulting in the inability to perform firmware verification or the small number of achievable verifications, making it difficult to implement firmware rollback protection, and can establish a connection channel between the rich device and the light device based on the soft bus, through which the target credential can be securely transferred between the light device and the rich device, the light device verifies the light device's firmware based on the target credential, and controls the firmware to run after the verification is successful, thereby implementing firmware rollback protection for the light device.
[0033] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 It is a flow chart of a method for verifying firmware of a light device in Embodiment 1 of the present invention;
[0036] Figure 2 is a schematic diagram of a target credential in Embodiment 1 of the present invention;
[0037] Figure 3 This is a flow chart of a light device verifying a target credential in Embodiment 1 of the present invention;
[0038] Figure 4 is a flowchart of a light device firmware verification method in Embodiment 2 of the present invention;
[0039] Figure 5 This is a framework diagram of a light device firmware verification in Embodiment 2 of the present invention;
[0040] Figure 6 It is a schematic diagram of updating the firmware of a light device and starting the running firmware in the second embodiment of the present invention;
[0041] Figure 7 This is a flow chart of a verification of a credential to be verified in Embodiment 2 of the present invention;
[0042] Figure 8 It is a structural schematic diagram of a light device firmware verification device in Embodiment 3 of the present invention;
[0043] Fig. 9 It is a structural schematic diagram of a light device firmware verification device in Embodiment 4 of the present invention;
[0044] Fig.10 It is a structural schematic diagram of an electronic device in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, 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 should fall within the scope of protection of the present invention.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0048] Embodiment 1
[0049] Figure 1 is a flowchart of a method for checking firmware of a light device in the first embodiment of the present invention. This embodiment is applicable to the case where firmware rollback protection is implemented after checking the firmware of a light device. The method can be executed by the light device firmware checking device in the third embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method is executed by a light device and specifically includes the following steps:
[0050] S110, after the light device is started, a target soft bus connection request is sent to the rich device, so that the rich device establishes a connection with the light device according to the target soft bus connection request.
[0051] Among them, light devices are devices that use microcontroller processors, such as sensor devices that use Arm Cortex-M microcontroller processors. Such devices usually have extremely limited hardware resources and have no or limited tamper-proof storage space. Tamper-proof storage space usually includes OTP / EFuse (One-Time Programmable / electric-fuse, non-volatile memory / electronic fuse that can only be programmed once), TPM / TCM (Trusted Platform Module / Trusted Cryptography Module, Trusted Platform Module / Trusted Cryptography Module), etc. OTP / EFuse is a one-time programming space with good tamper-proof characteristics, but the space for recording data is limited; TPM / TCM is a trusted module, which usually has secure storage and trusted computing capabilities. TPM / TCM designed with software tamper-proof has good tamper-proof characteristics. Rich devices are devices that use application processors, such as terminal devices that use Arm Cortex-A application processors. Such devices usually have rich hardware resources and sufficient tamper-proof storage space.
[0052] Among them, the target soft bus connection request is the soft bus connection request sent by the light device to the rich device after startup. The soft bus is the Openharmony distributed soft bus (network cable, WiFi, Bluetooth, Star Flash, etc.), which is used to realize unified distributed communication management capabilities between near-field devices and provide connection discovery, networking and transmission capabilities between devices without distinguishing links.
[0053] Specifically, after the light device is started, a target soft bus connection request is sent to the rich device so that the rich device establishes a connection with the light device according to the target soft bus connection request. The method can be: sending a target soft bus connection request to the rich device when the light device is started, or sending a target soft bus connection request to the rich device when the light device is restarted after updating the firmware. After receiving the target soft bus connection request, the rich device establishes a soft bus connection with the light device according to the light device identifier carried in the target soft bus connection request.
[0054] S120, sending a credential application request to the rich device so that the rich device obtains the target credential corresponding to the light device, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
[0055] Among them, the target credential is the trusted credential returned by the rich device after receiving the credential application request sent by the light device. Verification through the target credential can ensure the security of the light device firmware operation.
[0056] Specifically, the method of sending a credential application request to the rich device so that the rich device obtains the target credential corresponding to the light device can be: the light device sends a credential application request to the rich device, and after the rich device receives the credential application request, the rich device queries the credential set stored in the rich device according to the credential application request, and obtains the target credential corresponding to the light device, wherein the target credential is the light device that first updates the firmware according to the firmware update data sent by the rich device, and after the update is completed, the light device sends a credential application request to the rich device, and the rich device determines the target credential according to the credential application request and sends it to the light device.
[0057] S130, receiving the target certificate sent by the rich device.
[0058] Specifically, after sending a credential application request to the rich device, the light device receives the target credential sent by the rich device.
[0059] S140, verify the target credential, and if the verification is successful, control the firmware to run.
[0060] The target credential may include a target security version number of the firmware corresponding to each firmware identifier in the light device and a target software version number of the firmware corresponding to each firmware identifier.
[0061] Specifically, the target credential is verified. If the verification is successful, the method for controlling the firmware operation can be: if the current security version number of the firmware corresponding to each firmware identifier in the light device is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, and the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, then the verification is successful, the light device controls the firmware operation, and ensures the safe startup of the light device.
[0062] Optionally, before the light device sends a target soft bus connection request to the rich device after starting, the following steps may also be included:
[0063] After the light device is pre-started, sending an initial soft bus connection request to the rich device, so that the rich device establishes a connection with the light device according to the initial soft bus connection request;
[0064] Receiving firmware update data sent by the rich device, and performing firmware update according to the firmware update data;
[0065] After the update is completed, a credential update request is sent to the rich device, so that the rich device determines the target credential according to the credential update request, and generates an update completion instruction after determining the target credential;
[0066] After receiving the update completion instruction, the connection between the light device and the rich device is controlled to be disconnected.
[0067] Among them, light device pre-start can be understood as the startup of light device, which is a necessary startup process for light device to update firmware. The initial soft bus connection request is the soft bus connection request sent to the rich device when the light device pre-starts to update the firmware. The firmware update data is the data packet of the firmware to be updated in the light device, and the firmware update data may include at least one firmware data packet to be updated. The credential update request is a request generated after the firmware update of the light device is completed, requesting the rich device to update the credential. The update completion instruction is a completion instruction generated by the rich device after the credential update is completed.
[0068] Specifically, after the light device is pre-started, an initial soft bus connection request is sent to the rich device so that the rich device establishes a connection with the light device according to the initial soft bus connection request. The method can be: after the light device is pre-started, an initial soft bus connection request is sent to the rich device, and after receiving the initial soft bus connection request, the rich device establishes a soft bus connection with the light device according to the light device identifier carried in the initial soft bus connection request.
[0069] Specifically, the method of receiving firmware update data sent by the rich device and performing firmware update according to the firmware update data can be: after the rich device establishes a connection with the light device, the firmware update data is sent to the light device, the light device receives the firmware update data sent by the rich device, and then the light device updates the firmware in the light device according to the firmware update data.
[0070] Specifically, after the update is completed, a credential update request is sent to the rich device so that the rich device determines the target credential based on the credential update request, and generates an update completion instruction after determining the target credential. The method can be: after the firmware update of the light device is completed, the light device sends a credential update request to the rich device, and after receiving the credential update request, the rich device determines the target credential based on the credential update request. After determining the target credential, the rich device generates an update completion instruction and sends the update completion instruction to the light device.
[0071] Specifically, after receiving the update completion instruction, the method for controlling the disconnection of the connection between the light device and the rich device can be: the light device receives the update completion instruction sent by the rich device, and disconnects the connection between the light device and the rich device according to the update completion instruction, so that the light device can start after the firmware update is completed and send a target soft bus connection request to the rich device.
[0072] By establishing a secure connection between the light device and the rich device based on the soft bus before the light device performs a firmware update, and obtaining the firmware update data sent by the rich device to perform a firmware update, the anti-tampering area space of the light device is saved, and after the light device is updated, a credential update request is sent to the rich device, so that the rich device determines the target credential based on the credential update request, and generates an update completion instruction after determining the target credential. After receiving the update completion instruction, the light device disconnects the soft bus connection with the rich device, which facilitates the light device to restart after the update is completed and reconnect to the rich device through the soft bus. Without increasing the hardware cost of the light device, it is ensured that the firmware of all light devices in the same distributed soft bus networking environment meets security expectations and is trustworthy.
[0073] Optionally, the firmware update data carries an identifier of the firmware to be updated and a security version number of the firmware to be updated corresponding to the identifier of the firmware to be updated;
[0074] Accordingly, performing firmware update according to the firmware update data includes:
[0075] Obtaining the current security version number of the firmware corresponding to the firmware identifier to be updated according to the firmware identifier to be updated;
[0076] If the security version number to be updated is greater than or equal to the current security version number, the firmware is updated.
[0077] Among them, the current security version number of the firmware corresponding to the firmware identifier is the security version number currently used in the firmware of the light device, the firmware identifier to be updated is the identification information of the firmware to be updated, and the security version number to be updated of the firmware corresponding to the firmware identifier to be updated is the expected updated security version number corresponding to the firmware to be updated.
[0078] Specifically, the method for obtaining the current security version number of the firmware corresponding to the firmware identifier to be updated based on the firmware identifier to be updated can be: after the light device obtains the firmware update data of the rich device, the firmware update data carries the firmware identifier to be updated, and the light device obtains the current security version number of the firmware corresponding to the firmware identifier to be updated in the light device based on the firmware identifier to be updated.
[0079] Specifically, if the security version number to be updated is greater than or equal to the current security version number, the method for performing the firmware update may be: if the firmware identifier to be updated contains multiple firmware identifiers, and the security version number to be updated of the firmware corresponding to each firmware identifier to be updated is greater than or equal to its current security version number, then the light device performs a firmware update; if the security version number to be updated of the firmware corresponding to at least one firmware identifier to be updated is less than its current security version number, then the light device is prohibited from rolling back the update.
[0080] By obtaining the current security version number of the firmware corresponding to the firmware identifier to be updated based on the firmware identifier to be updated; if the security version number to be updated is greater than or equal to the current security version number, the firmware is updated, which can achieve the purpose of anti-rollback of light device firmware, and can not only ensure that the firmware of the light device is updated to the latest security version number, but also improve the security of the light device firmware when updating.
[0081] Optionally, the target credential includes: credential version, credential generation timestamp, credential validity period, light device identification, firmware identification, target security version number of the firmware corresponding to each firmware identification, target software version number of the firmware corresponding to each firmware identification, and target trusted signature.
[0082] Among them, the credential version is the version information of the credential, and the contents of the credential versions corresponding to different light devices may be different; the credential generation timestamp is the time when the credential is generated, which can be the total number of seconds from 00:00:00 Greenwich time on January 1, 1970 to the present; the credential validity period is the time period during which the credential is valid, calculated from the credential generation timestamp, and the unit can be seconds; the light device identification includes the product serial number and device serial number of the light device, and the credential is only valid for the marked products and devices; the firmware identification is the identification information of each firmware in the light device; the target security version number of the firmware corresponding to each firmware identification and the target software version number of the firmware corresponding to each firmware identification are two version numbers of the firmware corresponding to each firmware identification, which are used to verify the firmware of the light device, and to update and start the firmware of the light device, wherein the security version number is the standard version number of the firmware, and the software version number is the software version number of the firmware. It should be noted that when updating the firmware on a light device, the firmware update data needs to carry the firmware to-be-updated security version number of the firmware corresponding to the firmware to-be-updated identifier. Only the security version number to be updated needs to be verified, and the verification of the firmware software version number is not limited. This can not only ensure firmware rollback protection, but also meet the user's requirements for various firmware software version numbers. When the light device starts the firmware execution, it is necessary to verify the target security version number of the firmware corresponding to each firmware identifier in the target certificate received from the rich device and the target software version number of the firmware corresponding to each firmware identifier, so as to improve the security of the firmware running on the light device. By flexibly setting the dual version numbers, the light device can be updated and started flexibly. The target trusted signature is a signature issued by a server or other means using a common public and private key.
[0083] Specifically, the target credential may also include: a credential serial number and a flag, wherein the credential serial number may be used for post-audit retrieval, and the flag may identify the capabilities of the credential, such as the valid range, the valid times, etc. In a specific example, Figure 2 is a schematic diagram of a target certificate in the first embodiment of the present invention, such as Figure 2As shown, the target credential includes the credential version, credential serial number, credential generation timestamp, credential validity period, flag, light device identification (light device product serial number and device serial number), firmware identification (for example, firmware 1, firmware N), the target security version number of the firmware corresponding to each firmware identification, the target software version number of the firmware corresponding to each firmware identification, and the target trusted signature.
[0084] Optionally, the target credential is verified, and if the verification is successful, the firmware is controlled to run, including:
[0085] Obtain the current security version number of the firmware corresponding to each firmware identifier in the light device and the current software version number of the firmware corresponding to each firmware identifier;
[0086] If the current security version number of the firmware corresponding to each firmware identifier is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, and the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, the verification is successful and the firmware is controlled to run.
[0087] In a specific example, Figure 3 is a flow chart of a light device verifying a target credential in Embodiment 1 of the present invention, such as Figure 3 As shown, after the light device establishes a connection with the rich device, the target credential sent by the rich device is obtained, the target credential includes a firmware identifier, a target security version number of the firmware corresponding to each firmware identifier, and a target software version number of the firmware corresponding to each firmware identifier, and the security version number and software version number of the firmware are verified in sequence according to the order of the firmware identifiers in the target credential. First, the current security version number of the firmware corresponding to each firmware identifier and the target security version number of the firmware are verified. If the current security version number of the firmware corresponding to each firmware identifier is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, the security version number verification is successful, otherwise, the verification fails, and then the current software version number of the firmware corresponding to each firmware identifier and the target software version number of the firmware are verified. If the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, the software version number verification is successful, otherwise, the verification fails; the successful verification of the security version number and the software version number of each firmware indicates that each firmware of the light device is successfully verified, then the light device is officially started and the firmware in the light device is run.
[0088] By obtaining the current security version number of the firmware corresponding to each firmware identifier in the light device and the current software version number of the firmware corresponding to each firmware identifier; if the current security version number of the firmware corresponding to each firmware identifier is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, and the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, then the verification is successful, and the firmware operation is controlled. The dual version number authentication mechanism can be implemented through the security version number and software version number in the target credential, thereby improving the security of the firmware running on the light device.
[0089] The technical solution of this embodiment is as follows: after the light device is started, a target soft bus connection request is sent to the rich device, so that the rich device establishes a connection with the light device according to the target soft bus connection request; a credential application request is sent to the rich device, so that the rich device obtains the target credential corresponding to the light device, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update of the firmware update data sent by the rich device; the target credential sent by the rich device is received; the target credential is verified, and if the verification is successful, the firmware is controlled to run, which solves the problem that the firmware cannot be verified or the number of achievable verifications is small due to the light device having no or only limited tamper-proof storage space, making it difficult to implement firmware rollback protection, and a connection channel between the rich device and the light device can be established based on the soft bus, and the target credential can be securely transferred between the light device and the rich device through the connection channel, and the light device verifies the light device's firmware based on the target credential, and controls the firmware to run after the verification is successful, thereby implementing firmware rollback protection for the light device.
[0090] Embodiment 2
[0091] Figure 4 is a flowchart of a method for checking firmware of a light device in the second embodiment of the present invention. This embodiment is applicable to the case where firmware rollback protection is implemented after checking the firmware of a light device. The method can be executed by the light device firmware checking device in the fourth embodiment of the present invention. The device can be implemented in software and / or hardware, such as Figure 4 As shown, the method is executed by a rich device and specifically includes the following steps:
[0092] S210, receiving a target soft bus connection request sent by a light device.
[0093] Specifically, the rich device receives a target soft bus connection request sent by a light device after startup in the same distributed soft bus networking environment.
[0094] S220: Establish a connection with the light device according to the target soft bus connection request.
[0095] Specifically, the rich device establishes a soft bus connection with the light device according to the light device identifier carried in the target soft bus connection request.
[0096] S230, receiving a credential application request sent by the light device.
[0097] Specifically, after the rich device establishes a soft bus connection with the light device, it receives the credential application request sent by the light device.
[0098] S240, sending the target credential to the light device according to the credential application request, so that the light device verifies according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
[0099] Specifically, the target credential is sent to the light device according to the credential application request so that the light device can verify according to the target credential. The method can be: the credential application request can carry the light device identifier, the rich device queries the credential set stored in the rich device according to the light device identifier carried in the credential application request, obtains the target credential corresponding to the light device, and sends the target credential to the light device so that the light device can verify according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device is updated according to the firmware update data sent by the rich device.
[0100] Optionally, before receiving the target soft bus connection request sent by the light device, the method further includes:
[0101] Receiving an initial soft bus connection request sent by a light device, wherein the initial soft bus connection request carries a light device identifier;
[0102] Establishing a connection with the light device according to the initial soft bus connection request, and sending a request to the target server based on the light device identification, and receiving the firmware update data and the to-be-verified credential sent by the target server;
[0103] Verifying the to-be-verified credential, and if the verification succeeds, sending the firmware update data to the light device, so that the light device performs a firmware update according to the firmware update data;
[0104] receiving a credential update request sent after the light device is updated, and determining the credential to be verified as a target credential according to the credential update request;
[0105] After determining the target credential, an update completion instruction is generated, and the update completion instruction is sent to the light device, so that the light device controls the disconnection between the light device and the rich device according to the update completion instruction.
[0106] The target server is a trusted update server that can establish a connection with the rich device. The target server may include a trusted certificate issuing center and a firmware publishing center. The trusted certificate issuing center may send a certificate to be verified to the rich device, and the firmware publishing center may send firmware update data to the rich device. The certificate to be verified is a certificate that needs to be verified by the rich device and is issued by the target server. The content contained in the certificate to be verified is similar to the target certificate, and will not be repeated here.
[0107] Specifically, the method for receiving the initial soft bus connection request sent by the light device can be: when the light device is pre-started, the initial soft bus connection request is sent to the rich device in the same distributed soft bus networking environment, and the rich device receives the initial soft bus connection request.
[0108] Specifically, a connection is established with the light device according to the initial soft bus connection request, and a request is sent to the target server based on the light device identifier. The method for receiving the firmware update data and the certificate to be verified sent by the target server can be: the rich device establishes a soft bus connection with the light device according to the light device identifier carried in the initial soft bus connection request, and then the rich device checks whether the light device needs to perform a firmware update. The rich device can send a firmware update query request to the target server connected to the rich device, wherein the firmware update query request carries the light device identifier, and the target server determines whether the firmware of the light device needs to be updated based on the light device identifier. If the target server determines that the light device needs to be updated, the target server automatically generates the certificate to be verified corresponding to the light device, and sends the firmware update data and the certificate to be verified to the rich device.
[0109] Specifically, the credential to be verified is verified, and if the verification is successful, the firmware update data is sent to the light device, so that the light device performs a firmware update according to the firmware update data. The method can be: the rich device stores a historical verification credential determined after the light device last updated the firmware, and the credential to be verified is verified with the historical verification credential. For example, if the trusted signature in the credential to be verified passes the verification, the credential version in the credential to be verified is greater than or equal to the credential version in the historical verification credential, the credential generation timestamp in the credential to be verified is greater than or equal to the credential generation timestamp in the historical verification credential, the current time is within the validity period of the credential in the credential to be verified, the light device identifier in the credential to be verified matches the light device identifier in the historical verification credential, and the security version number of the firmware corresponding to each firmware identifier in the credential to be verified is greater than or equal to the security version number of the firmware corresponding to each firmware identifier in the historical verification credential, then it is determined that the verification is successful, and the firmware update data is sent to the light device, so that the light device performs a firmware update according to the firmware update data.
[0110] Specifically, the method of receiving the credential update request sent after the light device update is completed, and determining the credential to be verified as the target credential according to the credential update request can be: after the light device completes the firmware update according to the firmware update data, the rich device receives the credential update request sent by the light device, and the rich device determines the credential to be verified as the target credential according to the credential update request, and at the same time, deletes the historical verification credentials of the light device stored in the rich device, that is, the newly generated target credential will be converted into a new historical verification credential when the credential to be verified is obtained next time.
[0111] Specifically, after determining the target credential, an update completion instruction is generated, and the update completion instruction is sent to the light device, so that the light device controls the disconnection of the connection between the light device and the rich device according to the update completion instruction. The method can be: after the rich device determines the target credential, an update completion instruction is generated, and the update completion instruction is sent to the light device, so that the light device disconnects the connection between the light device and the rich device according to the update completion instruction, and then starts after the firmware update is completed, and sends a target soft bus connection request to the rich device.
[0112] It should be explained that the rich device includes the rich device CA and the rich device TA, wherein the rich device CA mainly plays the role of communication, and the rich device TA provides a trusted execution environment and plays the role of verification. In a specific example, Figure 5 This is a framework diagram of a light device firmware verification in the second embodiment of the present invention, such as Figure 5 As shown, the target server is connected to the rich device, and the target server may include a trusted certificate issuing center and a firmware publishing center, wherein the trusted certificate issuing center sends the certificate to be verified to the rich device, and the firmware publishing center sends the firmware update data to the rich device. The light device and the rich device are connected through a soft bus, and the light device can perform firmware updates and target certificate verification. The rich device CA is mainly responsible for communication, receiving the firmware update data and the certificate to be verified of the light device issued by the target server. The rich device CA has a trusted environment proxy service, which is connected to the rich device TA. The rich device TA executes the trusted environment and can verify the certificate to be verified. In another specific example, Figure 6 FIG. 1 is a schematic diagram of updating and starting firmware of a light device in Embodiment 2 of the present invention. Figure 6As shown, the light device pre-starts and sends an initial soft bus connection request to the rich device CA. The rich device CA identifies the light device and establishes a connection with the light device based on the initial soft bus connection request, and then checks the light device firmware update. The rich device CA sends a firmware update query request to the target server. If the target server determines that the light device needs to be updated (the light device firmware update data can be compared with the current firmware data. If there is a firmware whose firmware update data corresponds to a security version number greater than the security version number corresponding to the current firmware data, it is determined that the light device needs to be updated), the target server automatically generates a to-be-verified credential corresponding to the light device, and sends the firmware update data and the to-be-verified credential to the rich device. If the light device does not need to be updated, the process ends; the rich device CA receives the firmware update data and the to-be-verified credential, and sends a request to verify the to-be-verified credential to the rich device TA. The rich device TA verifies the to-be-verified credential. If the verification is successful, the to-be-verified credential is cached, and the rich device CA is informed of the verification success. The rich device CA sends the successfully verified firmware update data to the light device, and the light device obtains the to-be-updated firmware identifier carried in the firmware update data. The current security version number of the firmware corresponding to the firmware identifier is the current security version number of the firmware. If the security version number to be updated carried by the firmware update data is greater than or equal to the current security version number, the firmware update verification is successful and the firmware update is performed. After the light device firmware update is completed, a credential update request is generated and sent to the rich device TA. The rich device TA determines the credential to be verified as the target credential according to the credential update request, and deletes the previously cached historical verification credential. After updating the credential, the rich device TA generates an update completion instruction and sends it to the light device; the light device disconnects the previous connection with the rich device according to the update completion instruction, and then restarts, and sends a target soft bus connection request to the rich device CA again. The rich device CA identifies the light device according to the target soft bus connection request and establishes a connection with the light device, and informs the light device that it is connected. The light device sends a credential application request to the rich device TA, and the rich device TA returns the stored target credential to the light device. The light device verifies the security version number and the software version number of the firmware in the order of the firmware identifier in the target credential. If the verification is successful, the light device starts normally and runs the firmware of the light device. Otherwise, the light device is prohibited from starting.
[0113] Optionally, verifying the credential to be verified, and if the verification succeeds, sending the firmware update data to the light device, includes:
[0114] Obtain historical verification credentials, preset public keys, and current time;
[0115] The trusted signature in the certificate to be verified is verified based on the preset public key. If the verification passes, the certificate version in the certificate to be verified is greater than or equal to the certificate version in the historical verification certificate, the certificate generation timestamp in the certificate to be verified is greater than or equal to the certificate generation timestamp in the historical verification certificate, the current time is within the validity period of the certificate in the certificate to be verified, the light device identifier in the certificate to be verified matches the light device identifier in the historical verification certificate, and the security version number of the firmware corresponding to each firmware identifier in the certificate to be verified is greater than or equal to the security version number of the firmware corresponding to each firmware identifier in the historical verification certificate, then it is determined that the verification is successful and the firmware update data is sent to the light device.
[0116] Among them, the historical verification credential is the target credential determined during the previous verification credential, the preset public key is the public key in the preset public-private key pair used by the target server to generate the trusted signature in the credential, the private key is used to generate the trusted signature, the preset public key is used to verify the trusted signature, and the preset public key is stored in the trusted execution environment in the rich device. The current time is the time when the rich device is currently used. The current time is compared with the credential validity period in the credential to be verified. If the current time is within the credential validity period, the credential to be verified is determined to be valid.
[0117] In a specific example, Figure 7 is a flow chart of a verification of a credential to be verified in Embodiment 2 of the present invention, such as Figure 7 As shown, a rich device TA is used to verify the certificate to be verified. The preset public key in the rich device TA is first used to verify the trusted signature in the certificate to be verified. If the verification passes, the certificate version in the certificate to be verified is greater than or equal to the certificate version in the historical verification certificate, the certificate generation timestamp in the certificate to be verified is greater than or equal to the certificate generation timestamp in the historical verification certificate, the current time is within the validity period of the certificate in the certificate to be verified, the light device identifier in the certificate to be verified matches the light device identifier in the historical verification certificate, and the security version number of the firmware corresponding to each firmware identifier in the certificate to be verified is greater than or equal to the security version number of the firmware corresponding to each firmware identifier in the historical verification certificate, then the verification is determined to be successful, otherwise, the verification fails.
[0118] By verifying the trusted signature in the credential to be verified, and after the signature verification is passed, the contents of the credential to be verified and the historical verification credential are verified in turn. If the verification is successful, the rich device will send the firmware update data to the light device, which can ensure the credibility of the credential to be verified and ensure the safe operation of the light device.
[0119] The technical solution of this embodiment receives a target soft bus connection request sent by a light device; establishes a connection with the light device according to the target soft bus connection request; receives a credential application request sent by the light device; and sends the target credential to the light device according to the credential application request, so that the light device performs verification according to the target credential. This solves the problem that the light device has no or only limited tamper-proof storage space, which makes it impossible to perform firmware verification or the number of achievable verifications is small, making it difficult to implement firmware rollback protection. A connection channel between a rich device and a light device can be established based on the soft bus. Through the connection channel, the target credential can be securely transferred between the light device and the rich device, so that the light device can perform firmware verification of the light device based on the target credential, and control the firmware operation after the verification is successful, thereby implementing firmware rollback protection for the light device.
[0120] Embodiment 3
[0121] Figure 8 : is a schematic diagram of the structure of a light device firmware verification device in the third embodiment of the present invention. This embodiment can be applied to the case where firmware rollback protection is implemented after firmware verification of light devices. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides the function of firmware verification of light devices, such as Figure 8 As shown, the light device firmware verification apparatus is configured in the light device, and specifically includes: a connection request sending module 310, an application request sending module 320, a target credential receiving module 330 and a target credential verification module 340.
[0122] The connection request sending module 310 is used to send a target soft bus connection request to the rich device after the light device is started, so that the rich device establishes a connection with the light device according to the target soft bus connection request;
[0123] The application request sending module 320 is used to send a credential application request to the rich device so that the rich device obtains the target credential corresponding to the light device, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device;
[0124] The target credential receiving module 330 is used to receive the target credential sent by the rich device;
[0125] The target credential verification module 340 is used to verify the target credential, and if the verification is successful, control the firmware to run.
[0126] Optionally, also include:
[0127] A pre-starting module, used for sending an initial soft bus connection request to the rich device after the light device is pre-started, so that the rich device establishes a connection with the light device according to the initial soft bus connection request;
[0128] An update data receiving module, used for receiving firmware update data sent by a rich device, and performing firmware update according to the firmware update data;
[0129] An update request sending module, used to send a credential update request to the rich device after the update is completed, so that the rich device determines the target credential according to the credential update request, and generates an update completion instruction after determining the target credential;
[0130] The connection disconnection module is used to control the connection disconnection between the light device and the rich device after receiving the update completion instruction.
[0131] Optionally, the firmware update data carries an identifier of the firmware to be updated and a security version number of the firmware to be updated corresponding to the identifier of the firmware to be updated;
[0132] Accordingly, the update data receiving module is specifically used for:
[0133] Obtaining the current security version number of the firmware corresponding to the firmware identifier to be updated according to the firmware identifier to be updated;
[0134] If the security version number to be updated is greater than or equal to the current security version number, the firmware is updated.
[0135] Optionally, the target credential includes: credential version, credential generation timestamp, credential validity period, light device identification, firmware identification, target security version number of the firmware corresponding to each firmware identification, target software version number of the firmware corresponding to each firmware identification, and target trusted signature.
[0136] Optionally, the target credential verification module is specifically used to:
[0137] Obtain the current security version number of the firmware corresponding to each firmware identifier in the light device and the current software version number of the firmware corresponding to each firmware identifier;
[0138] If the current security version number of the firmware corresponding to each firmware identifier is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, and the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, the verification is successful and the firmware is controlled to run.
[0139] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0140] Embodiment 4
[0141] Fig. 9: is a schematic diagram of the structure of a light device firmware verification device in the fourth embodiment of the present invention. This embodiment can be applied to the case where firmware rollback protection is implemented after firmware verification of light devices. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides the function of firmware verification of light devices, such as Fig. 9 As shown, the light device firmware verification apparatus is configured in a rich device, and specifically includes: a connection request receiving module 410, a connection request establishing module 420, an application request receiving module 430 and a target credential sending module 440.
[0142] The connection request receiving module 410 is used to receive a target soft bus connection request sent by a light device;
[0143] A connection request establishing module 420, configured to establish a connection with a light device according to the target soft bus connection request;
[0144] The application request receiving module 430 is used to receive the credential application request sent by the light device;
[0145] The target credential sending module 440 is used to send the target credential to the light device according to the credential application request, so that the light device verifies according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
[0146] Optionally, also include:
[0147] An initial request receiving module, used to receive an initial soft bus connection request sent by a light device, wherein the initial soft bus connection request carries a light device identifier;
[0148] A sending request sending module, used to establish a connection with the light device according to the initial soft bus connection request, and send a sending request to the target server based on the light device identification, and receive the firmware update data and the to-be-verified credential sent by the target server;
[0149] A credential verification module, used to verify the credential to be verified, and if the verification is successful, send the firmware update data to the light device, so that the light device performs firmware update according to the firmware update data;
[0150] An update request receiving module, used to receive a credential update request sent after the light device update is completed, and determine the credential to be verified as a target credential according to the credential update request;
[0151] The completion instruction sending module is used to generate an update completion instruction after determining the target credential, and send the update completion instruction to the light device, so that the light device controls the connection between the light device and the rich device to be disconnected according to the update completion instruction.
[0152] Optionally, the credential verification module is specifically used to:
[0153] Obtain historical verification credentials, preset public keys, and current time;
[0154] The trusted signature in the certificate to be verified is verified based on the preset public key. If the verification passes, the certificate version in the certificate to be verified is greater than or equal to the certificate version in the historical verification certificate, the certificate generation timestamp in the certificate to be verified is greater than or equal to the certificate generation timestamp in the historical verification certificate, the current time is within the validity period of the certificate in the certificate to be verified, the light device identifier in the certificate to be verified matches the light device identifier in the historical verification certificate, and the security version number of the firmware corresponding to each firmware identifier in the certificate to be verified is greater than or equal to the security version number of the firmware corresponding to each firmware identifier in the historical verification certificate, then it is determined that the verification is successful and the firmware update data is sent to the light device.
[0155] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0156] Embodiment 5
[0157] Fig.10 : is a structural diagram of an electronic device in Embodiment 5 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0158] like Fig.10As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0159] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0160] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a light device firmware verification method.
[0161] In some embodiments, the light device firmware verification method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the light device firmware verification method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the light device firmware verification method in any other appropriate manner (e.g., by means of firmware).
[0162] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0163] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0164] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0165] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0166] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0167] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0168] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0169] An embodiment of the present invention further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the light device firmware verification method according to any embodiment of the present invention is implemented.
[0170] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for verifying firmware of a light device, characterized in that: Performed by light equipment, including: After the light device is started, sending a target soft bus connection request to the rich device, so that the rich device establishes a connection with the light device according to the target soft bus connection request; Sending a credential application request to the rich device so that the rich device obtains a target credential corresponding to the light device, wherein the target credential is a credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device; receiving a target credential sent by the rich device; The target credential is verified, and if the verification is successful, the firmware is controlled to run.
2. The method according to claim 1, characterized in that Before the light device sends a target soft bus connection request to the rich device after starting, it also includes: After the light device is pre-started, sending an initial soft bus connection request to the rich device, so that the rich device establishes a connection with the light device according to the initial soft bus connection request; Receiving firmware update data sent by the rich device, and performing firmware update according to the firmware update data; After the update is completed, a credential update request is sent to the rich device, so that the rich device determines the target credential according to the credential update request, and generates an update completion instruction after determining the target credential; After receiving the update completion instruction, the connection between the light device and the rich device is controlled to be disconnected.
3. The method according to claim 2, characterized in that The firmware update data carries a to-be-updated firmware identifier and a to-be-updated security version number of the firmware corresponding to the to-be-updated firmware identifier; Accordingly, performing firmware update according to the firmware update data includes: Obtaining the current security version number of the firmware corresponding to the firmware identifier to be updated according to the firmware identifier to be updated; If the security version number to be updated is greater than or equal to the current security version number, the firmware is updated.
4. The method according to claim 1, characterized in that: The target credential includes: credential version, credential generation timestamp, credential validity period, light device identification, firmware identification, target security version number of the firmware corresponding to each firmware identification, target software version number of the firmware corresponding to each firmware identification, and target trusted signature.
5. The method according to claim 4, characterized in that Verify the target credential, and if the verification is successful, control the firmware to run, including: Obtain the current security version number of the firmware corresponding to each firmware identifier in the light device and the current software version number of the firmware corresponding to each firmware identifier; If the current security version number of the firmware corresponding to each firmware identifier is greater than or equal to the target security version number of the firmware corresponding to each firmware identifier, and the current software version number of the firmware corresponding to each firmware identifier is greater than or equal to the target software version number of the firmware corresponding to each firmware identifier, the verification is successful and the firmware is controlled to run.
6. A method for verifying firmware of a light device, characterized in that: Performed by rich devices, including: receiving a target soft bus connection request sent by a light device; Establishing a connection with the light device according to the target soft bus connection request; receiving a credential application request sent by a light device; The target credential is sent to the light device according to the credential application request, so that the light device verifies according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
7. The method according to claim 6, characterized in that Before receiving the target soft bus connection request sent by the light device, it also includes: Receiving an initial soft bus connection request sent by a light device, wherein the initial soft bus connection request carries a light device identifier; Establishing a connection with the light device according to the initial soft bus connection request, and sending a request to the target server based on the light device identification, and receiving the firmware update data and the to-be-verified credential sent by the target server; Verifying the to-be-verified credential, and if the verification succeeds, sending the firmware update data to the light device, so that the light device performs a firmware update according to the firmware update data; receiving a credential update request sent after the light device is updated, and determining the credential to be verified as a target credential according to the credential update request; After determining the target credential, an update completion instruction is generated, and the update completion instruction is sent to the light device, so that the light device controls the disconnection between the light device and the rich device according to the update completion instruction.
8. The method according to claim 7, characterized in that Verifying the to-be-verified credential, and if the verification is successful, sending the firmware update data to the light device, including: Obtain historical verification credentials, preset public keys, and current time; The trusted signature in the certificate to be verified is verified based on the preset public key. If the verification passes, the certificate version in the certificate to be verified is greater than or equal to the certificate version in the historical verification certificate, the certificate generation timestamp in the certificate to be verified is greater than or equal to the certificate generation timestamp in the historical verification certificate, the current time is within the validity period of the certificate in the certificate to be verified, the light device identifier in the certificate to be verified matches the light device identifier in the historical verification certificate, and the security version number of the firmware corresponding to each firmware identifier in the certificate to be verified is greater than or equal to the security version number of the firmware corresponding to each firmware identifier in the historical verification certificate, then it is determined that the verification is successful and the firmware update data is sent to the light device.
9. A light device firmware verification device, characterized in that: Configuration in light equipment, including: A connection request sending module, used for sending a target soft bus connection request to the rich device after the light device is started, so that the rich device establishes a connection with the light device according to the target soft bus connection request; An application request sending module, used to send a credential application request to the rich device, so that the rich device obtains a target credential corresponding to the light device, wherein the target credential is a credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device; A target credential receiving module, used for receiving a target credential sent by a rich device; The target credential verification module is used to verify the target credential, and if the verification is successful, control the firmware to run.
10. A light device firmware verification device, characterized in that: Configured in rich devices, including: A connection request receiving module, used for receiving a target soft bus connection request sent by a light device; A connection request establishment module, used to establish a connection with the light device according to the target soft bus connection request; An application request receiving module, used to receive a credential application request sent by a light device; The target credential sending module is used to send the target credential to the light device according to the credential application request, so that the light device can verify according to the target credential, wherein the target credential is the credential determined by the rich device according to the credential update request sent by the light device after the light device completes the update according to the firmware update data sent by the rich device.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the light device firmware verification method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the light device firmware verification method according to any one of claims 1 to 8 when executed.
13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the light device firmware verification method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Managing information relating to secure module applications
CN101507248A
Method for providing anti-rollback protection in device which has no internal non-volatile memory
CN104798040A
Secure starting method and system based on RISC-V
CN113486360A
Control system version verification method and device, equipment and storage medium
CN114880017A
Control method and control device
CN115718916A
Cited By
Batch activation method and system for off-line equipment and related products
CN119561751A
Firmware updating method and device and storage medium
CN120353489A
