Controller program security verification method and device, vehicle and vehicle controller

By obtaining the verification type and target verification files, reading the verification jump information and performing encrypted content verification, the problem of malicious tampering by the automotive controller software is solved, and the information security requirements of the controller software in the startup and upgrade stages is realized. , high resource efficiency.

CN119128866APending Publication Date: 2024-12-13DEEPAL AUTOMOBILE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411122266.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing technology cannot effectively prevent malicious tampering of automotive controller software and cannot meet the needs of vehicle information security.

Method used

By obtaining the verification type and target verification files, reading the verification jump information, obtaining security verification information based on the verification type and verification jump information, and using data block information and signature data to verify the encrypted content, realizing the Safety verification of controller programs.

Benefits of technology

Effectively support the information security needs of the controller software during the startup stage and the software upgrade stage, ensure the legitimacy and integrity of the controller software, and the resource requirements are small, so the controller does not require the controller to have a file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128866A_ABST
    Figure CN119128866A_ABST
Patent Text Reader

Abstract

The invention provides a controller program safety verification method and device, a vehicle and a vehicle controller, and the method comprises the steps: obtaining a verification type and a target verification file, reading verification jump information of the target verification file, obtaining safety verification information corresponding to the verification type based on the verification type and the verification jump information, and verifying the safety verification information according to the verification type. The security verification information comprises starting verification information and upgrading verification information, obtaining corresponding encrypted content of the security verification information in the original program file according to data block information in the security verification information, and verifying the encrypted content based on signature data in the security verification information to obtain a security verification result of the target verification file, by means of the method, the technical problem of safety verification on malicious tampering of the controller program is solved, and the safety of the controller in the starting stage and the upgrading stage is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of automobile controller safety verification, and in particular to a controller program safety verification method, device, vehicle and vehicle controller. Background Art

[0002] As cars become more intelligent and connected, people have more control over their cars, bringing various conveniences to life. However, the resulting security risks such as remote attacks, information leakage and even manipulation of connected vehicles are becoming increasingly prominent.

[0003] Modern vehicles have many access points to the outside world, such as OTA, Bluetooth, and WIFI. Hackers can maliciously modify the controller software through these access points to remotely control the vehicle. In order to prevent the control software from being maliciously tampered with, the controller needs to have anti-tampering capabilities. Only by achieving information security for each controller can the information security requirements of the entire vehicle be met.

[0004] Patent document CN108664805B describes an application security verification method and system. This method performs security verification based on the privacy permissions of the application and whether it is authorized. It cannot verify external malicious tampering and cannot meet the information security requirements of the entire vehicle. Summary of the invention

[0005] In view of the shortcomings of the related technologies mentioned above, the present application provides a controller program security verification method, device, vehicle and vehicle controller to solve the technical problem of performing security verification on malicious tampering of the controller program.

[0006] The present application provides a controller program security verification method, which includes: obtaining a verification type and a target verification file, the target verification file including verification jump information, security verification information and an original program file, the verification type including startup verification and upgrade verification; reading the verification jump information of the target verification file, the verification jump information including a startup verification information address and an upgrade verification information address; obtaining security verification information corresponding to the verification type based on the verification type and the verification jump information, the security verification information including startup verification information and upgrade verification information; obtaining encrypted content corresponding to the security verification information in the original program file according to data block information in the security verification information, and verifying the encrypted content based on the signature data in the security verification information to obtain a security verification result of the target verification file.

[0007] In one embodiment of the present application, the security verification information corresponding to the verification type is obtained based on the verification type and the verification jump information, including: if the verification type is the startup verification, then jumping based on the startup verification information address to obtain the startup verification information, and the startup verification information includes startup header information, startup data block information and startup signature data; if the verification type is the upgrade verification, then jumping based on the upgrade verification information address to obtain the upgrade verification information, and the upgrade verification information includes upgrade header information, upgrade data block information and startup signature data.

[0008] In one embodiment of the present application, obtaining the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information includes: obtaining the data block lengths and data block starting addresses of multiple encrypted data blocks corresponding to the encrypted content according to the data block information; and obtaining the encrypted content in the original program file based on the multiple encrypted data blocks.

[0009] In one embodiment of the present application, the encrypted content is verified based on the signature data in the security verification information to obtain the security verification result of the target verification file, including: obtaining the encryption type of the security verification information based on the header information of the security verification information; if the encryption type is the first encryption type, calculating the integrity measurement value of the encrypted content to obtain the second measurement value, and encrypting the second measurement value based on a preset private key to obtain encrypted data; comparing the encrypted data with the signature data, if the comparison is consistent, the security verification result is verification passed, if the comparison is inconsistent, the security verification result is verification failed.

[0010] In one embodiment of the present application, verifying the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file also includes: obtaining the encryption type of the security verification information based on the header information of the security verification information; if the encryption type is the second encryption type, calculating the integrity measurement value of the encrypted content to obtain the second measurement value, and decrypting the signature data based on a preset public key to obtain the first measurement value; comparing the second measurement value with the first measurement value, if the comparison is consistent, the security verification result is a passed verification, if the comparison is inconsistent, the security verification result is a failed verification.

[0011] In one embodiment of the present application, after obtaining the security verification result of the target verification file, it also includes: if the verification type is a startup verification and the security verification result is a verification failure, obtaining the upgrade verification information based on the verification jump information; obtaining the encrypted content corresponding to the upgrade verification information in the original program file according to the upgrade data block information in the upgrade verification information, and performing a secondary verification on the encrypted content based on the upgrade signature data in the upgrade verification information to obtain a secondary verification result of the target verification file.

[0012] In one embodiment of the present application, the encrypted content corresponding to the security verification information is obtained based on the original program file, the entire content of the original program file is used as the encrypted content corresponding to the upgrade verification information, and the target content in the original program file is used as the encrypted content corresponding to the startup verification information, and the target content is selected from the original program file based on a preset selection ratio; the encrypted content corresponding to the security verification information is calculated to obtain an integrity measurement value corresponding to the security verification information, and the integrity measurement value corresponding to the security verification information is encrypted based on a preset encryption type to obtain signature data corresponding to the security verification information; the preset encryption type of the security verification information is stored in the header information of the security verification information, and the encrypted data block information corresponding to the encrypted content is stored in the data block information of the security verification information, and the encrypted data block information includes data block lengths and data block start addresses corresponding to multiple encrypted data blocks.

[0013] An embodiment of the present application also provides a controller program security verification device, which includes: a file reading module, used to obtain a verification type and a target verification file, the target verification file includes verification jump information, security verification information and an original program file, and the verification type includes startup verification and upgrade verification; an address reading module, used to read the verification jump information of the target verification file, the verification jump information includes a startup verification information address and an upgrade verification information address; an address jump module, used to obtain security verification information corresponding to the verification type based on the verification type and the verification jump information, the security verification information includes startup verification information and upgrade verification information; a security verification module, used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

[0014] An embodiment of the present application also provides a vehicle, which is applied to any of the controller program security verification methods described in the above embodiments, and the vehicle includes a controller program security verification device; the controller program security verification device includes a file reading module, an address reading module, an address jump module and a security verification module; the file reading module is used to obtain a verification type and a target verification file, the target verification file includes verification jump information, security verification information and an original program file, and the verification type includes startup verification and upgrade verification; the address reading module is used to read the verification jump information of the target verification file, the verification jump information includes a startup verification information address and an upgrade verification information address; the address jump module is used to obtain the security verification information corresponding to the verification type based on the verification type and the verification jump information, and the security verification information includes startup verification information and upgrade verification information; the security verification module is used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

[0015] An embodiment of the present application also provides a vehicle controller, in which a controller program security verification method as described in any of the above embodiments can be executed.

[0016] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the controller program security verification method as described in any of the above embodiments.

[0017] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes a controller program security verification method as described in any of the above embodiments.

[0018] Beneficial effects of the present application: The embodiments of the present application provide a controller program security verification method, device, vehicle and vehicle controller. The method obtains a verification type and a target verification file, reads the verification jump information of the target verification file, obtains security verification information corresponding to the verification type based on the verification type and the verification jump information, and the security verification information includes startup verification information and upgrade verification information. The encrypted content corresponding to the security verification information in the original program file is obtained according to the data block information in the security verification information, and the encrypted content is verified based on the signature data in the security verification information to obtain the security verification result of the target verification file, thereby realizing security verification of the controller software, and can effectively support the information security requirements of the controller software in the startup stage, FBL and OTA stage. In addition, the method in the present application does not require the controller to have a file system, and has small requirements for the controller Flash and Ram resources.

[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a schematic diagram of the relationship between the verification jump information and the security verification information shown in an exemplary embodiment of the present application;

[0021] Figure 2 is a flow chart of a controller program security verification method shown in an exemplary embodiment of the present application;

[0022] Figure 3 is a schematic diagram of generating security verification information shown in an exemplary embodiment of the present application;

[0023] Figure 4 is a schematic diagram of security verification of the first encryption type shown in an exemplary embodiment of the present application;

[0024] Figure 5 is a schematic diagram of security verification of a second encryption type shown in an exemplary embodiment of the present application;

[0025] Figure 6 is a safety verification flow chart shown in an exemplary embodiment of the present application;

[0026] Figure 7 is a secondary verification flow chart shown in an exemplary embodiment of the present application;

[0027] Figure 8 is a block diagram of a controller program security verification device shown in an exemplary embodiment of the present application;

[0028] Fig. 9 It is a structural schematic diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0029] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0030] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0031] It should be noted that in this application, "first", "second", etc. are only used to distinguish similar objects, and are not used to limit the order or precedence of similar objects. The variations of "including", "having", etc. described above indicate that the scope covered by the subject of the word is not exclusive except for the examples shown by the word.

[0032] It is understood that the various numbers, step numbers, and other reference numerals recorded in this application are distinguished for the convenience of description and are not intended to limit the scope of this application. The size of the reference numerals in this application does not mean the order of execution. The execution order of each process should be determined by its function and internal logic.

[0033] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0034] The embodiments of the present application respectively propose a controller program security verification method, a controller program security verification device, an electronic device, a computer-readable storage medium and a computer program product, and these embodiments will be described in detail below.

[0035] It should be noted that the method of this application does not require the controller to have a file system, and has low requirements for controller Flash and Ram resources. This application can implement the legitimacy and integrity verification of the controller software, including program file verification at startup and software upgrade, which can effectively support the information security requirements of the controller software at the startup stage, FBL and OTA stage.

[0036] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram showing the relationship between the check jump information and the security check information in an exemplary embodiment of the present application. Figure 1 As shown, the check jump information is stored in the front position of the controller's Flash space, and the check jump information includes the check information version, the startup check information address and the upgrade check information address, wherein the startup check information address points to the starting address of the startup check information, and the upgrade information address points to the starting address of the upgrade check information.

[0037] In one embodiment of the present application, in an automotive embedded controller, the program is stored in the controller's Flash in binary form, and security verification information, as part of the program, is also stored in the Flash. The storage format of the security verification information determines the way the security verification information is read.

[0038] In one embodiment of the present application, the security verification information needs some additional information to be combined with the program file. The verification jump information includes the verification version information of the verification information, which is used for version identification and later expansion. The startup verification information address points to the storage location of the startup verification information, and the upgrade verification information address points to the storage location of the upgrade verification information. The verification jump information is stored in a fixed position at the front of the program, and the storage location of the verification jump information depends on the specific processor platform.

[0039] In one embodiment of the present application, when generating a target verification file, the calculated verification jump information, startup verification information, upgrade verification information, and original program file are merged into a new program file as a target verification file. The target verification file carries security verification information, and when the program is flashed, the controller program and the security verification information are flashed into the controller's Flash together.

[0040] In one embodiment of the present application, a security check is required for the program file each time the controller is started. The controller first reads the security check jump information, verifies the legitimacy of the version of the check information, the legitimacy of the address range of the startup check information and the upgrade check information, and after the verification is passed, reads the startup security check information.

[0041] See also Figure 2 , Figure 2is a flowchart of a controller program security verification method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is as follows. The method may also be applicable to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.

[0042] like Figure 2 As shown, in an exemplary embodiment, the controller program security verification method includes at least steps S210 to S240, which are described in detail as follows:

[0043] Step S210, obtaining the verification type and the target verification file, the target verification file includes verification jump information, security verification information and the original program file, and the verification type includes startup verification and upgrade verification.

[0044] In one embodiment of the present application, the verification type includes startup verification and upgrade verification. When the controller is in the startup phase, the verification type for verifying the program is startup verification, and when the controller is in the upgrade and update phase, the verification type for verifying the program is upgrade verification.

[0045] In one embodiment of the present application, the security verification information in the target verification file includes at least startup verification information and upgrade verification information. Because when the program is large, it takes more time to perform a full package verification on the program, so that the controller cannot meet the startup time requirement. Therefore, when the verification type is a startup verification, the startup verification information in the target verification file is verified to perform a startup verification. The verification content in the startup verification information is part of the content in the original program file, and the verification content in the upgrade verification information is all the content in the original program file.

[0046] In one embodiment of the present application, before obtaining the verification type and the target verification file, it also includes: obtaining encrypted content corresponding to the security verification information based on the original program file, using the entire content of the original program file as the encrypted content corresponding to the upgrade verification information, and using the target content in the original program file as the encrypted content corresponding to the startup verification information, and the target content is selected from the original program file based on a preset selection ratio; calculating the encrypted content corresponding to the security verification information to obtain an integrity measurement value corresponding to the security verification information, and encrypting the integrity measurement value corresponding to the security verification information based on a preset encryption type to obtain signature data corresponding to the security verification information; storing the preset encryption type of the security verification information in the header information of the security verification information, and storing the encrypted data block information corresponding to the encrypted content in the data block information of the security verification information, the encrypted data block information including data block lengths and data block starting addresses corresponding to multiple encrypted data blocks.

[0047] In one embodiment of the present application, the encryption type selected when encrypting the encrypted content of the original program file may be a first encryption type or a second encryption type, wherein the first encryption type may be symmetric encryption and the second encryption type may be asymmetric encryption, and the encryption types used for the startup verification information and the upgrade verification information may be the same type or different types.

[0048] See also Figure 3 , Figure 3 is a schematic diagram of generating security verification information shown in an exemplary embodiment of the present application, such as Figure 3 As shown, encrypted content is extracted from the original program file, the entire content of the original program file is used as the encrypted content of the upgrade verification information, and a portion of the content is randomly selected from the original program file as the encrypted content of the startup verification information. In this embodiment, the selected portion is greater than or equal to 70% of the entire content of the original program file. An integrity measurement value is calculated for the selected encrypted content to obtain a corresponding integrity measurement value, and then the integrity measurement value is encrypted based on a preset private key to obtain a ciphertext part, the ciphertext part includes startup security verification information and upgrade security verification information, and the ciphertext part is added to the original program file to obtain a target verification file carrying security verification information.

[0049] In one embodiment of the present application, the format of the program file compiled and generated during the generation of security verification information can be S19, Hex, or Bin. The encrypted content of the original program file is first calculated using a Hash algorithm to obtain an integrity measurement value of the encrypted content. The integrity measurement value is used to verify the integrity of the encrypted content. The Hash algorithm used here includes but is not limited to SHA256, SHA1, and MD5. Since the startup phase has particularity for security verification, when the integrity measurement value is actually calculated, the encrypted content can be selected according to a predetermined sampling rule and then the Hash calculation can be performed to obtain the integrity measurement value used in the startup phase. After obtaining the integrity measurement value, the integrity measurement value is encrypted using a secret key, and the obtained ciphertext is used to verify the legitimacy of the program. The algorithm used for encryption can be a symmetric algorithm or an asymmetric algorithm, including but not limited to RSA2048 and AES128. Generally, when generating security verification information for a program, two sets of security verification information need to be generated, one for the startup phase and the other for the upgrade phase. The upgrade phase here includes FBL upgrade and OTA upgrade.

[0050] In one embodiment of the present application, the hash algorithm includes but is not limited to SHA256, SHA1, and MD5. Then, the calculated integrity metric value is encrypted by a secret key to obtain a ciphertext, and the encryption type of the encryption algorithm here can be a symmetric algorithm or an asymmetric algorithm, including but not limited to RSA2048 and AES128. Finally, the obtained ciphertext and the original program file are combined to obtain a target verification file carrying security verification information.

[0051] Step S220, reading the verification jump information of the target verification file, the verification jump information includes a startup verification information address and an upgrade verification information address.

[0052] In one embodiment of the present application, the verification jump information is stored at a relatively front position in the target verification file for easy reading. The startup verification information storage is stored based on the startup verification information address, and the upgrade verification information is stored based on the upgrade verification information address. In this embodiment, the startup verification information address is the starting address where the startup verification information begins to be stored, and the upgrade verification information address is the starting address where the upgrade verification information begins to be stored.

[0053] In one embodiment of the present application, the verification jump information also includes version verification information, and the version verification information is used to indicate the version of the current security verification information for subsequent extended use. The program may perform different processing methods according to different versions.

[0054] In one embodiment of the present application, the security verification information includes header information, data block information and signature information, wherein the header information is used to provide the Hash algorithm used by the security verification information, the encryption type, the number of data blocks of the encrypted content corresponding to the security verification information, and the length of the signature data, the entry address of the corresponding program. In order to verify the integrity of the header information, the header information also has a CRC16 checksum. The header information is shown in Table 1:

[0055] Table 1

[0056]

[0057] As shown in Table 1, the header information includes encoding information MagicCode, version information Version, hash algorithm type HashType, encryption type signatureType, data block number BlockNum, S signature data length ignatureDataLen, and program entry address EntryAddr.

[0058] In one embodiment of the present application, the data block information stores the content of the original program file in which the security verification information participates in the verification, that is, the information of the encrypted content, including the data block starting address and data block length corresponding to the encrypted content. The data block information is combined with the number of data blocks in the header information to calculate the complete encrypted content. In order to verify the integrity of the data block information, the data block information also has a CRC16 check code. The data block information is shown in Table 2:

[0059] Table 2

[0060]

[0061] As shown in Table 2, the data block information includes the start addresses StartAddr and the data block lengths Length of multiple data blocks (Block0-BlockN).

[0062] In one embodiment of the present application, the signature data is the ciphertext part of the security verification information. A complete verification information is shown in Table 3:

[0063] Table 3

[0064]

[0065] As shown in Table 3, a complete security verification information includes header information head, data block information block Info and signature data DATA.

[0066] Step S230, obtaining security verification information corresponding to the verification type based on the verification type and the verification jump information, wherein the security verification information includes startup verification information and upgrade verification information.

[0067] In one embodiment of the present application, the check jump information also includes version check information. A version check is performed based on the version check information before the jump, and the jump is performed after the check passes.

[0068] In one embodiment of the present application, the security verification information corresponding to the verification type is obtained based on the verification type and the verification jump information, including: if the verification type is a startup verification, then a jump is performed based on the startup verification information address to obtain the startup verification information, and the startup verification information includes the startup header information, the startup data block information and the startup signature data; if the verification type is the upgrade verification, then a jump is performed based on the upgrade verification information address to obtain the upgrade verification information, and the upgrade verification information includes the upgrade header information, the upgrade data block information and the startup signature data.

[0069] In one embodiment of the present application, the structures of the startup verification information and the upgrade verification information are the same, both as shown in Table 3, but the contents stored therein are different based on the encryption method and the encrypted content.

[0070] Step S240, obtaining the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verifying the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

[0071] In one embodiment of the present application, obtaining encrypted content corresponding to the security verification information in the original program file based on the data block information in the security verification information includes: obtaining data block lengths and data block starting addresses of multiple encrypted data blocks corresponding to the encrypted content based on the data block information; and obtaining the encrypted content in the original program file based on the multiple encrypted data blocks.

[0072] In one embodiment of the present application, the header information also includes the number of data blocks of the encrypted content. Combined with the data block information, all data blocks of the encrypted content can be calculated, thereby obtaining the encrypted content in the original program file.

[0073] See also Figure 4 , Figure 4 It is a security verification schematic diagram of the first encryption type shown in an exemplary embodiment of the present application. If the encryption type is the first encryption type, the encrypted content is verified based on the signature data in the security verification information to obtain the security verification result of the target verification file, including: obtaining the encryption type of the security verification information based on the header information of the security verification information; if the encryption type is the first encryption type, calculating the integrity measurement value of the encrypted content to obtain the second measurement value, and encrypting the second measurement value based on a preset private key to obtain encrypted data; comparing the encrypted data with the signature data, if the comparison is consistent, the security verification result is verification passed, if the comparison is inconsistent, the security verification result is verification failed.

[0074] In one embodiment of the present application, the first encryption type may be a symmetric encryption algorithm, and the integrity metric value is first calculated for the encrypted content program using a hash algorithm, and then the integrity metric value is encrypted using an encryption algorithm to obtain ciphertext 2. Finally, the calculated ciphertext 2 is compared with the ciphertext 1 stored in the program, and if the two ciphertexts are the same, the verification passes, otherwise the program verification fails, and the controller starts the verification failure processing flow.

[0075] Figure 5 is a schematic diagram of security verification of a second encryption type shown in an exemplary embodiment of the present application;

[0076] In one embodiment of the present application, verifying the encrypted content based on the signature data in the security verification information to obtain a security verification result of the target verification file also includes: obtaining the encryption type of the security verification information based on the header information of the security verification information; if the encryption type is the second encryption type, calculating the integrity measurement value of the encrypted content to obtain the second measurement value, and decrypting the signature data based on a preset public key to obtain the first measurement value; comparing the second measurement value with the first measurement value, if the comparison is consistent, the security verification result is verification passed, if the comparison is inconsistent, the security verification result is verification failed.

[0077] In one embodiment of the present application, the second encryption type may be an asymmetric encryption algorithm, firstly the encrypted content is subjected to a hash algorithm to calculate the integrity metric 2, and then the ciphertext is decrypted using the public key to obtain the integrity metric 1. Finally, the integrity metric 2 is compared with the integrity metric 1, and if the two integrity metric values ​​are the same, the verification is passed, otherwise the program verification fails, and the controller will start the verification failure processing flow.

[0078] In one embodiment of the present application, after obtaining the security verification result of the target verification file, it also includes: if the verification type is a startup verification and the security verification result is a verification failure, then obtaining upgrade verification information based on the verification jump information; obtaining the encrypted content corresponding to the upgrade verification information in the original program file according to the upgrade data block information in the upgrade verification information, and performing a secondary verification on the encrypted content based on the upgrade signature data in the upgrade verification information to obtain a secondary verification result of the target verification file.

[0079] See also Figure 6 , Figure 6 This is a security verification flow chart shown in an exemplary embodiment of the present application, which includes reading security verification jump information, reading header information and data block information of the security verification information according to the verification jump information, calculating integrity measurement value 2 of the program encryption content based on the header information and data block information, reading signature data of the security verification information, and completing security verification by selecting a decryption step based on the encryption type. If the encryption type is symmetric encryption, the integrity measurement value 2 is encrypted, and then the encrypted data is compared with the signature data. If the comparison is consistent, the verification passes, and if the comparison is inconsistent, the verification fails. If the encryption type is asymmetric encryption, the signature data is decrypted to obtain integrity measurement value 1, and the integrity measurement value 1 is compared with the integrity measurement value 2. If the comparison is consistent, the verification passes, and if the comparison is inconsistent, the verification fails.

[0080] See also Figure 7 , Figure 7It is a secondary verification flow chart shown in an exemplary embodiment of the present application, and the process includes, after starting the security verification information, if the startup security verification fails, reading the upgraded security verification information, verifying the upgraded security verification information, if the upgraded security verification fails, the secondary verification fails, if the upgraded security verification succeeds, the secondary verification succeeds.

[0081] See also Figure 8 , Figure 8 FIG. 1 is a block diagram of a controller program security verification device shown in an exemplary embodiment of the present application. Figure 8 As shown, the exemplary controller program safety verification device includes:

[0082] A file reading module is used to obtain the verification type and target verification file. The target verification file includes verification jump information, security verification information and original program file. The verification type includes startup verification and upgrade verification.

[0083] An address reading module is used to read the verification jump information of the target verification file, where the verification jump information includes a startup verification information address and an upgrade verification information address;

[0084] An address jump module, used to obtain security verification information corresponding to the verification type based on the verification type and the verification jump information, the security verification information including startup verification information and upgrade verification information;

[0085] The security verification module is used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

[0086] An embodiment of the present application also provides a vehicle, which is applied to the controller program security verification method described in any of the above embodiments, and the vehicle includes a controller program security verification device; the controller program security verification device includes a file reading module, an address reading module, an address jump module and a security verification module; the file reading module is used to obtain the verification type and the target verification file, the target verification file includes verification jump information, security verification information and the original program file, and the verification type includes startup verification and upgrade verification; the address reading module is used to read the verification jump information of the target verification file, the verification jump information includes the startup verification information address and the upgrade verification information address; the address jump module is used to obtain the security verification information corresponding to the verification type based on the verification type and the verification jump information, and the security verification information includes startup verification information and upgrade verification information; the security verification module is used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

[0087] An embodiment of the present application also provides a vehicle controller, in which a controller program security verification method as described in any of the above embodiments can be executed.

[0088] Fig. 9 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig. 9 The computer system 900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0089] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903, such as executing the method described in the above embodiment. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, ROM 902 and RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0090] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.

[0091] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 909, and / or installed from a removable medium 911. When the computer program is executed by a central processing unit (CPU) 901, various functions defined in the system of the present application are executed.

[0092] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0093] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0095] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor of a computer, the computer executes the controller program security verification method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0096] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the controller program security verification method provided in each of the above embodiments.

[0097] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A controller program security verification method, It is characterized in that The controller program safety verification method comprises: Obtaining a verification type and a target verification file, wherein the target verification file includes verification jump information, security verification information, and an original program file, and the verification type includes startup verification and upgrade verification; Read the verification jump information of the target verification file, wherein the verification jump information includes a startup verification information address and an upgrade verification information address; Based on the verification type and the verification jump information, obtain security verification information corresponding to the verification type, wherein the security verification information includes startup verification information and upgrade verification information; The encrypted content corresponding to the security verification information in the original program file is obtained according to the data block information in the security verification information, and the encrypted content is verified based on the signature data in the security verification information to obtain the security verification result of the target verification file.

2. The controller program security verification method according to claim 1, It is characterized in that The security verification information corresponding to the verification type obtained based on the verification type and the verification jump information includes: If the verification type is the startup verification, jump based on the startup verification information address to obtain the startup verification information, where the startup verification information includes startup header information, startup data block information, and startup signature data; If the verification type is the upgrade verification, a jump is performed based on the upgrade verification information address to obtain the upgrade verification information, where the upgrade verification information includes upgrade header information, upgrade data block information and startup signature data.

3. The controller program security verification method according to claim 1, It is characterized in that The encrypted content corresponding to the security verification information in the original program file obtained according to the data block information in the security verification information includes: Obtaining data block lengths and data block start addresses of a plurality of encrypted data blocks corresponding to the encrypted content according to the data block information; The encrypted content is obtained in the original program file based on the multiple encrypted data blocks.

4. The controller program security verification method according to any one of claims 1 to 3, It is characterized in that Verifying the encrypted content based on the signature data in the security verification information to obtain a security verification result of the target verification file includes: Obtaining the encryption type of the security verification information based on the header information of the security verification information; If the encryption type is the first encryption type, calculating the integrity measurement value of the encrypted content to obtain a second measurement value, and encrypting the second measurement value based on a preset private key to obtain encrypted data; The encrypted data is compared with the signature data. If the comparison is consistent, the security verification result is a verification pass. If the comparison is inconsistent, the security verification result is a verification failure.

5. The controller program security verification method according to any one of claims 1 to 3, It is characterized in that Verifying the encrypted content based on the signature data in the security verification information to obtain a security verification result of the target verification file also includes: Obtaining the encryption type of the security verification information based on the header information of the security verification information; If the encryption type is the second encryption type, calculating the integrity metric value of the encrypted content to obtain the second metric value, and decrypting the signature data based on the preset public key to obtain the first metric value; The second metric value is compared with the first metric value. If the comparison is consistent, the security verification result is verification passed. If the comparison is inconsistent, the security verification result is verification failed.

6. The controller program security verification method according to any one of claims 1 to 3, It is characterized in that After obtaining the security verification result of the target verification file, the method further includes: If the verification type is a startup verification and the security verification result is a verification failure, obtaining the upgrade verification information based on the verification jump information; The encrypted content corresponding to the upgrade verification information in the original program file is obtained according to the upgrade data block information in the upgrade verification information, and the encrypted content is secondary verified based on the upgrade signature data in the upgrade verification information to obtain a secondary verification result of the target verification file.

7. The controller program security verification method according to any one of claims 1 to 3, It is characterized in that Before obtaining the verification type and target verification file, it also includes: Based on the original program file, the encrypted content corresponding to the security verification information is obtained, the entire content of the original program file is used as the encrypted content corresponding to the upgrade verification information, the target content in the original program file is used as the encrypted content corresponding to the startup verification information, and the target content is selected from the original program file based on a preset selection ratio; Calculating the encrypted content corresponding to the security verification information to obtain an integrity metric value corresponding to the security verification information, and encrypting the integrity metric value corresponding to the security verification information based on a preset encryption type to obtain signature data corresponding to the security verification information; The preset encryption type of the security verification information is stored in the header information of the security verification information, and the encrypted data block information corresponding to the encrypted content is stored in the data block information of the security verification information, wherein the encrypted data block information includes data block lengths and data block starting addresses corresponding to multiple encrypted data blocks.

8. A controller program safety verification device, It is characterized in that The controller program safety verification device comprises: A file reading module, used to obtain a verification type and a target verification file, wherein the target verification file includes verification jump information, security verification information and an original program file, and the verification type includes a startup verification and an upgrade verification; An address reading module, used for reading the verification jump information of the target verification file, wherein the verification jump information includes a startup verification information address and an upgrade verification information address; An address jump module, used to obtain security verification information corresponding to the verification type based on the verification type and the verification jump information, wherein the security verification information includes startup verification information and upgrade verification information; A security verification module is used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and to verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

9. A vehicle, It is characterized in that The vehicle is applied to the controller program safety verification method according to any one of claims 1 to 7, and the vehicle includes a controller program safety verification device; The controller program security verification device comprises a file reading module, an address reading module, an address jumping module and a security verification module; The file reading module is used to obtain the verification type and the target verification file, the target verification file includes the verification jump information, the security verification information and the original program file, and the verification type includes the startup verification and the upgrade verification; The address reading module is used to read the verification jump information of the target verification file, wherein the verification jump information includes a startup verification information address and an upgrade verification information address; The address jump module is used to obtain security verification information corresponding to the verification type based on the verification type and the verification jump information, wherein the security verification information includes startup verification information and upgrade verification information; The security verification module is used to obtain the encrypted content corresponding to the security verification information in the original program file according to the data block information in the security verification information, and verify the encrypted content based on the signature data in the security verification information to obtain the security verification result of the target verification file.

10. A vehicle controller, It is characterized in that The vehicle controller can execute the controller program safety verification method as described in any one of claims 1 to 7.