CN103425932A - Signature calibration method and terminal device - Google Patents
Signature calibration method and terminal device Download PDFInfo
- Publication number
- CN103425932A CN103425932A CN2013103472353A CN201310347235A CN103425932A CN 103425932 A CN103425932 A CN 103425932A CN 2013103472353 A CN2013103472353 A CN 2013103472353A CN 201310347235 A CN201310347235 A CN 201310347235A CN 103425932 A CN103425932 A CN 103425932A
- Authority
- CN
- China
- Prior art keywords
- software package
- system software
- terminal device
- information
- legal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 110
- 238000012795 verification Methods 0.000 claims abstract description 114
- 238000012545 processing Methods 0.000 claims description 11
- 238000012423 maintenance Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000007664 blowing Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
本发明公开了一种签名校验方法和终端设备,其中,该签名校验方法包括:在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合;所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的;N≥2。本发明实施例由于N条签名信息为根据系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。
The present invention discloses a signature verification method and a terminal device, wherein the signature verification method includes: acquiring hardware information of the terminal device when the system is safely started, and the hardware information of the terminal device includes the terminal device At least one of the processor model, manufacturer information and device model or any combination thereof; the terminal device verifies whether the system software package is Legal, the N pieces of signature information are generated according to the original data of the system software package and different hardware information; N≥2. In the embodiment of the present invention, since the N pieces of signature information are generated according to the original data of the system software package and different hardware information, it can adapt to the secure startup of various types of hardware. When changing, the normal use of equipment such as startup, upgrade and maintenance will not be affected.
Description
技术领域technical field
本发明涉及通信技术领域,尤其是一种签名校验方法和终端设备。The invention relates to the technical field of communication, in particular to a signature verification method and terminal equipment.
背景技术Background technique
目前,高通平台支持基于熔丝熔断技术的安全启动方案(secureboot)。安全启动方案是根据不同应用需求而提供的一种安全启动方案,用于保护启动和一些通信使用的二进制数据。其原理是:先使用加密狗与数字证书,对安全启动所需的原始数据和硬件信息进行签名验证处理,将生成的签名信息与对应的原始数据绑定在一起;然后在终端设备启动时,终端设备中芯片的内部程序对加载的原始数据以及签名信息使用本终端设备的硬件信息进行校验,以确保加载的原始数据的合法性,即确保加载的系统软件包的合法性。Currently, the Qualcomm platform supports a secure boot solution (secureboot) based on fuse blowing technology. The secure boot solution is a secure boot solution provided according to different application requirements, and is used to protect boot and binary data used in some communications. The principle is: first use the dongle and digital certificate to perform signature verification processing on the original data and hardware information required for secure boot, and bind the generated signature information with the corresponding original data; then when the terminal device starts, The internal program of the chip in the terminal device verifies the loaded original data and signature information using the hardware information of the terminal device to ensure the legitimacy of the loaded original data, that is, to ensure the legitimacy of the loaded system software package.
高通平台现有的签名校验技术,终端设备在对加载的原始数据和签名信息进行校验时,需要使用该终端设备的硬件信息,当终端设备的硬件信息发生变化时,该硬件信息就可能与生成签名信息所使用的硬件信息不一致,由此会出现校验失败,导致终端设备无法启动。With the existing signature verification technology of the Qualcomm platform, the terminal device needs to use the hardware information of the terminal device when verifying the loaded original data and signature information. When the hardware information of the terminal device changes, the hardware information may be changed. It is inconsistent with the hardware information used to generate the signature information, so the verification will fail and the terminal device will not be able to start.
发明内容Contents of the invention
本发明要解决的问题是,现有签名校验技术在硬件信息发生变化时,影响设备的正常使用。The problem to be solved by the present invention is that when the hardware information changes in the existing signature verification technology, the normal use of the equipment is affected.
有鉴于此,为了解决上述问题,在第一方面,本发明提出了一种签名校验方法,包括:In view of this, in order to solve the above problems, in the first aspect, the present invention proposes a signature verification method, including:
在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合;In a state where the system is securely started, acquire hardware information of the terminal device, where the hardware information of the terminal device includes at least one of processor model, manufacturer information, and device model of the terminal device or any combination thereof;
所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的;N≥2。The terminal device verifies whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, and the N pieces of signature information are based on the original data and Generated with different hardware information; N ≥ 2.
结合第一方面,在第一种可能的实施方式中,所述获取终端设备的硬件信息之前,所述方法还包括:With reference to the first aspect, in a first possible implementation manner, before acquiring the hardware information of the terminal device, the method further includes:
将所述N条签名信息中的一条作为默认签名信息,将所述N条签名信息除了所述默认签名信息之外的其他签名信息作为附加签名信息;Using one of the N pieces of signature information as default signature information, and using other signature information of the N pieces of signature information except the default signature information as additional signature information;
其中,所述默认签名信息为所述终端设备每次进行校验时第一次使用的签名信息;所述默认签名信息保存在所述系统软件包的镜像数据之后,所述附加签名信息保存在所述默认签名信息之后;或,所述默认签名信息保存在所述系统软件包的镜像头与镜像数据之间,所述附加签名信息保存在所述镜像数据之后。Wherein, the default signature information is the signature information used for the first time when the terminal device performs verification every time; the default signature information is stored after the image data of the system software package, and the additional signature information is stored in After the default signature information; or, the default signature information is stored between the image header of the system software package and the image data, and the additional signature information is stored after the image data.
结合第一方面的第一种可能的实施方式,在第二种可能的实施方式中,所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the terminal device verifies the Whether the system package is legal, including:
所述终端设备根据所述系统软件包中的所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;The terminal device verifies whether the system software package is legal according to the default signature information in the system software package and the hardware information of the terminal device;
若根据所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包不合法,则依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法。If verifying that the system software package is illegal according to the default signature information and the hardware information of the terminal device, then verifying the system software package sequentially according to the additional signature information and the hardware information of the terminal device Whether it is legal, until it is verified that the system software package is legal.
结合第一方面的第二种可能的实施方式,在第三种可能的实施方式中,所述依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法之后,所述方法还包括:With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the verification of whether the system software package is legal according to the additional signature information and the hardware information of the terminal device in sequence , until it is verified that the system software package is legal, the method further includes:
将校验出所述系统软件包合法时所使用的附件签名信息,替换所述默认签名信息。The signature information of the attachment used when the system software package is legal will be verified, and the default signature information will be replaced.
结合第一方面或上述任一种可能的实施方式,在第四种可能的实施方式中,所述系统软件包中包括需要更新的原始数据,With reference to the first aspect or any of the above possible implementation manners, in a fourth possible implementation manner, the system software package includes original data that needs to be updated,
所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:The terminal device verifies whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, including:
在更新所述原始数据的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;In the process of updating the original data, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
所述方法还包括:The method also includes:
如果所述系统软件包合法,则执行所述系统软件包的原始数据的更新流程;If the system software package is legal, then perform an update process of the original data of the system software package;
否则,停止所述系统软件包的原始数据的更新并报错。Otherwise, stop updating the original data of the system software package and report an error.
结合第一方面或第一种可能的实施方式或第二种可能的实施方式或第三种可能的实施方式,在第五种可能的实施方式中,所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:With reference to the first aspect or the first possible implementation manner or the second possible implementation manner or the third possible implementation manner, in a fifth possible implementation manner, the terminal device according to the N Signature information and the hardware information of the terminal device, verify whether the system software package is legal, including:
在系统安全启动的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;During the process of system security startup, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
所述方法还包括:The method also includes:
如果所述系统软件包合法,则执行系统启动的流程;If the system software package is legal, execute the process of system startup;
否则,停止执行系统启动的流程并报错。Otherwise, stop executing the process started by the system and report an error.
在第二方面,本发明提出了一种终端设备,包括:In a second aspect, the present invention provides a terminal device, including:
信息获取模块,用于在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合;An information acquisition module, configured to acquire hardware information of the terminal device when the system is securely started, where the hardware information of the terminal device includes at least one of the processor model, manufacturer information, and device model of the terminal device, or any of them combination;
签名校验模块,用于根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的;N≥2。The signature verification module is used to verify whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, and the N pieces of signature information are based on the system software package. Generated from raw data and different hardware information; N ≥ 2.
结合第二方面,在第一种可能的实施方式中,所述终端设备还包括:With reference to the second aspect, in a first possible implementation manner, the terminal device further includes:
签名处理模块,用于将所述N条签名信息中的一条作为默认签名信息,将所述N条签名信息除了所述默认签名信息之外的其他签名信息作为附加签名信息;A signature processing module, configured to use one of the N pieces of signature information as default signature information, and use other signature information of the N pieces of signature information except the default signature information as additional signature information;
其中,所述默认签名信息为所述终端设备每次进行校验时第一次使用的签名信息;所述默认签名信息保存在所述系统软件包的镜像数据之后,所述附加签名信息保存在所述默认签名信息之后;或,所述默认签名信息保存在所述系统软件包的镜像头与镜像数据之间,所述附加签名信息保存在所述镜像数据之后。Wherein, the default signature information is the signature information used for the first time when the terminal device performs verification every time; the default signature information is stored after the image data of the system software package, and the additional signature information is stored in After the default signature information; or, the default signature information is stored between the image header of the system software package and the image data, and the additional signature information is stored after the image data.
结合第二方面的第一种可能的实施方式,在第二种可能的实施方式中,所述签名校验模块具体用于:根据所述系统软件包中的所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;若根据所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包不合法,则依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法。With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the signature verification module is specifically configured to: according to the default signature information in the system software package and the terminal The hardware information of the device, and verify whether the system software package is legal; if the system software package is verified to be illegal according to the default signature information and the hardware information of the terminal device, then according to the additional signature information and the The hardware information of the terminal device is used to verify whether the system software package is valid until the system software package is verified to be legal.
结合第二方面的第二种可能的实施方式,在第三种可能的实施方式中,所述签名处理模块还用于:在所述签名校验模块依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法之后,将校验出所述系统软件包合法时所使用的附件签名信息,替换所述默认签名信息。With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the signature processing module is further configured to: in the signature verification module, according to the additional signature information and the terminal The hardware information of the device, verify whether the system software package is legal, until it is verified that the system software package is legal, then verify the attachment signature information used when the system software package is legal, and replace the default signature information.
结合第二方面或上述任一种可能的实施方式,在第四种可能的实施方式中,所述系统软件包中包括需要更新的原始数据,所述签名校验模块包括:With reference to the second aspect or any of the above possible implementation manners, in a fourth possible implementation manner, the system software package includes original data that needs to be updated, and the signature verification module includes:
数据更新单元,用于在更新所述原始数据的过程中,根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;如果所述系统软件包合法,则执行所述系统软件包的原始数据的更新流程;否则,停止所述系统软件包的原始数据的更新并报错。A data update unit, configured to verify whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device during the process of updating the original data; if the system software package is legal, Then execute the update process of the original data of the system software package; otherwise, stop the update of the original data of the system software package and report an error.
结合第二方面或第一种可能的实施方式或第二种可能的实施方式或第三种可能的实施方式,在第五种可能的实施方式中,所述签名校验模块包括:With reference to the second aspect or the first possible implementation manner or the second possible implementation manner or the third possible implementation manner, in a fifth possible implementation manner, the signature verification module includes:
安全启动单元,用于在系统安全启动的过程中,根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;如果所述系统软件包合法,则执行系统启动的流程;否则,停止执行系统启动的流程并报错。A secure boot unit, configured to verify whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device during the process of system security startup; if the system software package is legal, execute The process initiated by the system; otherwise, stop executing the process initiated by the system and report an error.
本发明实施例在系统安全启动的状态下,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。In the embodiment of the present invention, when the system is safely started, the terminal device can verify whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device. Since the N pieces of signature information are Generated according to the original data of the system software package and different hardware information, it can adapt to the safe startup of various types of hardware. When the hardware information such as processor model, manufacturer information or device model changes, the startup and upgrade of the device Normal use such as maintenance and maintenance will not be affected.
附图说明Description of drawings
包含在说明书中并且构成说明书的一部分的说明书附图与说明书一起示出了本发明的示例性实施例、特征和方面,并且用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the invention and together with the description, serve to explain the principles of the invention.
图1为本发明实施例一的签名校验方法的流程示意图;FIG. 1 is a schematic flow diagram of a signature verification method according to Embodiment 1 of the present invention;
图2a~图2d为本发明实施例二的签名校验方法中签名信息存储位置的示意图;2a to 2d are schematic diagrams of signature information storage locations in the signature verification method according to Embodiment 2 of the present invention;
图2e为本发明实施例二的签名校验方法的流程示意图;FIG. 2e is a schematic flowchart of a signature verification method according to Embodiment 2 of the present invention;
图3为本发明实施例三的签名校验方法的流程示意图;FIG. 3 is a schematic flowchart of a signature verification method according to Embodiment 3 of the present invention;
图4为本发明实施例四的终端设备的结构框图;FIG. 4 is a structural block diagram of a terminal device according to Embodiment 4 of the present invention;
图5为本发明实施例五的终端设备的结构框图;FIG. 5 is a structural block diagram of a terminal device according to Embodiment 5 of the present invention;
图6为本发明实施例六的终端设备的结构框图。FIG. 6 is a structural block diagram of a terminal device according to Embodiment 6 of the present invention.
具体实施方式Detailed ways
以下将参考附图详细说明本发明的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the invention will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
另外,为了更好的说明本发明,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有这些具体细节,本发明同样可以实施。在另外一些实例中,对于大家熟知的方法、手段、元件和电路未作详细描述,以便于凸显本发明的主旨。In addition, in order to better illustrate the present invention, numerous specific details are given in the specific embodiments below. It will be understood by those skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, means, components and circuits are not described in detail so as to highlight the gist of the present invention.
图1为本发明实施例一的签名校验方法的流程示意图。在开发过程中,不同终端设备例如:手机、PAD等可能具有不同类型的处理器,并且使用过程中终端设备可能出现处理器芯片新旧更换的情况,因此终端设备支持的处理器类型可能有多种,在进行镜像数据升级或者系统安全启动的过程中,需要采用终端设备的处理器等硬件信息对系统软件包进行签名校验。如图1所示,该签名校验方法可以包括以下步骤:FIG. 1 is a schematic flowchart of a signature verification method according to Embodiment 1 of the present invention. During the development process, different terminal devices such as mobile phones and PADs may have different types of processors, and the processor chips may be replaced with new ones during the use of the terminal device, so the processor types supported by the terminal device may vary. , in the process of image data upgrade or system security startup, it is necessary to use hardware information such as the processor of the terminal device to verify the signature of the system software package. As shown in Figure 1, the signature verification method may include the following steps:
步骤101、在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合。
具体地,终端设备的系统可以处于安全启动的状态,例如:采用高通平台的终端设备处于secureboot状态,在安全启动状态下,终端设备在对需要运行的系统软件包进行签名校验时,需要使用该终端设备自身的硬件信息。其中,每个终端设备具有自身的硬件信息,硬件信息一般可以包括处理器型号、厂商信息和设备型号中的任意一种或几种。Specifically, the system of the terminal device can be in a secure boot state. For example, a terminal device using a Qualcomm platform is in a secureboot state. In the secure boot state, the terminal device needs to use the Hardware information of the terminal device itself. Wherein, each terminal device has its own hardware information, and the hardware information may generally include any one or several of processor model, manufacturer information, and device model.
步骤102、终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的。N≥2。
不同的终端设备可能具有不同的硬件信息,如:不同的处理器型号、厂商信息或设备型号;同一个终端设备具有不同类型的硬件信息,例如:同一个终端设备的处理器型号和厂商信息为不同类型。根据系统软件包的原始数据和一个硬件信息可以生成一条签名信息,根据系统软件包的原始数据和N个不同的硬件信息可以生成N条签名信息;其中,N个不同的硬件信息可以包括归属于同一个终端设备的不同的硬件信息,还可以包括归属于不同终端设备的不同的硬件信息。具体的,系统软件包在终端设备上运行之前,可以使用加密狗与数字证书分别对系统软件包中安全启动时所需的原始数据和N个不同的硬件信息进行签名验证处理,生成对应的N条签名信息,并将该N条签名信息存储在该系统软件包中;签名信息中可以包括校验数据(signaturedata)和证书信息(cert chain)等。终端设备在需要对系统软件包进行签名校验时,可以依次根据N条签名信息和终端设备的硬件信息,分别对系统软件包进行签名校验,如果有一条签名信息能够使得系统软件包的校验通过,可以结束校验流程,按照正常流程处理。如果所有的签名信息都不能使得系统软件包的校验通过,则该终端设备不能支持该系统软件包的运行和更新等正常工作。具体的,终端设备根据一条签名信息和终端设备的硬件信息,分别对系统软件包进行签名校验的过程可以包括:终端设备获取自身的硬件信息和待进行签名校验的系统软件包的原始数据,然后终端设备的芯片内部存储的校验程序根据该硬件信息和原始数据计算得到一签名信息,然后判断得到的签名信息与该系统软件包中的签名信息是否匹配,若匹配,则表示对系统软件包的签名校验通过,即系统软件包合法,若不匹配,则表示对系统软件包的签名校验不通过。Different terminal devices may have different hardware information, such as: different processor models, manufacturer information or device models; the same terminal device has different types of hardware information, for example: the processor model and manufacturer information of the same terminal device are Different Types. A piece of signature information can be generated according to the original data of the system software package and a piece of hardware information, and N pieces of signature information can be generated according to the original data of the system software package and N different pieces of hardware information; among them, N pieces of different hardware information can include attributes belonging to Different hardware information of the same terminal device may also include different hardware information belonging to different terminal devices. Specifically, before the system software package runs on the terminal device, the dongle and the digital certificate can be used to perform signature verification processing on the original data required for secure startup in the system software package and N different hardware information, and generate corresponding N pieces of signature information, and store the N pieces of signature information in the system software package; the signature information may include verification data (signaturedata) and certificate information (cert chain), etc. When the terminal device needs to verify the signature of the system software package, it can sequentially verify the signature of the system software package according to the N pieces of signature information and the hardware information of the terminal device. If the verification is passed, the verification process can be ended and processed according to the normal process. If all the signature information fails to make the verification of the system software package pass, the terminal device cannot support normal work such as running and updating of the system software package. Specifically, the process for the terminal device to verify the signature of the system software package according to a piece of signature information and the hardware information of the terminal device may include: the terminal device obtains its own hardware information and the original data of the system software package to be verified for signature , and then the verification program stored in the chip of the terminal device calculates a signature information based on the hardware information and original data, and then judges whether the obtained signature information matches the signature information in the system software package. If the signature verification of the software package passes, the system software package is legal. If it does not match, it means that the signature verification of the system software package fails.
由于系统软件包中包括与多个不同的硬件信息对应的签名信息,所以该系统软件包在硬件信息不同的多个终端设备中运行时,均可以校验通过。Since the system software package includes signature information corresponding to a plurality of different hardware information, the system software package can pass the verification when running in multiple terminal devices with different hardware information.
本实施例在系统安全启动的状态下,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。In this embodiment, when the system is safely started, the terminal device can verify whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device. Since the N pieces of signature information are based on The original data of the system software package and different hardware information are generated, which can adapt to the safe startup of various types of hardware. When the hardware information such as processor model, manufacturer information or device model changes, the device startup, upgrade and Normal use such as maintenance will not be affected.
图2a~图2d为本发明实施例二的签名校验方法中签名信息存储位置的示意图。在上述实施例的基础上,N条签名信息的存储位置可以有多种,可以全部作为一个整体保存在一处,也可以分为多段存储。本发明实施例中以一条签名信息为默认签名信息,其余的签名信息为附加签名信息为例进行说明。2a to 2d are schematic diagrams of signature information storage locations in the signature verification method according to Embodiment 2 of the present invention. On the basis of the above embodiments, there may be multiple storage locations for the N pieces of signature information, and they may all be stored in one place as a whole, or stored in multiple segments. In the embodiment of the present invention, a piece of signature information is taken as default signature information, and other signature information is additional signature information as an example for illustration.
可以将所述N条签名信息中的一条作为默认签名信息,将所述N条签名信息除了默认签名信息之外的其他签名信息作为附加签名信息。其中,所述默认签名信息为所述终端设备每次进行校验时第一次使用的签名信息。默认签名信息与附加签名信息的存储方式可以包括以下任意一种:One of the N pieces of signature information may be used as default signature information, and other signature information of the N pieces of signature information except the default signature information may be used as additional signature information. Wherein, the default signature information is the signature information used for the first time when the terminal device performs verification each time. The storage methods of default signature information and additional signature information can include any of the following:
方式一、所述默认签名信息保存在所述系统软件包的镜像数据之后,所述附加签名信息保存在默认签名信息之后。Mode 1: The default signature information is stored after the image data of the system software package, and the additional signature information is stored after the default signature information.
系统软件包的原始数据可以包括镜像头和镜像数据,例如:如图2a所示,镜像头为*hd.mbn和镜像数据为*sbl.mbn,默认签名信息可以保存在镜像数据为*sbl.mbn之后。如图2b所示,在默认签名信息之后,可以先保存一个镜像签名整体头文件,再保存每一个附加签名的头文件和附加签名信息。如果将所述默认签名信息保存到镜像头与镜像数据之间,可以将所述附加签名信息保存到所述镜像数据之后。The original data of the system software package can include the image header and image data, for example: as shown in Figure 2a, the image header is *hd.mbn and the image data is *sbl.mbn, and the default signature information can be stored in the image data as *sbl. After mbn. As shown in Figure 2b, after the default signature information, an overall header file of image signature can be saved first, and then the header file and additional signature information of each additional signature can be saved. If the default signature information is saved between the image header and the image data, the additional signature information may be saved behind the image data.
方式二、所述默认签名信息保存在所述系统软件包的镜像头与镜像数据之间,所述附加签名信息保存在所述镜像数据之后。Mode 2: The default signature information is stored between the image header of the system software package and the image data, and the additional signature information is stored after the image data.
如图2c所示,镜像头为elf_header和镜像数据为*.mbn,默认签名信息可以保存在镜像头和镜像数据之间。此外,如果将所述默认签名信息保存到镜像数据之后,可以将所述附加签名信息保存到所述默认签名信息之后。如图2d所示,在镜像数据之后,可以先保存一个镜像签名整体头文件,再保存每一个附加签名的头文件和附加签名信息。As shown in Figure 2c, the image header is elf_header and the image data is *.mbn, and the default signature information can be stored between the image header and the image data. In addition, if the default signature information is saved after the image data, the additional signature information may be saved after the default signature information. As shown in Figure 2d, after the image data, an overall image signature header file can be saved first, and then the header file and additional signature information of each additional signature can be saved.
进一步地,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,具体可以包括:Further, the terminal device verifies whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, which may specifically include:
所述终端设备根据系统软件包中的默认签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;The terminal device verifies whether the system software package is legal according to the default signature information in the system software package and the hardware information of the terminal device;
若根据所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包不合法,则依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法。If verifying that the system software package is illegal according to the default signature information and the hardware information of the terminal device, then verifying the system software package sequentially according to the additional signature information and the hardware information of the terminal device Whether it is legal, until it is verified that the system software package is legal.
再进一步地,每次校验通过的签名信息可能不同,如果系统软件包存储的默认签名信息为校验通过的签名信息,则在每次重启终端设备的过程中,可以优先采用默认签名信息对系统软件包进行校验,以减少校验时间。因此,依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法之后,所述签名校验方法还包括:Furthermore, the signature information that passes the verification may be different each time. If the default signature information stored in the system software package is the signature information that passes the verification, the default signature information can be preferentially used for each restart of the terminal device. The system software package is verified to reduce the verification time. Therefore, according to the additional signature information and the hardware information of the terminal device, verify whether the system software package is legal, until the system software package is verified to be legal, the signature verification method further includes:
将校验出所述系统软件包合法时所使用的附件签名信息,替换所述默认签名信息。The signature information of the attachment used when the system software package is legal will be verified, and the default signature information will be replaced.
具体地,默认的系统软件包的升级流程一般是:进入更新流程后,终端设备对系统软件包进行镜像完整性检查,如果系统软件包的镜像数据完整,再更新镜像数据。本发明实施例中,可以在默认的升级流程中增加对系统软件包的校验功能,根据软件更新的流程特点,当所述系统软件包中包括需要更新的原始数据时,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,具体可以包括:Specifically, the default upgrade process of the system software package is generally as follows: after entering the update process, the terminal device checks the image integrity of the system software package, and updates the image data if the image data of the system software package is complete. In the embodiment of the present invention, the verification function of the system software package can be added in the default upgrade process. According to the process characteristics of the software update, when the system software package includes the original data that needs to be updated, the terminal device according to the system software The N pieces of signature information in the package and the hardware information of the terminal device are used to verify whether the system software package is legal, which may specifically include:
在更新所述原始数据的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;In the process of updating the original data, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
这种情况下,所述方法还包括:In this case, the method also includes:
如果所述系统软件包合法,则执行所述系统软件包的原始数据的更新流程;否则,停止所述系统软件包的原始数据的更新并报错。If the system software package is valid, execute the update process of the original data of the system software package; otherwise, stop the update of the original data of the system software package and report an error.
图2e为本发明实施例二的签名校验方法的流程示意图,如图2e所示,该签名校验方法可以包括以下步骤:Fig. 2e is a schematic flow chart of a signature verification method according to Embodiment 2 of the present invention. As shown in Fig. 2e, the signature verification method may include the following steps:
步骤201、终端设备读取默认位置的默认签名信息;
步骤202、终端设备根据默认签名信息,判断需要升级的系统软件包是否合法,如果是,则执行步骤206;否则,执行步骤203;
具体的,终端设备根据读取的签名信息,判断需要升级的系统软件包是否合法的过程例如可以为:Specifically, the process for the terminal device to determine whether the system software package to be upgraded is legitimate according to the read signature information may be, for example:
终端设备获取自身的硬件信息和需要升级的系统软件包中的原始数据,终端设备的芯片内部存储有校验程序,根据该校验程序,对获取的硬件信息和原始数据进行验证计算,得到一签名信息,然后判断得到的签名信息与终端设备读取的签名信息是否匹配,若匹配,则该系统软件包合法,若不匹配,则该系统软件包不合法;其中,终端设备根据一条签名信息,判断系统软件包是否合法的过程可以参见现有的安全启动过程中的校验过程;The terminal device obtains its own hardware information and the original data in the system software package that needs to be upgraded. The chip of the terminal device stores a verification program. According to the verification program, the acquired hardware information and original data are verified and calculated to obtain a Signature information, and then judge whether the obtained signature information matches the signature information read by the terminal device. If they match, the system software package is legal; if they do not match, the system software package is illegal; among them, the terminal device , the process of judging whether the system software package is legal can refer to the verification process in the existing secure boot process;
步骤203、终端设备判断是否存在下一条附加签名信息,如果是,则执行步骤204,否则,执行步骤207;
步骤204、终端设备读取一条附加签名信息;
步骤205、终端设备根据读取的附加签名信息,判断需要升级的系统软件包是否合法,如果是,则采用匹配的附加签名信息替换默认签名信息,然后执行步骤206,否则返回执行步骤203;
步骤206、按照正常处理,终端设备继续更新该系统软件包的原始数据,完成数据更新。
步骤207、终端设备停止系统软件包的原始数据的更新并报错。例如:用户提供错误版本的镜像数据升级包时,终端设备主动拒绝更新软件并提示用户出错原因,以避免用户错误更新导致手机无法启动。
本实施例在系统安全启动的状态下,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。此外,一种系统软件包可以自适应于多款采用了不同型号处理器的终端设备,可以降低研发人员工作量,提升系统的兼容性,提高用户体验。进一步地,该签名校验方法还可以根据校验结果控制系统软件包的更新,避免错误更新升级包。此外,将校验通过的签名信息作为默认签名信息,可以减少系统软件包更新时校验的次数,提高校验的效率。In this embodiment, when the system is safely started, the terminal device can verify whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device. Since the N pieces of signature information are based on The original data of the system software package and different hardware information are generated, which can adapt to the safe startup of various types of hardware. When the hardware information such as processor model, manufacturer information or device model changes, the device startup, upgrade and Normal use such as maintenance will not be affected. In addition, a system software package can be adapted to a variety of terminal devices using different types of processors, which can reduce the workload of R&D personnel, improve system compatibility, and improve user experience. Further, the signature verification method can also control the update of the system software package according to the verification result, so as to avoid updating the upgrade package by mistake. In addition, using the signature information that has passed the verification as the default signature information can reduce the number of times of verification when the system software package is updated, and improve the efficiency of verification.
图3为本发明实施例三的签名校验方法的流程示意图。本实施例可以在终端设备进行安全启动时,进行签名校验。在终端设备进行开机启动时,先确认是否进行安全启动,在确认进行安全启动时,在启动时校验终端设备中的系统软件包是否合法,校验流程与上述实施例中软件升级的校验流程基本相似,区别在于校验流程的触发点不同。其中,系统软件包更新中的校验流程可以在进入系统软件包更新流程时触发。而安全启动时的校验流程可以在开机启动并发现需要进行安全启动时触发。本实施例与图2e所示实施例的区别在于,所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:FIG. 3 is a schematic flowchart of a signature verification method according to Embodiment 3 of the present invention. In this embodiment, signature verification can be performed when the terminal device performs secure startup. When the terminal device is started, first confirm whether it is safe to start. When confirming that it is safe to start, check whether the system software package in the terminal device is legal when starting. The verification process is the same as the verification of the software upgrade in the above-mentioned embodiment. The process is basically similar, the difference is that the trigger point of the verification process is different. Wherein, the verification process in the system software package update can be triggered when entering the system software package update process. The verification process during secure boot can be triggered when the system starts up and it is found that a secure boot is required. The difference between this embodiment and the embodiment shown in FIG. 2e is that the terminal device verifies whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, including:
在系统安全启动的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;During the process of system security startup, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
在这种情况下,所述方法还包括:In this case, the method also includes:
如果所述系统软件包合法,则执行系统启动的流程;If the system software package is legal, execute the process of system startup;
否则,停止执行系统启动的流程并报错。Otherwise, stop executing the process started by the system and report an error.
需要说明的是,可以通过多种手段来指示终端设备进行安全启动。例如:对高通芯片进行熔丝熔断,可以用来指示使用该芯片的终端设备在启动时执行安全启动过程;在终端设备启动时,可以先检查是否有熔丝熔断数据,若有,则执行安全启动过程,即校验系统软件包是否合法。It should be noted that the terminal device may be instructed to perform secure startup through various means. For example, blowing the fuse of a Qualcomm chip can be used to instruct the terminal device using the chip to perform a secure boot process when starting; The startup process is to verify whether the system software package is legal.
如图3所示,该签名校验方法可以包括以下步骤:As shown in Figure 3, the signature verification method may include the following steps:
步骤301、终端设备读取默认位置的默认签名信息;
步骤302、终端设备根据默认签名信息,判断系统软件包是否合法,如果是,则执行步骤306;否则,执行步骤303;
具体判断系统软件包是否合法的方法可以参见图2e所示的实施例;The method for specifically judging whether the system software package is legal can refer to the embodiment shown in FIG. 2e;
步骤303、终端设备判断是否存在下一条附加签名信息,如果是,则执行步骤304,否则,执行步骤307;
步骤304、终端设备读取一条附加签名信息;
步骤305、终端设备根据读取的附加签名信息,判断系统软件包是否合法,如果是,则采用匹配的附加签名信息替换默认签名信息,即将该匹配的附加签名信息设置为默认签名信息,然后执行步骤306,否则返回执行步骤303;
步骤306、终端设备允许设备继续运行,执行系统启动的流程。
步骤307、终端设备停止执行系统启动的流程并报错。这样可以禁止通过不合法的系统软件包进行启动。
本实施例在系统安全启动的状态下,终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。此外,一种系统软件包可以自适应于多款采用了不同型号处理器的终端设备,可以降低研发人员工作量,提升系统的兼容性,提高用户体验。进一步地,该签名校验方法还可以根据校验结果控制是否进行系统启动。此外,将校验通过的签名信息作为校验数据的默认签名信息,可以减少终端设备启动时校验的次数,提高校验的效率。In this embodiment, when the system is safely started, the terminal device can verify whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device. Since the N pieces of signature information are based on The original data of the system software package and different hardware information are generated, which can adapt to the safe startup of various types of hardware. When the hardware information such as processor model, manufacturer information or device model changes, the device startup, upgrade and Normal use such as maintenance will not be affected. In addition, a system software package can be adapted to a variety of terminal devices using different types of processors, which can reduce the workload of R&D personnel, improve system compatibility, and improve user experience. Further, the signature verification method can also control whether to start the system according to the verification result. In addition, using the signature information that passes the verification as the default signature information of the verification data can reduce the number of times of verification when the terminal device is started, and improve the efficiency of verification.
图4为本发明实施例四的终端设备的结构框图,如图4所示,该终端设备40可以包括:FIG. 4 is a structural block diagram of a terminal device according to Embodiment 4 of the present invention. As shown in FIG. 4, the
信息获取模块41,用于在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合。The
签名校验模块43,用于根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的;N≥2。The
具体地,终端设备的系统可以处于安全启动的状态,例如:采用高通平台的终端设备处于secureboot状态,在安全启动状态下,终端设备在对需要运行的系统软件包进行签名校验时,需要使用该终端设备自身的硬件信息。其中,每个终端设备具有自身的硬件信息,硬件信息一般可以包括处理器型号、厂商信息和设备型号中的任意一种或几种。Specifically, the system of the terminal device can be in a secure boot state. For example, a terminal device using a Qualcomm platform is in a secureboot state. In the secure boot state, the terminal device needs to use the Hardware information of the terminal device itself. Wherein, each terminal device has its own hardware information, and the hardware information may generally include any one or several of processor model, manufacturer information, and device model.
系统软件包在终端设备上运行之前,可以使用加密狗与数字证书分别对系统软件包中安全启动时所需的原始数据和N个不同的硬件信息进行签名验证处理,生成对应的N条签名信息,并将该N条签名信息存储在该系统软件包中;签名信息中可以包括校验数据(signature data)和证书信息(cert chain)等。终端设备在需要对系统软件包进行签名校验时,签名校验模块43可以依次根据N条签名信息和终端设备的硬件信息,分别对系统软件包进行签名校验,如果有一条签名信息能够使得系统软件包的校验通过,可以结束校验流程,按照正常流程处理。如果所有的签名信息都不能使得系统软件包的校验通过,则该终端设备不能支持该系统软件包的运行和更新等正常工作。Before the system software package runs on the terminal device, the dongle and digital certificate can be used to perform signature verification processing on the original data and N different hardware information required for secure startup in the system software package, and generate corresponding N pieces of signature information , and store the N pieces of signature information in the system software package; the signature information may include verification data (signature data) and certificate information (cert chain), etc. When the terminal device needs to perform signature verification on the system software package, the
本实施例提供的终端设备用于执行上述方法实施例中的方法,具体的工作原理和工作流程可以参见上述各方法实施例。The terminal device provided in this embodiment is used to execute the methods in the foregoing method embodiments. For specific working principles and workflows, reference may be made to the foregoing method embodiments.
本实施例,在系统安全启动的状态下,终端设备的信息获取模块可以获取终端设备的硬件信息,签名校验模块根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息和设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。In this embodiment, when the system is safely started, the information acquisition module of the terminal device can obtain the hardware information of the terminal device, and the signature verification module can, according to the N pieces of signature information in the system software package and the hardware information of the terminal device, Verify whether the system software package is legal. Since the N pieces of signature information are generated according to the original data of the system software package and different hardware information, it can adapt to the secure startup of various types of hardware. When the hardware information such as information and device model changes, the normal use of the device such as startup, upgrade and maintenance will not be affected.
图5为本发明实施例五的终端设备的结构框图,图5与图4标号相同的组件具有相同的含义。如图5所示,与上一实施例的主要区别在于,该终端设备50还可以包括:签名处理模块51,用于将所述N条签名信息中的一条作为默认签名信息,将所述N条签名信息除了所述默认签名信息之外的其他签名信息作为附加签名信息;FIG. 5 is a structural block diagram of a terminal device according to Embodiment 5 of the present invention. Components with the same numbers in FIG. 5 and in FIG. 4 have the same meanings. As shown in FIG. 5 , the main difference from the previous embodiment is that the
其中,所述默认签名信息为所述终端设备每次进行校验时第一次使用的签名信息;所述默认签名信息保存在所述系统软件包的镜像数据之后,所述附加签名信息保存在默认签名信息之后;或,所述默认签名信息保存在所述系统软件包的镜像头与镜像数据之间,所述附加签名信息保存在所述镜像数据之后。具体可以参见上述实施例的签名校验方法中图2a~图2d及其相关描述。Wherein, the default signature information is the signature information used for the first time when the terminal device performs verification every time; the default signature information is stored after the image data of the system software package, and the additional signature information is stored in After the default signature information; or, the default signature information is stored between the image header of the system software package and the image data, and the additional signature information is stored after the image data. For details, refer to FIG. 2a to FIG. 2d and their related descriptions in the signature verification method of the above embodiment.
所述签名校验模块43具体用于:根据系统软件包中的默认签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;若根据所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包不合法,则依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法。The
进一步地,签名处理模块51还可以用于:在签名校验模块43依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法之后,将校验出所述系统软件包合法时所使用的附件签名信息,替换所述默认签名信息。Further, the
在第一种可能的实施方式中,所述系统软件包中包括需要更新的原始数据,所述签名校验模块43可以包括:In a first possible implementation manner, the system software package includes original data that needs to be updated, and the
数据更新单元53,用于在更新所述原始数据的过程中,根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;如果所述系统软件包合法,则执行所述系统软件包的原始数据的更新流程;否则,停止所述系统软件包的原始数据的更新并报错。具体可以参见上述实施例的签名校验方法中图2e及其相关描述。A
在另一种可能的实施方式中,所述签名校验模块43还可以包括:In another possible implementation manner, the
安全启动单元55,用于在系统安全启动的过程中,根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;如果所述系统软件包合法,则执行系统启动的流程;否则,停止执行系统启动的流程并报错。具体可以参见上述实施例的签名校验方法中图3及其相关描述。The
本实施例,在系统安全启动的状态下,终端设备的信息获取模块可以获取终端设备的硬件信息,签名校验模块根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。此外,一种系统软件包可以自适应于多款采用了不同型号处理器的终端设备,可以降低研发人员工作量,提升系统的兼容性,提高用户体验。进一步地,终端设备还可以根据校验结果控制系统软件包的更新或系统启动,避免错误更新升级包或系统非法启动。此外,终端设备将校验通过的签名信息作为默认签名信息,可以减少后续进行校验的次数,提高校验的效率。In this embodiment, when the system is safely started, the information acquisition module of the terminal device can obtain the hardware information of the terminal device, and the signature verification module can, according to the N pieces of signature information in the system software package and the hardware information of the terminal device, Verify whether the system software package is legal. Since the N pieces of signature information are generated according to the original data of the system software package and different hardware information, it can adapt to the secure startup of various types of hardware. When hardware information such as information or device model changes, the normal use of the device such as startup, upgrade and maintenance will not be affected. In addition, a system software package can be adapted to a variety of terminal devices using different types of processors, which can reduce the workload of R&D personnel, improve system compatibility, and improve user experience. Furthermore, the terminal device can also control the update of the system software package or the system startup according to the verification result, so as to avoid wrong update of the upgrade package or illegal startup of the system. In addition, the terminal device uses the signature information that has passed the verification as the default signature information, which can reduce the number of subsequent verifications and improve the efficiency of verification.
图6为本发明实施例六的终端设备的结构框图。所述终端设备60可以是具备计算能力的主机服务器、个人计算机PC、或者可携带的便携式计算机或终端等。本发明具体实施例并不对计算节点的具体实现做限定。该终端设备60可以用于执行上述各方法实施例中的方法。FIG. 6 is a structural block diagram of a terminal device according to Embodiment 6 of the present invention. The
所述终端设备60可以包括处理器(processor)61、通信接口(Communications Interface)62、存储器(memory array)63和总线64。其中,处理器61、通信接口62、以及存储器63通过总线64完成相互间的通信。The
通信接口62用于与外部通信。The
处理器61用于执行程序。处理器61可能是一个中央处理器CPU,或者是专用集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The
存储器63用于存放文件和程序。存储器63可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。存储器63也可以是存储器阵列。存储器63还可能被分块,并且所述块可按一定的规则组合成虚拟卷。The
在一种可能的实施方式中,上述程序可为包括计算机操作指令的程序代码。该程序具体可用于:In a possible implementation manner, the above program may be a program code including computer operation instructions. Specifically, the program can be used for:
在系统安全启动的状态下,获取终端设备的硬件信息,所述终端设备的硬件信息包括所述终端设备的处理器型号、厂商信息和设备型号的至少一种或其任意组合;In a state where the system is securely started, acquire hardware information of the terminal device, where the hardware information of the terminal device includes at least one of processor model, manufacturer information, and device model of the terminal device or any combination thereof;
根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,所述N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的;N≥2。According to the N pieces of signature information in the system software package and the hardware information of the terminal device, verify whether the system software package is legal, and the N pieces of signature information are based on the original data and different hardware information of the system software package Generated; N≥2.
在一种可能的实施方式中,所述程序还用于:所述获取终端设备的硬件信息之前,将所述N条签名信息中的一条作为默认签名信息,将所述N条签名信息除了所述默认签名信息之外的其他签名信息作为附加签名信息;In a possible implementation manner, the program is further configured to: before acquiring the hardware information of the terminal device, use one of the N pieces of signature information as the default signature information, and use the N pieces of signature information except all Signature information other than the above-mentioned default signature information is used as additional signature information;
其中,所述默认签名信息为所述终端设备每次进行校验时第一次使用的签名信息;所述默认签名信息保存在所述系统软件包的镜像数据之后,所述附加签名信息保存在所述默认签名信息之后;或,所述默认签名信息保存在所述系统软件包的镜像头与镜像数据之间,所述附加签名信息保存在所述镜像数据之后。Wherein, the default signature information is the signature information used for the first time when the terminal device performs verification every time; the default signature information is stored after the image data of the system software package, and the additional signature information is stored in After the default signature information; or, the default signature information is stored between the image header of the system software package and the image data, and the additional signature information is stored after the image data.
在一种可能的实施方式中,根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:In a possible implementation manner, verifying whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device includes:
根据所述系统软件包中的所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;Verifying whether the system software package is legal according to the default signature information in the system software package and the hardware information of the terminal device;
若根据所述默认签名信息和所述终端设备的硬件信息,校验所述系统软件包不合法,则依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法。If verifying that the system software package is illegal according to the default signature information and the hardware information of the terminal device, then verifying the system software package sequentially according to the additional signature information and the hardware information of the terminal device Whether it is legal, until it is verified that the system software package is legal.
在一种可能的实施方式中,所述程序还用于:所述依次根据所述附加签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,直至校验出所述系统软件包合法之后,将校验出所述系统软件包合法时所使用的附件签名信息,替换所述默认签名信息。In a possible implementation manner, the program is further configured to: verify whether the system software package is legal according to the additional signature information and the hardware information of the terminal device in turn, until the verified After the system software package is legal, the attachment signature information used when the system software package is legal will be verified to replace the default signature information.
在一种可能的实施方式中,所述系统软件包中包括需要更新的原始数据,所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:In a possible implementation manner, the system software package includes original data that needs to be updated, and the terminal device verifies the system Whether the package is legal, including:
在更新所述原始数据的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;In the process of updating the original data, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
所述程序还用于:The program is also used to:
如果所述系统软件包合法,则执行所述系统软件包的原始数据的更新流程;If the system software package is legal, then perform an update process of the original data of the system software package;
否则,停止所述系统软件包的原始数据的更新并报错。Otherwise, stop updating the original data of the system software package and report an error.
在一种可能的实施方式中,所述终端设备根据系统软件包中的N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法,包括:In a possible implementation manner, the terminal device verifies whether the system software package is legal according to the N pieces of signature information in the system software package and the hardware information of the terminal device, including:
在系统安全启动的过程中,所述终端设备根据所述N条签名信息和所述终端设备的硬件信息,校验所述系统软件包是否合法;During the process of system security startup, the terminal device verifies whether the system software package is legal according to the N pieces of signature information and the hardware information of the terminal device;
所述程序还用于:The program is also used to:
如果所述系统软件包合法,则执行系统启动的流程;If the system software package is legal, execute the process of system startup;
否则,停止执行系统启动的流程并报错。Otherwise, stop executing the process started by the system and report an error.
本实施例,在系统安全启动的状态下,终端设备可以获取终端设备的硬件信息,根据系统软件包中的N条签名信息和所述终端设备的硬件信息,可以校验所述系统软件包是否合法,由于N条签名信息为根据所述系统软件包的原始数据和不同的硬件信息生成的,能够适应多种类型的硬件的安全启动,在处理器型号、厂商信息或设备型号等硬件信息发生变化时,设备的启动、升级和维护等正常使用不受影响。此外,一种系统软件包可以自适应于多款采用了不同型号处理器的终端设备,可以降低研发人员工作量,提升系统的兼容性,提高用户体验。进一步地,该签名校验方法还可以根据校验结果控制系统软件包的更新或系统启动,避免错误更新升级包或系统非法启动。此外,将校验通过的签名信息作为默认签名信息,可以减少后续进行校验的次数,提高校验的效率。In this embodiment, when the system is safely started, the terminal device can obtain the hardware information of the terminal device, and according to the N pieces of signature information in the system software package and the hardware information of the terminal device, it can be verified whether the system software package is Legal, since the N pieces of signature information are generated based on the original data of the system software package and different hardware information, it can adapt to the secure boot of various types of hardware. When changing, the normal use of equipment such as startup, upgrade and maintenance will not be affected. In addition, a system software package can be adapted to a variety of terminal devices using different types of processors, which can reduce the workload of R&D personnel, improve system compatibility, and improve user experience. Further, the signature verification method can also control the update of the system software package or the system startup according to the verification result, so as to avoid wrong update of the upgrade package or illegal startup of the system. In addition, using the signature information that passes the verification as the default signature information can reduce the number of subsequent verifications and improve the efficiency of verification.
本领域普通技术人员可以意识到,本文所描述的实施例中的各示例性单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件形式来实现,取决于技术方案的特定应用和设计约束条件。专业技术人员可以针对特定的应用选择不同的方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that each exemplary unit and algorithm steps in the embodiments described herein can be realized by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in the form of hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may choose different methods to implement the described functions for specific applications, but this implementation should not be regarded as exceeding the scope of the present invention.
如果以计算机软件的形式来实现所述功能并作为独立的产品销售或使用时,则在一定程度上可认为本发明的技术方案的全部或部分(例如对现有技术做出贡献的部分)是以计算机软件产品的形式体现的。该计算机软件产品通常存储在计算机可读取的存储介质中,包括若干指令用以使得计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各实施例方法的全部或部分步骤。而前述的存储介质包括U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random AccessMemory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of computer software and sold or used as an independent product, it can be considered that all or part of the technical solution of the present invention (such as the part that contributes to the prior art) is In the form of computer software products. The computer software product is usually stored in a computer-readable storage medium, and includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the embodiments of the present invention. The aforementioned storage media include various media that can store program codes such as U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310347235.3A CN103425932B (en) | 2013-08-09 | 2013-08-09 | Signature calibration method and terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310347235.3A CN103425932B (en) | 2013-08-09 | 2013-08-09 | Signature calibration method and terminal device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103425932A true CN103425932A (en) | 2013-12-04 |
CN103425932B CN103425932B (en) | 2017-02-01 |
Family
ID=49650653
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310347235.3A Active CN103425932B (en) | 2013-08-09 | 2013-08-09 | Signature calibration method and terminal device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103425932B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107193612A (en) * | 2014-06-27 | 2017-09-22 | 青岛海信移动通信技术股份有限公司 | The version upgrading method and device of a kind of mobile terminal |
CN110135130A (en) * | 2019-04-25 | 2019-08-16 | 武汉虹信通信技术有限责任公司 | A kind of embedded device software tamper-resistant method and system |
CN111125725A (en) * | 2019-11-22 | 2020-05-08 | 苏州浪潮智能科技有限公司 | An encryption and decryption method, device and medium for image verification |
CN113434484A (en) * | 2021-06-29 | 2021-09-24 | 青岛海尔科技有限公司 | Method, system, device and electronic device for describing functions of equipment |
CN117574352A (en) * | 2024-01-16 | 2024-02-20 | 苏州元脑智能科技有限公司 | Software and hardware combined anti-counterfeiting method, system, equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080301774A1 (en) * | 2007-05-28 | 2008-12-04 | Kabushiki Kaisha Toshiba | Information processing apparatus |
CN101373437A (en) * | 2007-04-10 | 2009-02-25 | 标准微系统公司 | Accessing safety memory by embedded controller to increase system safety |
CN102289622A (en) * | 2011-09-01 | 2011-12-21 | 西安电子科技大学 | Trusted startup method based on authentication policy file and hardware information collection |
-
2013
- 2013-08-09 CN CN201310347235.3A patent/CN103425932B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101373437A (en) * | 2007-04-10 | 2009-02-25 | 标准微系统公司 | Accessing safety memory by embedded controller to increase system safety |
US20080301774A1 (en) * | 2007-05-28 | 2008-12-04 | Kabushiki Kaisha Toshiba | Information processing apparatus |
CN102289622A (en) * | 2011-09-01 | 2011-12-21 | 西安电子科技大学 | Trusted startup method based on authentication policy file and hardware information collection |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107193612A (en) * | 2014-06-27 | 2017-09-22 | 青岛海信移动通信技术股份有限公司 | The version upgrading method and device of a kind of mobile terminal |
CN107193612B (en) * | 2014-06-27 | 2021-03-23 | 青岛海信移动通信技术股份有限公司 | Version upgrading method and device for mobile terminal |
CN110135130A (en) * | 2019-04-25 | 2019-08-16 | 武汉虹信通信技术有限责任公司 | A kind of embedded device software tamper-resistant method and system |
CN110135130B (en) * | 2019-04-25 | 2021-03-12 | 武汉虹信科技发展有限责任公司 | Method and system for preventing embedded equipment software from being modified |
CN111125725A (en) * | 2019-11-22 | 2020-05-08 | 苏州浪潮智能科技有限公司 | An encryption and decryption method, device and medium for image verification |
CN113434484A (en) * | 2021-06-29 | 2021-09-24 | 青岛海尔科技有限公司 | Method, system, device and electronic device for describing functions of equipment |
CN117574352A (en) * | 2024-01-16 | 2024-02-20 | 苏州元脑智能科技有限公司 | Software and hardware combined anti-counterfeiting method, system, equipment and storage medium |
CN117574352B (en) * | 2024-01-16 | 2024-04-05 | 苏州元脑智能科技有限公司 | Software and hardware combined anti-counterfeiting method, system, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103425932B (en) | 2017-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111984962B (en) | Firmware security verification method and device | |
CN103412769B (en) | External card parameter configuration, equipment and system | |
CN104636171B (en) | The method, device and mobile terminal of upgrading | |
CN103425932B (en) | Signature calibration method and terminal device | |
US10726130B2 (en) | Method and device for verifying upgrade of diagnosis connector of diagnostic equipment, and diagnosis connector | |
US12294657B2 (en) | Software integrity protection method and apparatus, and software integrity verification method and apparatus | |
CN101295262A (en) | System and method for securely updating firmware in devices by using a hypervisor | |
CN112000355A (en) | Method and device for firmware upgrading and household appliance | |
CN106815049B (en) | Method and device for upgrading feature library | |
WO2018024198A1 (en) | Application upgrade method and system for set-top box, and set-top box | |
US20170154184A1 (en) | Operating system agnostic validation of firmware images | |
CN105468393A (en) | Module version upgrade method and terminal device | |
CN111177709A (en) | A terminal trusted component execution method, device and computer equipment | |
CN103338450A (en) | Verification method and equipment | |
CN110399719A (en) | BIT file loading method, apparatus, device and computer-readable storage medium | |
CN111177703A (en) | Method and device for determining data integrity of operating system | |
CN101009888A (en) | Secure booting method for a mobile terminal, computer readable recording medium and mobile terminal | |
CN109213572B (en) | A virtual machine-based reliability determination method and server | |
JP2021135937A (en) | Information processing device and program startup method | |
CN103279705A (en) | Validation method and validation device of chip with secure booting function | |
CN113885907B (en) | A firmware upgrade system and method | |
CN114826660A (en) | Cloud service operation method, electronic device and storage medium | |
CN105468964A (en) | Computer system and computer system operating method | |
CN109491951B (en) | Data configuration method and computing equipment | |
CN109348472A (en) | OTA (over the air) upgrading method and system based on single-point pushing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20171027 Address after: Metro Songshan Lake high tech Industrial Development Zone, Guangdong Province, Dongguan City Road 523808 No. 2 South Factory (1) project B2 -5 production workshop Patentee after: Huawei terminal (Dongguan) Co.,Ltd. Address before: 518129 Longgang District, Guangdong, Bantian HUAWEI base B District, building 2, building No. Patentee before: HUAWEI DEVICE Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province Patentee after: HUAWEI DEVICE Co.,Ltd. Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province Patentee before: Huawei terminal (Dongguan) Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210430 Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Device Co.,Ltd. Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province Patentee before: HUAWEI DEVICE Co.,Ltd. |
|
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |