CN116611034A - Firmware starting method and system based on certificate authorization - Google Patents

Firmware starting method and system based on certificate authorization Download PDF

Info

Publication number
CN116611034A
CN116611034A CN202310393590.8A CN202310393590A CN116611034A CN 116611034 A CN116611034 A CN 116611034A CN 202310393590 A CN202310393590 A CN 202310393590A CN 116611034 A CN116611034 A CN 116611034A
Authority
CN
China
Prior art keywords
certificate
firmware
machine
judging whether
unique identifier
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.)
Pending
Application number
CN202310393590.8A
Other languages
Chinese (zh)
Inventor
赵翊含
苏卫强
石良军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Advanced Technology Research Institute
Original Assignee
Wuxi Advanced Technology Research Institute
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuxi Advanced Technology Research Institute filed Critical Wuxi Advanced Technology Research Institute
Priority to CN202310393590.8A priority Critical patent/CN116611034A/en
Publication of CN116611034A publication Critical patent/CN116611034A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/572Secure firmware programming, e.g. of basic input output system [BIOS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a firmware starting method and a firmware starting system based on certificate authorization, which comprise the following steps: s1: generating a first machine unique identifier; s2: judging whether a first certificate file is stored or not, if so, entering a step S3; if not, entering step S4; s3: judging whether the length of the first certificate file accords with the expectation or not, if not, entering a step S4, decrypting to obtain a second machine unique identifier, judging whether the second machine unique identifier is identical with the first machine unique identifier or not, if so, normally starting the firmware, and if not, entering the step S4; s4: acquiring a second certificate file or a third file certificate; s5: decrypting to obtain a third machine unique identifier, judging whether the third machine unique identifier is the same as the first machine unique identifier, if so, starting the firmware, and if not, entering step S402; s6: and decrypting to obtain a fourth machine unique identifier, judging whether the fourth machine unique identifier is the same as the first machine unique identifier, and if so, starting the firmware.

Description

Firmware starting method and system based on certificate authorization
Technical Field
The invention relates to the technical field of embedded systems, in particular to a firmware starting method and system based on certificate authority.
Background
Firmware is an important underlying software in computer systems, typically stored in FlashMemory. The main board, the display card, the network card and the hard disk of the computer are provided with firmware, and the firmware is basically hardware used and driven although the function is different. The most important firmware in a computer is called BIOS (basic input output system) for initializing motherboard hardware, managing hardware resources, booting an operating system. Is a bridge connecting computer base hardware and system software.
Firmware plays an important role in terms of computer functions, performance, and security, as well as computer core components such as a CPU (central processing unit), an operating system, and the like. The characteristics of the firmware determine that the firmware is started before an operating system in the running process, can access and operate hardware, can read and write files and can read and write information invisible to the operating system, and has more advantages and running environment in the aspect of authorization and authentication.
Currently, the method of firmware authorization initiation is divided into two directions, namely, requiring hardware support and not requiring hardware support. The method relies on a TCM (trusted computing platform) security chip integrated with a main board, and uses the security chip to store and verify the PIN code. Although this approach is safer, it has higher hardware requirements and is not suitable for a motherboard without a security chip.
The method firstly obtains the unique identifier of the equipment, uses the authorization seed and the unique identifier to generate an authorization certificate and compiles the authorization certificate into the embedded software, and judges whether the authorization is successful or not by analyzing the authorization certificate through the authorization seed carried by the software and the unique identifier obtained from the equipment when the software is executed. The method has the following technical defects: firstly, acquiring a unique identifier of equipment during compiling, and performing customized compiling according to the unique identifier, so that huge maintenance and management pressure is brought to an authorized party; and secondly, the authorization seed for generating the certificate is the same as the authorization seed carried by the software, the authorization seed can be automatically authorized by using the read unique equipment identifier after the authorization seed is cracked by reading the binary file library collision of the software, and huge potential safety hazards exist.
Disclosure of Invention
In order to overcome the above-mentioned shortcomings of the prior art, the present invention provides a firmware boot method and system based on certificate authority, which are used for solving at least one of the above-mentioned technical problems.
Based on one aspect of the present disclosure, a firmware start method based on certificate authority is provided, which includes the following steps:
s1: running firmware on a machine, acquiring a code with unique property in the machine, and generating a first machine unique identifier by using the code with the unique property;
the unique code in the machine is a code which is used for distinguishing the machine from other machines, the code has uniqueness, one machine can only correspond to one code, and one code can only correspond to one machine, such as wwm of common hard disks, which are called global unique numbers, and each hard disk is burnt when being produced and cannot be repeated with other hard disks. The machine unique identification is generated using coded encryption with unique properties such that each machine has its own unique identification for encryption.
S2: reading a reserved certificate storage space on the flash memory, judging whether a first certificate file is stored in the certificate storage space, and if yes, entering a step S3; if not, entering step S4;
s3: judging whether the length of the first certificate file accords with the expectation (namely, whether the length of the first certificate file is the same as the length of the standard certificate file), if not, entering a step S4, if yes, decrypting the first certificate file based on a public key stored in firmware to obtain a second machine unique identifier, judging whether the second machine unique identifier is the same as the first machine unique identifier, if yes, normally starting the firmware, and if not, entering the step S4;
s4: transmitting the first machine unique identifier to the authorizing party, and performing the following steps:
s401: judging whether the authorized party generates a certificate file aiming at the received unique identification of the first machine, if so, sending the certificate file to a firmware user as a second certificate file, and entering step S5: if not, go to step S402;
s402: encrypting the unique identification of the first machine and customized information of the authorized party based on the private key to obtain a third certificate file, and returning the third certificate file to the firmware user;
s5: decrypting the second certificate file based on the public key stored in the firmware to obtain a third machine unique identifier, judging whether the third machine unique identifier is the same as the first machine unique identifier, if so, starting the firmware, and if not, entering step S402;
s6: and decrypting the third certificate file based on the public key stored in the firmware to obtain a fourth machine unique identifier, judging whether the fourth machine unique identifier is identical to the first machine unique identifier, and if so, starting the firmware.
In the technical scheme, after the authorization is successful, the certificate file is stored in the flash memory (flash memory), and the certificate file in the flash memory is read again each time to judge whether the authorization is successful or not, and the TCM security card and the security module on hardware are not needed to be relied on, so that the method is suitable for a main board without a security chip. In addition, the scheme provided by the invention adopts the private key and the public key to encrypt and decrypt the certificate file respectively, and only the public key is released when the firmware is released, so that even if the public key of the imported firmware is cracked by a user through reading the memory, the user cannot generate the private key to autonomously authorize and crack the firmware, and the security of firmware authorization is greatly improved.
The second certificate file may be incorrect or expired, so that the firmware may fail to be started based on the second certificate file, and at this time, a new certificate file (i.e., the third certificate file) needs to be regenerated according to the unique identifier of the first machine, and the new certificate file (i.e., the third certificate file) can normally complete the authorized start of the firmware.
Further, before the step S1, the method further includes the following steps:
acquiring a public key and a private key based on an RSA algorithm module in a system tool Openssl, importing the public key into firmware, and retaining the private key in local management software of an authorized party;
reserving a space for storing certificates in a flash memory;
compiling the firmware and delivering the compiled firmware to the firmware user.
Public keys and private keys are generated simultaneously by using an RSA algorithm, and only the public keys are published during publishing. Because the RSA algorithm belongs to an asymmetric encryption algorithm, the public key can be deduced by the private key, and the private key cannot be deduced by the public key. Therefore, even if the public key of the imported firmware is cracked by a user through the read memory, the user cannot generate the private key to autonomously authorize and crack the firmware, so that the security of firmware authorization is greatly improved.
Further, the code with unique property includes a CPU number, a global unique hard disk number, or a network card MAC address.
Further, in said step S1, a hash algorithm is used to encrypt the code with unique properties.
The hash algorithm maps binary values of arbitrary length to shorter fixed length binary values, this small binary value being called the hash value. Hash values are a unique and extremely compact representation of a piece of data. If a piece of plaintext is hashed and even only one letter of the piece is changed, the subsequent hash will produce a different value. To find two different inputs hashed to the same value, it is computationally impossible, so the hash value of the data can verify the integrity of the data. The hash algorithm has the advantages of easy measurement and calculation, easy shrinkage, impact resistance, unidirectionality, high sensitivity and the like.
Further, in the step S5, if the third machine unique identifier is the same as the first machine unique identifier, the second certificate file is stored in a reserved certificate storage space on the flash memory, and if the first certificate file is stored in the certificate storage space, the first certificate file is deleted; in the step S6, if the unique identifier of the fourth machine is the same as the unique identifier of the first machine, the third certificate file is stored in the reserved certificate holding space on the flash memory, and if the first certificate file is stored in the certificate holding space, the first certificate file is deleted.
When the stored certificate file (i.e., the first certificate file) is not successfully authenticated (i.e., the first certificate file is invalid) or the stored certificate file (i.e., the first certificate file) is not successfully authenticated in the reserved certificate saving space on the flash memory, the second certificate file or the third certificate file which is successfully authenticated and received from the authorized party is stored in the reserved certificate saving space on the flash memory, and the first certificate file which is already invalidated and is stored in the certificate saving space is deleted. When the firmware is started next time, the certificate file is directly read from the certificate storage space for authorization, and an authorizer is not required to be required to generate the certificate file every time the firmware is started, so that the workload of the authorizer (developer) is reduced.
Further, in the step S402, the authorizer customization information includes at least a certificate issue time, a certificate validity period, a vendor number, and a firmware version number.
The expiration time of the certificate can be calculated through the certificate issuing time and the certificate validity period, and whether the certificate expires or not is judged according to the current time.
Further, in the step S3, if the determination result is yes, the method further includes the following steps:
s301: decrypting the first certificate file to obtain a first certificate issue time, a first certificate validity period, a first vendor number and a first firmware version number;
s302: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s303: calculating to obtain a first certificate expiration time point based on the first certificate issuing time and the first certificate finite period limit;
s304: the following three determinations were made:
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
judging whether the first firmware version number is consistent with the firmware version number in S302;
if the judging results of the three judging processes are all yes, starting the firmware, otherwise, entering step S4.
The verification condition during authorization is increased by judging whether the certificate file is expired (when the current time in S302 is greater than or equal to the expiration time point of the first certificate), whether the manufacturer numbers are consistent, and whether the firmware version numbers are consistent, so that the security of verification is enhanced.
Further, in the step S5, if the determination result is yes, the method further includes the following steps:
s501, decrypting a second certificate file to obtain a second certificate issue time, a second certificate validity period, a second manufacturer number and a second firmware version number;
s502: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s503: calculating a second certificate expiration time point based on the second certificate issuing time and the second certificate finite limit;
s503: the following three determinations were made:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
if the judgment results of the three judgment processes are yes, the firmware is started, otherwise, the step S402 is entered.
When the second certificate file cannot meet the three judging conditions, the second certificate file stored in the authorizing party cannot realize the authorization starting of the firmware, and at the moment, the authorizing party is required to regenerate one certificate file and conduct authorization verification according to the regenerated certificate file.
Based on another aspect of the present invention, there is provided a firmware boot system based on certificate authority, including:
a machine unique identification generation module: for generating a first machine unique identification;
certificate generation module: the method comprises the steps of encrypting a first machine unique identifier and customized information of an authorized party based on a private key to obtain a third certificate file;
certificate acquisition module: the method comprises the steps of reading a certificate file from a certificate storage space reserved on a flash memory, and receiving a second certificate file and a third certificate file sent by an authorized party;
certificate decryption module: for decrypting the first, second, and third certificate files based on the public key;
and a judging module: the judging module is used for judging whether the length of the first certificate file accords with the expectation or not, and judging whether the second machine unique identifier, the third machine unique identifier and the fourth machine unique identifier are identical to the first machine unique identifier or not.
In the technical scheme, the machine unique identifier generating module encrypts the code with unique property of the machine to generate the first machine unique identifier by adopting a hash algorithm, the first certificate file is acquired through the certificate acquiring module, if the first certificate file is not acquired or is verified to fail verification after being decrypted by the certificate decrypting module and verified by the judging module, the authorized party acquires the first machine unique identifier and then generates the third certificate file or invokes the second certificate file based on the certificate generating module, then the certificate acquiring module acquires the second certificate file or the third certificate file, finally the second certificate file and/or the third certificate file is decrypted through the certificate decrypting module, the judging module verifies the decrypted content, and the verification of the successful firmware is started normally.
Further, the judging module is further configured to perform the following judgment:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
it is determined whether the first firmware version number is identical to the firmware version number in S302.
The judgment is realized through the judgment module, and the verification condition of the certificate file is increased, so that the verification security of the certificate file is enhanced. The judging module is also used for completing other judging processes in the invention.
Compared with the prior art, the invention has the beneficial effects that:
(1) The firmware starting method based on certificate authorization provided by the invention stores the certificate file into the flash memory (flash memory) after the authorization is successful, and reads the certificate file in the flash memory again each time to judge whether the authorization is successful or not, does not need to rely on a TCM security card and a security module on hardware, and is suitable for a main board without a security chip. In addition, the scheme provided by the invention adopts the private key and the public key to encrypt and decrypt the certificate file respectively, and only the public key is released when the firmware is released, so that even if the public key of the imported firmware is cracked by a user through reading the memory, the user cannot generate the private key to autonomously authorize and crack the firmware, and the security of firmware authorization is greatly improved.
(2) The firmware starting method based on certificate authority provided by the invention does not depend on the bottom layer design and the support of a safety module, is widely applicable to various firmware starting scenes, and occupies no more space.
(3) The firmware starting method based on certificate authority provided by the invention uses the asymmetric encryption algorithm to obtain the public key and the private key, the public key and the private key are stored and separated, and the absolute safety of the private key under the condition of binary publication of the firmware is ensured. And each time the certificate re-reading verification is started, the user is prevented from bypassing the authorization process by driving the modified flash memory.
(4) The firmware starting method based on certificate authority provided by the invention has the possibility of autonomous authority of the server, and is convenient for reducing the workload of developers. Different machines can be started by using the same firmware, the unique identification of the machine is sent to the server after the unauthorized or expired authorization is found, the server generates a new certificate to return after acquiring the unique identification, and batch authorization and management can be realized based on the idea without independently customizing the firmware for the machine by a developer.
(5) The invention provides a firmware starting system based on certificate authority, wherein a machine unique identifier generating module encrypts a code with unique property of a machine to generate a first machine unique identifier by adopting a hash algorithm, a first certificate file is acquired by a certificate acquiring module, if the first certificate file is not acquired or is verified to fail after being decrypted by a certificate decrypting module and verified by a judging module, an authority acquires the first machine unique identifier and then generates a third certificate file or invokes a second certificate file based on the certificate generating module, then the certificate acquiring module acquires the second certificate file or the third certificate file, finally the second certificate file and/or the third certificate file are decrypted by the certificate decrypting module, the content obtained by decryption is verified by the judging module, and the firmware is normally started after verification is successful.
Drawings
FIG. 1 is a flowchart of a firmware boot method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a firmware boot system according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made in detail and with reference to the accompanying drawings, wherein it is apparent that the embodiments described are only some, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
As shown in fig. 1, the present embodiment provides a firmware starting method based on certificate authority, which includes the following steps:
based on an RSA algorithm module in a system tool Openssl, a public key and a private key are obtained, the public key is imported into firmware, the private key is reserved in local management software of an authorized party, and the local management software of the authorized party also stores a generated certificate file;
reserving a space for storing certificates in a flash memory;
compiling the firmware and delivering the compiled firmware to the firmware user.
Public keys and private keys are generated simultaneously by using an RSA algorithm, and only the public keys are published during publishing. Because the RSA algorithm belongs to an asymmetric encryption algorithm, the public key can be deduced by the private key, and the private key cannot be deduced by the public key. Therefore, even if the public key of the imported firmware is cracked by a user through the read memory, the user cannot generate the private key to autonomously authorize and crack the firmware, so that the security of firmware authorization is greatly improved.
S1: the method comprises the steps of running firmware on a machine, acquiring codes with unique properties in the machine, and generating a first machine unique identification by using the codes with the unique properties.
The unique code in the machine is a code which is used for distinguishing the machine from other machines, the code has uniqueness, one machine can only correspond to one code, and one code can only correspond to one machine, such as wwm of common hard disks, which are called global unique numbers, and each hard disk is burnt when being produced and cannot be repeated with other hard disks. The machine unique identification is generated using coded encryption with unique properties such that each machine has its own unique identification for encryption.
Specifically, the codes with unique properties of the machine in this embodiment include a CPU number, a global unique number of a hard disk, or a MAC address of a network card.
As a preferred implementation, the hash algorithm is used in this embodiment to encrypt the code with unique properties of the machine to generate the first machine unique identifier.
S2: reading a reserved certificate storage space on the flash memory, judging whether a first certificate file is stored in the certificate storage space, and if yes, entering a step S3; if not, the process proceeds to step S4.
S3: judging whether the length of the first certificate file accords with the expectation or not, if not, entering a step S4, if yes, decrypting the first certificate file based on a public key stored in firmware to obtain a second unique machine identifier, judging whether the second unique machine identifier is identical with the first unique machine identifier or not, if yes, normally starting the firmware, and if not, entering the step S4;
in a preferred embodiment, in step S3, if the determination result obtained by determining whether the second unique machine identifier is the same as the first unique machine identifier is yes, the following steps are further performed:
s301: decrypting the first certificate file to obtain a first certificate issue time, a first certificate validity period, a first vendor number and a first firmware version number;
s302: acquiring the current time, reading a firmware version number and reading a manufacturer number; in this embodiment, the current time is obtained from the machine clock, the firmware version number is read from the flash memory, and the manufacturer number is read from the CPLD;
s303: calculating to obtain a first certificate expiration time point based on the first certificate issuing time and the first certificate finite period limit;
s304: the following three determinations were made:
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
judging whether the first firmware version number is consistent with the firmware version number in S302;
if the judging results of the three judging processes are all yes, starting the firmware, otherwise, entering step S4.
S4: transmitting the first machine unique identifier to the authorizing party, and performing the following steps:
s401: judging whether the authorized party generates a certificate file aiming at the received unique identification of the first machine, if so, sending the certificate file to a firmware user as a second certificate file, and entering step S5: if not, go to step S402;
s402: and (3) encrypting the unique identification of the first machine and the customized information of the authorized party based on the private key to obtain a third certificate file, returning the second certificate file to the firmware user, entering step S6, and storing the newly generated third certificate file in the local management software of the authorized party.
Specifically, the authorization party customization information at least comprises certificate issuing time, certificate validity period, manufacturer number and firmware version number.
S5: and decrypting the second certificate file based on the public key stored in the firmware to obtain a third machine unique identifier, judging whether the third machine unique identifier is the same as the first machine unique identifier, if so, starting the firmware, and if not, entering step S402.
In a preferred embodiment, in step S5, if the determination result of determining whether the third unique machine identifier is the same as the first unique machine identifier is yes, the following steps are further performed:
s501, decrypting a second certificate file to obtain a second certificate issue time, a second certificate validity period, a second manufacturer number and a second firmware version number;
s502: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s503: calculating a second certificate expiration time point based on the second certificate issuing time and the second certificate finite limit;
s503: the following three determinations were made:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
if the judgment results of the three judgment processes are yes, the firmware is started, otherwise, the step S402 is entered.
S6: and decrypting the third certificate file based on the public key stored in the firmware to obtain a fourth machine unique identifier, judging whether the fourth machine unique identifier is identical to the first machine unique identifier, and if so, starting the firmware.
In a preferred embodiment, in step S6, if the determination result of determining whether the fourth unique machine identifier is the same as the first unique machine identifier is yes, the following steps are further performed:
s601, decrypting the third certificate file to obtain a third certificate issue time, a third certificate validity period, a third manufacturer number and a third firmware version number;
s602: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s603: calculating a third certificate expiration time point based on the third certificate issuing time and the third certificate finite limit;
s603: the following three determinations were made:
judging whether the third manufacturer number is consistent with the manufacturer number in the S602;
judging whether the third firmware version number is consistent with the firmware version number in S602;
judging whether the current time in S602 is less than a third certificate expiration time point;
if the judging results of the three judging processes are all yes, starting the firmware.
Further, in the step S5, if the third machine unique identifier is the same as the first machine unique identifier, the second certificate file is stored in a reserved certificate storage space on the flash memory, and if the first certificate file is stored in the certificate storage space, the first certificate file is deleted; in the step S6, if the unique identifier of the fourth machine is the same as the unique identifier of the first machine, the third certificate file is stored in the reserved certificate holding space on the flash memory, and if the first certificate file is stored in the certificate holding space, the first certificate file is deleted.
As a preferred embodiment, when the second machine unique identifier, the third machine unique identifier or the fourth machine unique identifier is different from the first unique identifier, the number of times of certificate decryption is recorded, and when the number of times of certificate decryption exceeds a threshold value, the firmware is directly suspended, and the user is prohibited from reintroducing the certificate.
Compared with an authorization and authentication method of embedded software, and an electronic device and a process which use an AES encryption algorithm, an authorization seed published by the embedded software is used for encryption and decryption at the same time, and the RSA algorithm used by the invention simultaneously generates a public key and a private key, and only publishes the public key during publishing. Because the RSA algorithm belongs to an asymmetric encryption algorithm, the public key can be deduced by the private key, and the private key cannot be deduced by the public key. Therefore, even if the public key of the imported firmware is cracked by a user through the read memory, the user cannot generate the private key to autonomously authorize and crack the firmware, so that the security of firmware authorization is greatly improved.
Different from the firmware starting method and process based on PIN code authorization, the method does not select to set in the flash memory after the authorization is successful, but rather stores the certificate file in the flash memory, and re-reads each time to judge whether the authorization is successful. Because the invention does not rely on the TCM security card and the security module on the hardware like the firmware starting method based on PIN code authorization and the process, there is a risk that a user skips the subsequent authorization authentication by directly modifying the flag bit in the flash memory, so that a certificate file needs to be saved, whether the authorization is successful or not is determined again each time, and the expiration time of the certificate can be better judged by the mode.
The embodiment also provides a firmware starting system based on certificate authority, which is used for implementing the steps of the firmware starting method based on certificate authority, and the method comprises the following steps:
a machine unique identification generation module: for generating a first machine unique identification;
certificate generation module: the method comprises the steps of encrypting a first machine unique identifier and customized information of an authorized party based on a private key to obtain a third certificate file;
certificate acquisition module: the method comprises the steps of reading a certificate file from a certificate storage space reserved on a flash memory, and receiving a second certificate file and a third certificate file sent by an authorized party;
certificate decryption module: for decrypting the first, second, and third certificate files based on the public key;
and a judging module: the judging module is used for judging whether the length of the first certificate file accords with the expectation or not, and judging whether the second machine unique identifier, the third machine unique identifier and the fourth machine unique identifier are identical to the first machine unique identifier or not.
Further, the judging module is further configured to perform the following judgment:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
it is determined whether the first firmware version number is identical to the firmware version number in S302.
The judging module is also used for completing other judging processes in the steps of a firmware starting method based on certificate authority.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced with equivalents; these modifications or substitutions do not depart from the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims (10)

1. A firmware boot method based on certificate authority, comprising the steps of:
s1: running firmware on a machine, acquiring a code with unique property in the machine, and encrypting the code with unique property to generate a first machine unique identifier;
s2: reading a reserved certificate storage space on the flash memory, judging whether a first certificate file is stored in the certificate storage space, and if yes, entering a step S3; if not, entering step S4;
s3: judging whether the length of the first certificate file accords with the expectation or not, if not, entering a step S4, if yes, decrypting the first certificate file based on a public key stored in firmware to obtain a second unique machine identifier, judging whether the second unique machine identifier is identical with the first unique machine identifier or not, if yes, normally starting the firmware, and if not, entering the step S4;
s4: transmitting the first machine unique identifier to the authorizing party, and performing the following steps:
s401: judging whether the authorized party generates a certificate file aiming at the received unique identification of the first machine, if so, sending the certificate file to a firmware user as a second certificate file, and entering step S5: if not, go to step S402;
s402: encrypting the unique identification of the first machine and customized information of the authorized party based on the private key to obtain a third certificate file, returning the third certificate file to the firmware user, and entering step S6;
s5: decrypting the second certificate file based on the public key stored in the firmware to obtain a third machine unique identifier, judging whether the third machine unique identifier is the same as the first machine unique identifier, if so, starting the firmware, and if not, entering step S402;
s6: and decrypting the third certificate file based on the public key stored in the firmware to obtain a fourth machine unique identifier, judging whether the fourth machine unique identifier is identical to the first machine unique identifier, and if so, starting the firmware.
2. The method for starting firmware based on certificate authority according to claim 1, further comprising the following steps before said step S1:
acquiring a public key and a private key based on an RSA algorithm module in a system tool Openssl, importing the public key into firmware, and retaining the private key in local management software of an authorized party;
reserving a space for storing certificates in a flash memory;
compiling the firmware and delivering the compiled firmware to the firmware user.
3. The method of claim 1, wherein the unique code comprises a CPU number, a global unique hard disk number, or a network card MAC address.
4. A method for starting firmware based on certificate authorities according to claim 1, characterised in that in said step S1 the code with unique properties is encrypted with a hash algorithm.
5. The firmware start-up method based on certificate authority as set forth in claim 1, wherein in the step S5, if the third machine unique identifier is the same as the first machine unique identifier, the second certificate file is stored in a certificate storage space reserved on the flash memory, and if the first certificate file is stored in the certificate storage space, the first certificate file is deleted; in the step S6, if the unique identifier of the fourth machine is the same as the unique identifier of the first machine, the third certificate file is stored in the reserved certificate holding space on the flash memory, and if the first certificate file is stored in the certificate holding space, the first certificate file is deleted.
6. The method according to claim 1, wherein in the step S402, the authorizer customized information includes at least a certificate issue time, a certificate validity period, a vendor number, and a firmware version number.
7. The method for starting firmware based on certificate authority as set forth in claim 6, wherein in the step S3, if the determination result is yes, the method further comprises the steps of:
s301: decrypting the first certificate file to obtain a first certificate issue time, a first certificate validity period, a first vendor number and a first firmware version number;
s302: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s303: calculating to obtain a first certificate expiration time point based on the first certificate issuing time and the first certificate finite period limit;
s304: the following three determinations were made:
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
judging whether the first firmware version number is consistent with the firmware version number in S302;
if the judging results of the three judging processes are all yes, starting the firmware, otherwise, entering step S4.
8. The method for starting firmware based on certificate authority as set forth in claim 6, wherein in the step S5, if the determination result is yes, the method further comprises the steps of:
s501, decrypting a second certificate file to obtain a second certificate issue time, a second certificate validity period, a second manufacturer number and a second firmware version number;
s502: acquiring the current time, reading a firmware version number and reading a manufacturer number;
s503: calculating a second certificate expiration time point based on the second certificate issuing time and the second certificate finite limit;
s503: the following three determinations were made:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
if the judgment results of the three judgment processes are yes, the firmware is started, otherwise, the step S402 is entered.
9. A certificate authority-based firmware boot system for implementing the steps of a certificate authority-based firmware boot method as claimed in any one of claims 1 to 8, comprising:
a machine unique identification generation module: for generating a first machine unique identification;
certificate generation module: the method comprises the steps of encrypting a first machine unique identifier and customized information of an authorized party based on a private key to obtain a third certificate file;
certificate acquisition module: the method comprises the steps of reading a certificate file from a certificate storage space reserved on a flash memory, and receiving a second certificate file and a third certificate file sent by an authorized party;
certificate decryption module: for decrypting the first, second, and third certificate files based on the public key;
and a judging module: the judging module is used for judging whether the length of the first certificate file accords with the expectation or not, and judging whether the second machine unique identifier, the third machine unique identifier and the fourth machine unique identifier are identical to the first machine unique identifier or not.
10. The firmware boot-up system based on certificate authorities as claimed in claim 9, wherein the judgment module is further adapted to perform the following judgment:
judging whether the second manufacturer number is consistent with the manufacturer number in S502;
judging whether the second firmware version number is consistent with the firmware version number in S502;
judging whether the current time in S502 is less than a second certificate expiration time point;
judging whether the current time in S302 is smaller than a first certificate expiration time point or not;
judging whether the first manufacturer number is consistent with the manufacturer number in the S302;
it is determined whether the first firmware version number is identical to the firmware version number in S302.
CN202310393590.8A 2023-04-13 2023-04-13 Firmware starting method and system based on certificate authorization Pending CN116611034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310393590.8A CN116611034A (en) 2023-04-13 2023-04-13 Firmware starting method and system based on certificate authorization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310393590.8A CN116611034A (en) 2023-04-13 2023-04-13 Firmware starting method and system based on certificate authorization

Publications (1)

Publication Number Publication Date
CN116611034A true CN116611034A (en) 2023-08-18

Family

ID=87675396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310393590.8A Pending CN116611034A (en) 2023-04-13 2023-04-13 Firmware starting method and system based on certificate authorization

Country Status (1)

Country Link
CN (1) CN116611034A (en)

Similar Documents

Publication Publication Date Title
US7546468B2 (en) Program update method and server
CN111723383B (en) Data storage and verification method and device
CN110688660B (en) Method and device for safely starting terminal and storage medium
CN106571951B (en) Audit log obtaining method, system and device
US20110126023A1 (en) Systems And Methods For Data Security
US20080069338A1 (en) Methods and systems for verifying a location factor associated with a token
US7693286B2 (en) Method of delivering direct proof private keys in signed groups to devices using a distribution CD
CN113434853B (en) Method for burning firmware to storage device and controller
US9515827B2 (en) Key management device, communication device, communication system, and computer program product
US20080104402A1 (en) Countermeasure against fault-based attack on RSA signature verification
CN113722720B (en) System starting method and related device
CN110334531B (en) Virtual machine key management method, master node, system, storage medium and device
CN112148314A (en) Mirror image verification method, device, equipment and storage medium of embedded system
WO2009147817A1 (en) Authentication system, information processing apparatus, storage apparatus, authentication method and program
CN108363912B (en) Program code secret protection method and device
JP2006268513A (en) Log-on management device for terminal device
KR101711024B1 (en) Method for accessing temper-proof device and apparatus enabling of the method
CN115766192A (en) UKEY-based offline security authentication method, device, equipment and medium
JP5049179B2 (en) Information processing terminal device and application program activation authentication method
CN116611034A (en) Firmware starting method and system based on certificate authorization
CN110659522B (en) Storage medium security authentication method and device, computer equipment and storage medium
CN113343215A (en) Embedded software authorization and authentication method and electronic equipment
CN113761538A (en) Security boot file configuration method, boot method, device, equipment and medium
US10318766B2 (en) Method for the secured recording of data, corresponding device and program
KR100897075B1 (en) Method of delivering direct proof private keys in signed groups to devices using a distribution cd

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination