WO2023232045A1 - Vehicle verification method, and related apparatus and system - Google Patents

Vehicle verification method, and related apparatus and system Download PDF

Info

Publication number
WO2023232045A1
WO2023232045A1 PCT/CN2023/097264 CN2023097264W WO2023232045A1 WO 2023232045 A1 WO2023232045 A1 WO 2023232045A1 CN 2023097264 W CN2023097264 W CN 2023097264W WO 2023232045 A1 WO2023232045 A1 WO 2023232045A1
Authority
WO
WIPO (PCT)
Prior art keywords
vehicle
upgrade
signature
server
public key
Prior art date
Application number
PCT/CN2023/097264
Other languages
French (fr)
Chinese (zh)
Inventor
侯林
付天福
余舟毅
陈勇
杜小强
张作强
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023232045A1 publication Critical patent/WO2023232045A1/en

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/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
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • This application relates to the field of Internet of Vehicles and communication technologies, and in particular to vehicle verification methods, related devices and systems.
  • This application provides vehicle verification methods, related devices and systems, realizes the safe upgrade or safe start of the vehicle, and ensures the safety of the vehicle.
  • this application provides a vehicle verification method, which is characterized in that the method includes: the vehicle receives a first file and a first upgrade package, and the first file includes: a first vehicle identification, first integrity information, and, the first signature determined based on the first vehicle identification and the first integrity information; the vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle is determined
  • the first vehicle identification is the same as the vehicle identification, and the first upgrade package is an upgrade package indicated by the first integrity information; the vehicle is upgraded according to the first upgrade package to enhance the first function or add the first function.
  • the vehicle can obtain the authorization file and upgrade package when it needs to be upgraded.
  • the vehicle will verify the authorization file, including: verification of the vehicle identity, Verification of integrity information and verification of signatures.
  • the purpose of verifying the signature is to determine whether the authorization file is sent by the car cloud server that manages vehicle upgrades, and whether the authorization file has been tampered with by a third party.
  • the purpose of verifying the integrity information is to determine whether the received upgrade package is the same as the car cloud server.
  • the upgrade package sent together with the authorization file prevents third parties from replacing the upgrade package sent together with the car cloud server and the upgrade package in the authorization file with other upgrade packages.
  • the purpose of verifying the vehicle identity is to determine whether the received upgrade package is a vehicle
  • the cloud server sends the upgrade package specifically to the vehicle to avoid mixing upgrade packages sent by the vehicle cloud server to other vehicles for upgrade, or using upgrade packages that do not carry the vehicle identity. After the authorization file is verified, the vehicle can be upgraded using the upgrade package.
  • the vehicle can be prevented from being upgraded using the upgrade package sent by the car cloud server to other vehicles.
  • the vehicle can be upgraded at a lower or free price. Upgrade to avoid harming the interests of car manufacturers and software suppliers; on the other hand, the vehicle can verify whether the upgrade package is sent by a trusted server, and only use the upgrade package sent by the trusted server for upgrade, because the server will not Upgrade packages that are not used for authorization, such as upgrade packages used in the research and development stage, upgrade packages carrying viruses, upgrade packages with vulnerabilities, etc., are sent to the vehicle. Therefore, the vehicle will only be upgraded according to the safe upgrade package, ensuring that the vehicle uses the upgrade package. Security for making upgrades.
  • the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and if the verification passes, the vehicle determines the first signature again.
  • a vehicle identification is the same as the vehicle identification, and the upgraded vehicle data includes data in the upgrade package indicated by the first integrity information; the vehicle activates the first function.
  • the vehicle can also verify the authorization file again during the safe start stage. Only after the verification of the authorization file passes, the vehicle will be started. In this way, any unauthorized access can be avoided.
  • the authorized software program runs in the vehicle.
  • the software program that ensures the operation of the vehicle comes from the upgrade stage.
  • the upgrade package is installed to prevent the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles.
  • the software programs in the upgrade package used in the research and development stage ensure the safe operation of the vehicle.
  • this application provides another vehicle verification method.
  • the method includes: the vehicle receives a first file and a first upgrade package.
  • the first file includes: a first anti-replay parameter, a first integrity information, and , the first signature determined based on the first anti-replay parameter and the first integrity information;
  • the vehicle uses the public key of the first server to verify the first signature, and the verification passes;
  • the first server is used to manage the upgrade of the vehicle;
  • the vehicle It is determined that the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the first upgrade package is the upgrade package indicated by the first integrity information; the anti-replay parameter of the vehicle is used to identify this upgrade of the vehicle; the vehicle is based on The first upgrade package is upgraded to enhance the first function or add the first function.
  • the vehicle can obtain the authorization file and upgrade package when it needs to be upgraded.
  • the vehicle will verify the authorization file, including: verification of anti-replay parameters. , Verification of integrity information and verification of signatures.
  • the purpose of verifying the signature is to determine whether the authorization file is sent by the car cloud server that manages vehicle upgrades, and whether the authorization file has been tampered with by a third party.
  • the purpose of verifying the integrity information is to determine whether the received upgrade package is the same as the car cloud server.
  • the upgrade package that is generated together with the authorization file prevents third parties from replacing the upgrade package sent together with the car cloud server and the upgrade package in the authorization file with other upgrade packages, and verifies whether the anti-replay parameters are correct to ensure that the vehicle can pass the upgrade package with the car cloud server.
  • Upgrade with the upgrade package of the agreed upgrade package version For example, the vehicle and the server can agree on different anti-replay parameters for each upgrade. If an attacker exploits the vulnerability of the old version of the upgrade package to attack the vehicle, intercept the upgrade package sent by the server to the vehicle and replace it with the old version of the upgrade package.
  • the vehicle will not be upgraded based on the old version of the upgrade package, thus preventing attackers from replaying the old version of the upgrade. package, using the vulnerabilities of old versions to attack vehicles, ensuring the safety of vehicles and the interests of car owners.
  • the first file further includes a first vehicle identification
  • the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter
  • the vehicle is upgraded according to the first upgrade package
  • the method also includes: the vehicle determines that the first vehicle identification is the same as the vehicle identification of the vehicle.
  • the verification of the authorization file may also include verification of the vehicle identity.
  • the purpose of verifying the vehicle identity is to ensure that the upgrade package received by the vehicle is the upgrade package sent by the car cloud server and is suitable for the vehicle. Prevent vehicles from being upgraded using upgrade packages sent by the car cloud server to other vehicles, or upgrade packages used in the research and development stage, to ensure vehicle safety from the vehicle upgrade stage.
  • the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and the verification passes; the vehicle again determines the first signature.
  • the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the upgraded vehicle data includes data in the upgrade package indicated by the first integrity information; the vehicle activates the first function.
  • the vehicle can also verify the authorization file again during the secure startup phase, including: verification of signatures, verification of anti-replay parameters, and verification of integrity information.
  • the software program running on the vehicle is the official server, that is, the software program in the upgrade package sent by the car cloud server.
  • it does not come from the software program in the upgrade package of the old version, which prevents attackers from running the vehicle during the operation phase. Use vulnerabilities in older version upgrade packages to attack vehicles.
  • the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and the verification passes; the vehicle again determines the first signature.
  • the first anti-replay parameter is the same as the anti-replay parameter of the vehicle
  • the first vehicle identification is the same as the vehicle identification of the vehicle
  • the data of the upgraded vehicle includes the data in the upgrade package indicated by the first integrity information; the vehicle Start the first function.
  • the vehicle can also verify the authorization file again during the safe startup phase, including: verification of signatures, verification of anti-replay parameters, verification of vehicle identity, Verification of integrity information.
  • the software program running on the vehicle is the official server, that is, the software program in the upgrade package sent by the car cloud server.
  • the software program in the upgrade package sent by the car cloud server ensures the safety of the vehicle during its operation.
  • this application provides another vehicle verification method.
  • the method includes: the vehicle receives a first file and a first upgrade package.
  • the first file includes: a first vehicle identification, first integrity information, and, according to The first vehicle identification and the first signature determined by the first integrity information; the vehicle detects an instruction to activate the first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package; the vehicle uses the first server The public key verifies the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle again determines that the first vehicle identification is the same as the vehicle identification, and the upgraded vehicle data includes the first complete The data in the upgrade package indicated by the sexual information; the vehicle starts the first function.
  • the vehicle can receive the upgrade package and authorization file during the upgrade phase, and perform upgrades based on the upgrade package.
  • the authorization file is then used to verify whether the vehicle's upgraded software program comes from the source
  • the vehicle will start only after the software program in the upgrade package sent by the server to the vehicle has passed the verification. In this way, any unauthorized software program can be prevented from running in the vehicle.
  • the software program that ensures the operation of the vehicle comes from the software program in the upgrade package received during the upgrade stage, and during the startup stage, it is determined that the upgrade package is sent by the car cloud server.
  • the upgrade package applicable to this vehicle prevents the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles, or the software program in the upgrade package used in the research and development stage, etc., ensuring the safe operation of the vehicle.
  • this application provides another vehicle verification method.
  • the method includes: the vehicle receives a first file and a first upgrade package.
  • the first file includes: a first anti-replay parameter, a first integrity information, and , the first signature determined based on the first anti-replay parameter and the first integrity information;
  • the vehicle detects an instruction to start the first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package;
  • the vehicle The first signature is verified using the public key of the first server, and the verification passes;
  • the first server is used to manage the upgrade of the vehicle; the vehicle again determines that the first anti-replay parameter is the same as the vehicle identification of the vehicle, and the upgraded vehicle
  • the data includes the data in the upgrade package indicated by the first integrity information; the vehicle starts the first function.
  • the vehicle can receive the upgrade package and authorization file during the upgrade phase, and perform upgrades based on the upgrade package.
  • the authorization file is then used to verify whether the vehicle's upgraded software program comes from the source
  • the software program in the upgrade package sent by the server to the vehicle for this upgrade will only start after the verification passes. In this way, any unauthorized software programs can be prevented from running in the vehicle, and the software programs running on the vehicle can be guaranteed to
  • the program is derived from the software program in the upgrade package received during the upgrade stage, and during the startup stage, it is determined that the upgrade package is an upgrade package sent by the car cloud server that is suitable for the current upgrade of the vehicle, so as to prevent the vehicle from running an old version of the upgrade package.
  • Software programs, etc. ensure the safe operation of the vehicle.
  • the first file further includes a first vehicle identification
  • the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter
  • the method It also includes: the vehicle determines that the first vehicle identification is the same as the vehicle identification of the vehicle.
  • the verification of the authorization file also includes the verification of the vehicle identity, which can further prevent the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles, or the software program in the upgrade package used in the research and development phase. etc. to ensure the safe operation of the vehicle.
  • the anti-replay parameters of the vehicle are updated with each upgrade of the vehicle and are only used to identify an upgrade of the vehicle, or the anti-replay parameters of the vehicle are Multiple upgrades to identify vehicles.
  • the anti-replay parameter can be a random number randomly generated for each upgrade. This random number can be used to uniquely identify an upgrade. That is to say, for each upgrade, the car cloud server and the vehicle can agree on a random number. The generated "secret code" ensures that the vehicle will not be upgraded using an old version of the upgrade package at any time.
  • the anti-replay parameter can be a monotonically increasing count value, which can change each time it is upgraded, or can be changed under preset conditions, such as when a vulnerability is found in an old version upgrade package. . Among them, each time the count value is changed, it can be ensured that the vehicle will not be upgraded using the old version of the upgrade package at any time. Changing the count value when a vulnerability in the old version of the upgrade package is discovered can avoid the need to The vehicle is upgraded using the old version upgrade package.
  • the anti-replay parameters of the vehicle are stored in the replay protection storage partition RPMB or the one-time programmable storage area OTP.
  • the vehicle stores the local anti-replay parameters in RPMB and OTP, which can prevent third parties from maliciously tampering with the locally stored anti-replay parameters and ensure that the vehicle compares the received anti-replay parameters with the local anti-replay parameters. , the credibility of local anti-replay parameters.
  • the vehicle identification of the vehicle is stored in the one-time programmable storage area OTP.
  • the vehicle stores local anti-replay parameters in the OTP, which can prevent third parties from maliciously tampering with the locally stored vehicle identity and ensure that when the vehicle compares the received vehicle identity with the local vehicle identity, the local vehicle identity The credibility of the logo.
  • the first integrity information when the first upgrade package is an upgrade package identified by the first integrity information, the first integrity information includes a or multiple parameters, one or more parameters are used to identify the first upgrade package.
  • the integrity information can be a parameter that is used to identify the data in the entire upgrade package.
  • the sexual information can be multiple parameters, and these multiple parameters can respectively identify multiple upgrade files in the upgrade package. In this way, when the vehicle verifies the integrity information, it can accurately determine which data in the upgrade package has been tampered with.
  • the first file further includes: a first public key; the vehicle has a first identifier of the public key of the first server pre-stored, and the vehicle Before using the public key of the first server to verify the first signature, the method further includes: the vehicle determines the identity of the first public key; when the identity of the first public key is the same as the first identity, the vehicle determines that the first public key is The public key of the first server.
  • the authorization file can also include the authorization public key for verifying the signature in the authorization file.
  • the vehicle Before verifying the signature, the vehicle can first verify whether the authorization public key has been tampered with by a third party to ensure that the signature verification is successful. Credibility. Among them, the vehicle can preset the identification of the authorized public key locally, such as a hash value. If the hash value of the received authorized public key is the same as the locally preset hash value, it means that the authorized public key comes from the car cloud. server and has not been tampered with by a third party. That is to say, the vehicle can verify the received public key through the identification of the locally preset authorized public key.
  • the first file further includes: a first public key, and a second signature determined based on the first public key
  • the vehicle Before using the public key of the first server to verify the first signature, the method also includes: the vehicle uses the public key of the second server to verify the second signature; wherein the second server is a server that develops and provides an upgrade package required for vehicle upgrades. ; When the verification of the second signature passes, the vehicle determines that the first public key is the public key of the first server.
  • the authorization file includes an authorization public key that verifies the signature in the authorization file
  • other trusted third parties other than the car cloud server and the vehicle can provide proof of the legitimacy of the authorization public key.
  • the trusted third party may refer to the software vendor.
  • the vehicle can use the legality certificate provided by the software supplier's supplier server to determine whether the authorized public key comes from the vehicle cloud server and has not been tampered with, ensuring the credibility of the signature verification.
  • the vehicle stores usage information of the first public key, and the usage information is used to indicate that the first public key is only used to verify the first public key.
  • One signature is used to indicate that the first public key is only used to verify the first public key.
  • the purpose information of the first public key is used to specify the purpose of the authorized public key to avoid confusion between the signature capabilities of the supplier server and the car cloud server.
  • the cloud server has the possibility of forging the signature of the upgrade package.
  • the method before the vehicle uses the public key of the first server to verify the first signature, the method further includes: the vehicle determines that the first public key is The first server allows the vehicle to use the public key.
  • the car cloud server can also control the vehicle to allow or prohibit the authorization public key used to verify the signature of the authorization file. In this way, the authorization public keys provided by different car cloud servers can be distinguished. , to avoid the loss of authorized private keys of some vehicle manufacturers' car cloud servers, which will also affect other vehicle manufacturers.
  • the vehicle identification of the vehicle is used to identify the first component of the vehicle; the vehicle is upgraded according to the first upgrade package, which specifically includes: the vehicle is upgraded according to the first upgrade package The package performs an upgrade of the first component or the second component, and the upgrade of the second component is managed by the first component.
  • the vehicle identity identifier can be used to identify the components of the vehicle upgrade. Further, the vehicle identity identifier can be the chip ID of the component, or, for components with lower security capabilities, for components with lower security capabilities, the vehicle identity identifier can be the chip ID of the component. When upgraded, the vehicle identity is the identification of a component with strong security capabilities that manages the component, such as the chip ID of the component.
  • the vehicle's identity is also used to identify the third component.
  • the vehicle identity is used to identify multiple components, which can prevent the occurrence of malicious parts replacement attack scenarios on the vehicle.
  • the vehicle verifies the first file through the first component, or the vehicle verifies the first file through the first component and the third component.
  • the verification of the authorization file can be completed by one or more component verifications.
  • the first file further includes: second integrity information
  • the first signature is also based on the second integrity information. It is determined that the vehicle determines that the upgraded vehicle data includes the data in the upgrade package indicated by the first integrity information, specifically including: the vehicle determines that the upgraded vehicle data is the same as the data indicated by the second integrity information, and the second integrity information The data indicated by the information includes data in the first upgrade package.
  • the upgrade package is a differential package.
  • the integrity information in the authorization file may include: the integrity information of the data in the differential package, and the integrity information of the complete upgrade data.
  • the first file further includes: third integrity information, the first signature is further determined based on the third integrity information. If the verification of a signature passes, the third integrity information is used to indicate the data after the vehicle upgrade fails.
  • the integrity information in the authorization file may include: the integrity information of the data in the upgrade package, and the integrity information of the data after the upgrade fails. This prevents attackers from maliciously tampering with data in the vehicle by taking advantage of vehicle upgrade failures.
  • the first upgrade package includes a third signature and/or a fourth signature
  • the third signature is obtained by signing the first server
  • the fourth signature is obtained by signing the second server, which is a server that develops and provides upgrade files required for vehicle upgrades
  • the method also includes: the vehicle uses the public key of the first server to verify the signature. The vehicle verifies the third signature and the verification passes; and/or the vehicle uses the public key of the second server to verify the fourth signature and the verification passes.
  • the upgrade package may include a package signature and an outer signature.
  • the package signature is obtained by the supplier server signing the upgrade file
  • the outer signature is obtained by the CheCloud server signing the upgrade package.
  • the vehicle can determine by verifying the package signature that the upgrade file was sent by the supplier server and that it was not tampered with by a third party during the transmission process.
  • verifying the outer signature the vehicle can determine that the upgrade package was sent by the vehicle cloud server and that it was not tampered with by a third party during the transmission process. Third-party tampering to ensure that the upgrade package used when upgrading the vehicle is from a reliable source and has not been tampered with.
  • the method before the vehicle receives the first file and the first upgrade package, the method further includes: the vehicle receives the upgrade strategy; the vehicle performs the upgrade according to The policy determines the first address, which is the address where the first upgrade package is stored; the vehicle sends a download request to the server where the first address is located, and the download request is used to request to obtain the first upgrade package.
  • the vehicle can receive the download address of the upgrade package and download the upgrade package from the corresponding car cloud according to the download address.
  • the server obtains the upgrade package required for the upgrade, which can speed up the vehicle to obtain the upgrade package and reduce the storage space occupied by the upgrade package in each vehicle cloud server.
  • this application provides another vehicle verification method.
  • the method includes: the first server obtains the vehicle identification of the vehicle; the first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package; The server determines the signature based on the vehicle identification and integrity information; the first server sends a file and an upgrade package.
  • the file includes: vehicle identification, integrity information and signature; the upgrade package is used to upgrade the vehicle.
  • the car cloud server can send the authorization file for the upgrade package to the vehicle when sending the upgrade package to the vehicle, where the authorization file can include: vehicle identity identification, integrity information ,sign.
  • the signature proves that the authorization file was sent by the Cheyun server, preventing a third party from forging the authorization file.
  • the integrity information is used to bind the upgrade package and the authorization file, preventing a third party from maliciously intercepting the authorization file and combining the authorization file with the forged upgrade package. are sent to the vehicle together, and the vehicle identity identifier is used to indicate that the upgrade package sent this time is an upgrade package sent specifically for the vehicle.
  • vehicles can be prevented from being upgraded using upgrade packages sent by the car cloud server to other vehicles, or from using other upgrade packages not for sale, such as upgrade packages used in the research and development stage, upgrade packages carrying viruses, and upgrade packages with vulnerabilities. Wait for the upgrade to ensure that the vehicle is upgraded using a legal and appropriate upgrade package, or to ensure that the vehicle operation data comes from a legal and appropriate upgrade package to ensure the safe operation of the vehicle and safeguard the interests of car owners, car manufacturers and software suppliers.
  • the first server determines the signature based on the vehicle identification and integrity information, which specifically includes: the first server determines the signature based on the anti-replay parameters, the vehicle identification, and the integrity information, and the anti-replay parameters Used to identify this upgrade of the vehicle.
  • the authorization file may also include anti-replay parameters to ensure that the vehicle can be upgraded according to the upgrade package of the upgraded version agreed with the server. It can also prevent attackers from replaying the old version of the upgrade package and using the vulnerabilities of the old version to attack the vehicle, ensuring the safety of the vehicle and the interests of the car owner.
  • embodiments of the present application provide another vehicle verification method.
  • the method includes: the first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package; the first server determines the integrity information of the upgrade package according to the anti-replay parameters and The integrity information determines the signature, and the anti-replay parameters are used to identify the current upgrade of the vehicle; the first server sends a file and an upgrade package.
  • the file includes: anti-replay parameters, integrity information, and signature; the upgrade package is used to upgrade the vehicle.
  • the car cloud server can send the authorization file for the upgrade package to the vehicle when sending the upgrade package to the vehicle, where the authorization file can include: anti-replay parameters, integrity information, signature.
  • the signature proves that the authorization file was sent by the Cheyun server, preventing a third party from forging the authorization file.
  • the integrity information is used to bind the upgrade package and the authorization file, preventing a third party from maliciously intercepting the authorization file and combining the authorization file with the forged upgrade package. Sent to the vehicle together, the anti-replay parameters are used to identify this upgrade of the vehicle.
  • the first server determines the signature based on the anti-replay parameters and the integrity information, which specifically includes: the first server determines the signature based on the anti-replay parameters, the vehicle identification of the vehicle, and the integrity information.
  • the authorization file may also include vehicle identification to prevent vehicles from mixing upgrade packages sent by the vehicle cloud server to other vehicles, or upgrade packages used in the research and development stage, etc.
  • the method further includes: the first server sending a first list, the first list indicating the public keys used when the first server allows or prohibits the vehicle from verifying the signature.
  • the car cloud server can also control the vehicle to allow or prohibit the authorization public key used to verify the signature of the authorization file. In this way, the authorization public keys provided by different car cloud servers can be distinguished. , to avoid the loss of authorized private keys of some vehicle manufacturers' car cloud servers, which will also affect other vehicle manufacturers.
  • the file further includes a public key generated by the first server and used to verify the signature.
  • the file further includes a signature of the public key.
  • the method further includes: the first server sends the public key to the second server, and the first server sends the public key to the second server.
  • the second server is a server that develops and provides upgrade files required for vehicle upgrades; the first server receives the signature of the public key, and the signature of the public key is determined by the second server based on the public key.
  • the legitimacy of the authorization public key in the authorization file can be guaranteed by the supplier server to ensure the credibility of the vehicle's signature in the verification authorization file.
  • the application provides a vehicle, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the vehicle implements the first aspect or any embodiment of the first aspect, the second aspect or any embodiment of the second aspect, the third aspect or any embodiment of the third aspect, the fourth aspect or any one of the fourth aspect method described in each embodiment.
  • the present application provides an electronic device, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the first The method described in the fifth aspect or any embodiment of the fifth aspect, the sixth aspect or any embodiment of the sixth aspect.
  • the present application provides a communication system, which includes the vehicle of the seventh aspect and the electronic device of the eighth aspect.
  • the present application provides a computer-readable storage medium, including instructions.
  • the electronic device When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect or any one of the embodiments of the first aspect or the second aspect. Or any embodiment of the second aspect, the third aspect or any embodiment of the third aspect, the fourth aspect or any embodiment of the fourth aspect, the fifth aspect or any one of the fifth aspect The method described in any one of the embodiments, the sixth aspect, or the sixth aspect.
  • the vehicle before the vehicle is upgraded or started, by verifying the data carried in the upgrade package, including vehicle identification, anti-replay parameters, etc., the vehicle can be prevented from importing upgrade packages that are not suitable for the vehicle. vehicle, or to prevent the vehicle from running the data in the upgrade package that is not applicable to the vehicle, thereby affecting the safety of the vehicle, and safeguarding the commercial interests between car owners, car manufacturers and software suppliers.
  • Figure 1 is a schematic structural diagram of a communication system 10 provided by an embodiment of the present application.
  • Figure 2A is a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application.
  • Figure 2B is an electronic and electrical architecture diagram of the vehicle 300 provided by an embodiment of the present application.
  • FIG. 3 is a hardware structure diagram of the electronic device 500 provided by the embodiment of the present application.
  • Figure 4 is a schematic flow chart of the vehicle verification method in the remote upgrade scenario provided by the embodiment of the present application.
  • Figure 5 is a schematic diagram of the logical structure of the supplier server signing the upgrade package provided by the embodiment of the present application
  • Figure 6 is a schematic diagram of the logical structure of the package signature of the vehicle verification upgrade package provided by the embodiment of the present application.
  • Figure 7 is a schematic flow chart of the vehicle verification method in the near-end upgrade scenario provided by the embodiment of the present application.
  • Figure 8 is a flow chart of interaction between domain controllers when multiple domain controllers verify the vehicle identity in the authorization file provided by the embodiment of the present application;
  • FIG. 9 is a sequence diagram of a vehicle upgrade provided by an embodiment of the present application.
  • FIG. 10 is a sequence diagram of another vehicle upgrade provided by an embodiment of the present application.
  • Figure 11 is a flow chart of the interaction between the supplier server and the car cloud server when multi-level keys are used to set the signature of the authorized public key provided by the embodiment of the present application;
  • Figure 12 is a schematic structural diagram of a multi-level key provided by an embodiment of the present application.
  • Figure 13 is a logical schematic diagram of the supplier server signing the authorized public keys of multiple car cloud servers provided by the embodiment of this application;
  • Figure 14 is a schematic structural diagram of another multi-level key provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only and shall not be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, “plurality” The meaning is two or more.
  • the upgrade package can be imported and installed in the vehicle system to achieve the upgrade effect of expanding or enhancing the vehicle software functions.
  • the autonomous driving function of the vehicle can be enabled by importing an upgrade package for the autonomous driving function.
  • the software vulnerability can be fixed by importing a higher version upgrade package.
  • the vehicle upgrade methods mainly include the following two types:
  • OTA upgrade means that the vehicle directly interacts with the server that holds the upgrade package through the wireless network to obtain the upgrade package and complete the upgrade.
  • OTA upgrades can remotely repair vehicle software faults, and automakers do not have to recall vehicles for repairs. Maintenance reduces the recall costs of automobile manufacturers, and car owners can also complete vehicle repairs conveniently and quickly, reducing the time cost of car owners.
  • the device with the upgrade package can use the vehicle's port, for example, through a wired connection to the vehicle's on-board diagnostic system (On Board Diagnostics, OBD) port, import the upgrade package into the vehicle and trigger the installation, thereby completing the vehicle upgrade.
  • OBD on Board Diagnostics
  • the vehicle can drive to a car sales and service store, that is, a 4S store, and the after-sales staff of the 4S store will connect the diagnostic instrument/host computer to the OBD port of the vehicle, import the upgrade package into the vehicle, and complete the vehicle upgrade.
  • the vehicle can be quickly upgraded without being connected to the network.
  • the upgrade package needs to be imported into the vehicle to achieve the vehicle upgrade. This presents a problem. Since the vehicle only receives the upgrade package unilaterally, the attacker can Upgrade packages that are not applicable to the vehicle, such as upgrade packages for older versions, upgrade packages for other vehicles, upgrade packages used in the research and development stage, etc., are imported into the vehicle, thereby affecting the commercial interests of car owners, car manufacturers and software suppliers.
  • an attacker can import an older version of an upgrade package with a vulnerability into a vehicle, and then use the vulnerability to attack the vehicle and harm the interests of the car owner.
  • attackers can import upgrade packages sent by officials (such as car manufacturers) to other vehicles into vehicles at a lower price, achieving the same effect as purchasing from the official website, harming the commercial interests of car manufacturers and software suppliers.
  • an attacker can import the upgrade package used in the research and development stage into the vehicle, and use the privileges included in the upgrade package to maliciously modify the vehicle's program, reduce the safety of the vehicle, and harm the interests of the car owner.
  • the embodiment of the present application provides a vehicle verification method, which mainly involves a vehicle and a server.
  • the server stores upgrade packages required for vehicle upgrades.
  • the server can send the vehicle identity, integrity information, and the signature and upgrade package calculated based on the vehicle identity and integrity information to the vehicle, where the vehicle identity is used to uniquely identify the upgraded vehicle. Integrity information is used to identify the upgrade package.
  • the vehicle After receiving the vehicle identity, integrity information, signature and upgrade package, the vehicle can first verify the signature to make sure that the vehicle identity comes from the server and has not been tampered with by a third party, and then verify the received vehicle.
  • the identity identifier is consistent with the local identity identifier of the vehicle, and whether the received integrity information is consistent with the integrity information calculated by the vehicle for the received upgrade package. If they are consistent, it means that the upgrade package received by the vehicle was specifically sent by the server to The vehicle's upgrade package, the vehicle can trigger vehicle upgrades based on the upgrade package.
  • the server when the server sends upgrade packages to different vehicles, they all carry the vehicle identity that identifies the vehicle. This prevents the vehicle from mixing upgrade packages sent by the server to other vehicles for upgrade, or using uncarried vehicles when upgrading. Identity upgrade package.
  • the vehicle can verify whether the upgrade package is sent by a trusted server, and only use the upgrade package sent by the trusted server for upgrade, because the server will not use the upgrade package that is not for sale.
  • Upgrade packages for example, upgrade packages used in the research and development stage, upgrade packages carrying viruses, upgrade packages with vulnerabilities, etc. are sent to the vehicle, because This vehicle will only be upgraded based on a secure upgrade package. Furthermore, even if the vehicle receives a tampered upgrade package or a forged upgrade package sent by a third party, it will not pass the verification and will not proceed based on the upgrade package. Upgrade, thereby ensuring the safety of vehicles using upgrade packages.
  • the embodiment of the present application also provides another vehicle verification method.
  • This method mainly involves the vehicle and the server.
  • the server can transfer the anti-replay parameters and integrity information according to the anti-replay parameters and integrity information.
  • the signature calculated by the information and the upgrade package applicable to this upgrade are sent to the vehicle.
  • the anti-replay parameters are used to identify this upgrade, and the integrity information is used to identify the upgrade package.
  • the vehicle After receiving the anti-replay parameters, signature and upgrade package, the vehicle can first verify the signature to make sure that the anti-replay parameters come from the server and have not been tampered with by a third party, and then verify the received anti-replay data.
  • the parameters are consistent with the local anti-replay parameters of the vehicle, and whether the received integrity information is consistent with the integrity information calculated by the vehicle for the received upgrade package. If they are consistent, it means that the upgrade package received by the vehicle was sent by the server.
  • the upgrade package is applicable to this upgrade, and the vehicle can trigger the vehicle upgrade based on the upgrade package.
  • the server when the server sends the upgrade package to the vehicle, it carries the anti-replay parameters that identify the current upgrade of the vehicle.
  • the server uses the anti-replay parameters to distinguish upgrades of different versions of the vehicle.
  • this vehicle verification method can ensure that the vehicle can be upgraded according to the upgrade package of the upgraded version agreed with the server.
  • the vehicle and the server can agree on different anti-replay parameters for each upgrade. If an attacker exploits the vulnerability of the old version of the upgrade package to attack the vehicle, intercept the upgrade package sent by the server to the vehicle and replace it with the old version of the upgrade package. package, but because the anti-replay parameters of the old version of the upgrade package are inconsistent with the anti-replay parameters of the current vehicle upgrade, the vehicle will not be upgraded based on the old version of the upgrade package, thus preventing attackers from replaying the old version of the upgrade. package, using the vulnerabilities of old versions to attack vehicles, ensuring the safety of vehicles and the interests of car owners.
  • the above two vehicle verification methods can be implemented in combination.
  • the server can send the vehicle identity, anti-replay parameters and complete information, as well as the signature calculated based on the vehicle identity, anti-replay parameters, and integrity information, along with the upgrade package to the vehicle, and verify it.
  • the vehicle identity, anti-replay parameters and integrity information are all verified, the vehicle upgrade is triggered.
  • the beneficial effects of this embodiment may include the beneficial effects of the above two vehicle verification methods.
  • the server can send the upgrade package and authorization file to the vehicle when the vehicle needs to be upgraded.
  • the vehicle can verify the authorization file before using the upgrade package to upgrade.
  • the verification of the authorization file and authorization file is as follows The description can be found in the following content, and will not be expanded upon here.
  • the vehicle before the vehicle is upgraded, by verifying the data carried in the upgrade package, including vehicle identification, anti-replay parameters, etc., the vehicle can be prevented from importing upgrade packages that are not suitable for the vehicle, and thus It affects the safety of vehicles and protects the commercial interests among car owners, car manufacturers and software suppliers.
  • the communication system 10 provided by the embodiment of the present application will be introduced below with reference to FIG. 1 .
  • Figure 1 is a schematic structural diagram of a communication system 10 provided by an embodiment of the present application.
  • the communication system 10 may include: a server 100 , a server 200 , and a vehicle 300 . in:
  • the server 100 may refer to a server used by a software supplier to maintain vehicle components, which may be referred to as a supplier server below.
  • the server 100 is a server that develops and provides upgrade packages required for vehicle upgrades.
  • the number of servers 100 may be one or more.
  • the server 100 may store one or more upgrade files for upgrading vehicle components.
  • the server 100 may sign the one or more upgrade files, obtain the package signatures of the one or more upgrade files, and convert the one or more upgrade files into The upgrade file and the package signature are packaged into an installation package and sent to the server 200.
  • the package signature is used to prove that the installation package is sent by the server 100 and has not been tampered with during transmission.
  • the specific description of package signature can be found in the following content, which will not be discussed here.
  • the server 200 may refer to a vehicle manufacturer's server, which may be referred to as a vehicle cloud server below.
  • the server 200 is used to manage vehicle upgrades.
  • the number of servers 200 may be one or more.
  • the server 200 can obtain the installation packages for different components of the vehicle from the servers of various software suppliers (for example, the server 100), perform an outer signature on the installation package, and package the installation package and the outer signature to obtain an upgrade package.
  • the outer signature proves that the upgrade package was sent by the server 200 and has not been tampered with during transmission.
  • the server 200 can also obtain the asset information of the vehicle 300, generate an authorization file based on the asset information, and directly interact with the vehicle to send the upgrade package and authorization file to the vehicle for the vehicle to upgrade.
  • the asset information may include the software and hardware versions of the vehicle 300, as well as vehicle identification, anti-replay parameters, and so on.
  • the specific description of the outer signature can be found in the following content, and will not be discussed here.
  • Vehicle 300 may refer to a vehicle that needs to be upgraded.
  • the vehicle 300 can be used to send asset information to the server 200, receive upgrade packages and authorization files, and verify the authorization files, including signature verification in the authorization file, verification of anti-replay parameters, verification of vehicle identity, Verification of integrity information, etc., as well as verification of the outer signature and inner signature in the upgrade package, and vehicle upgrades are implemented based on the upgrade package.
  • verify the authorization files including signature verification in the authorization file, verification of anti-replay parameters, verification of vehicle identity, Verification of integrity information, etc.
  • vehicle upgrades are implemented based on the upgrade package.
  • the verification of the authorization file and the verification process of the outer signature and the inner signature in the upgrade package please refer to the following content, which will not be discussed here.
  • the server 100 can package and sign one or more upgrade files, and package the upgrade files and package signatures into an installation package and send it to the server 200, and the server 200 can obtain Installation packages of different versions and for different components of the vehicle are externally signed and packaged to obtain upgrade packages for different components of the vehicle.
  • the server 200 can determine the upgrade version applicable to the vehicle 300 , the upgrade package of the component to be upgraded, generates the authorization file of the upgrade package, and sends the upgrade package and the authorization file to the vehicle 300.
  • the vehicle 300 then verifies the authorization file and the signature in the upgrade package. After the verification is passed, according to the Upgrade packages for vehicle upgrades.
  • the communication system 10 may also include an electronic device 400.
  • the electronic device 400 relays the upgrade package sent to the vehicle 300 by the server 200 .
  • the electronic device 400 can be used to obtain the upgrade package and the authorization file sent by the server 200, and import the upgrade package and the authorization file into the vehicle 300 through wired transmission.
  • the electronic device 400 may refer to equipment such as a diagnostic instrument and a computer in a car sales store.
  • the only difference between the near-end upgrade and the remote upgrade is that when the vehicle 300 needs to be upgraded, the vehicle 300 can interact with the server 200 through the relay of the electronic device 400 . That is to say, when the vehicle is upgraded through near-end upgrade, the server 200 can send the upgrade package to the electronic device 400, and the electronic device 400 then imports the upgrade package into the vehicle 300 through wired transmission, and the vehicle 300 then according to the Upgrade packages for vehicle upgrades.
  • the communication connection may be a wired connection or a wireless connection.
  • the wireless connection can be a high-fidelity wireless communication (wireless fidelity, Wi-Fi) connection, a Bluetooth connection, an infrared connection, an NFC connection, a ZigBee connection and other short-range connections, or it can be a long-distance connection, and the long-distance connection includes but does not Limited to long-distance connections based on mobile networks based on 2G, 3G, 4G, 5G and subsequent standard protocols.
  • the server 100 may send the upgrade package and the signature of the upgrade package to the server 200 through a wireless connection.
  • the server mentioned in the embodiments of this application may be one server or a server cluster composed of multiple servers.
  • the server 200 can be a server cluster in which multiple servers are deployed through a distributed architecture.
  • the cluster can include a cloud computing server, a Content Delivery Network (Content Delivery Network, CDN) server, and a Network Time Protocol (Network Time Protocol). NTP), Domain Name System (Domain Name System, DNS) server, etc.
  • NTP Network Time Protocol
  • DNS Domain Name System
  • various servers can coordinate with each other to jointly complete functions such as computing, data storage, and communication.
  • the server 200 can include a server 201 and a server 202. Both the server 201 and the server 202 include upgrade packages provided by various software vendors.
  • the vehicle 300 can interact with the server 201 to complete the vehicle upgrade, and can also interact with the server 202 to complete the vehicle upgrade. upgrade.
  • a single server, a distributed server, a server cluster, etc. are collectively referred to as servers.
  • FIG. 2A is a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application.
  • the vehicle 300 includes: a controller area network (CAN) bus 11, a plurality of electronic control units (ECUs), an engine 13, and a vehicle box (telematics box, T-box) 14. Transmission 15. Driving recorder 16. Antilock brake system (ABS) 17. Sensor system 18. Camera system 19. Microphone 20, etc.
  • CAN controller area network
  • ECUs electronice control units
  • T-box vehicle box
  • Transmission Driving recorder
  • ABS Antilock brake system
  • Sensor system 18.
  • Camera system 19. Microphone 20, etc.
  • the CAN bus 11 is a serial communication network that supports distributed control or real-time control and is used to connect various components of the vehicle 300 . Any component on the CAN bus 11 can monitor all data transmitted on the CAN bus 11.
  • the frames transmitted by CAN bus 11 can include data frames, remote frames, error frames, and overload frames. Different frames transmit different types of data.
  • the CAN bus 11 can be used to transmit data involved in various components in the control method based on voice instructions. For the specific implementation of this method, please refer to the detailed description of the method embodiment below.
  • each component of the vehicle 300 can also be connected and communicated through other methods.
  • each component can also communicate through the vehicle Ethernet (ethernet) local interconnect network (LIN) bus, FlexRay and common vehicle network system (media oriented systems, MOST) bus, etc.
  • LIN vehicle Ethernet
  • MOST common vehicle network system
  • the ECU is equivalent to the processor or brain of the vehicle 300 and is used to instruct corresponding components to perform corresponding actions according to instructions obtained from the CAN bus 11 or according to operations input by the user.
  • ECU can be composed of a security chip, a microprocessor (microcontroller unit, MCU), a random access memory (random access memory, RAM), a read-only memory (random-only memory, ROM), and an input/output interface (I/O). , analog/digital converter (A/D converter) and input, output, shaping, drive and other large-scale integrated circuits.
  • ECUs There are many types of ECUs, and different types of ECUs can be used to implement different functions.
  • the multiple ECUs in the vehicle 300 may include, for example: an engine ECU 121, a telematics box (T-box) ECU 122, a transmission ECU 123, a driving recorder ECU 124, an anti-lock brake system (antilock brake system, ABS) ECU 125, etc.
  • an engine ECU 121 a telematics box (T-box) ECU 122
  • a transmission ECU 123 a driving recorder ECU 124
  • an anti-lock brake system antilock brake system
  • ABS antilock brake system
  • T-box ECU122 is used to manage T-box14.
  • T-box14 is mainly responsible for communicating with the Internet, providing a remote communication interface for the vehicle 300, including navigation, entertainment, Driving data collection, driving trajectory recording, vehicle fault monitoring, vehicle remote query and control (such as opening and closing, air conditioning control, window control, engine torque limit, engine start and stop, seat adjustment, battery power, fuel level, door status query etc.), driving behavior analysis, wireless hotspot sharing, roadside assistance, abnormality reminder and other services.
  • T-box14 can be used to communicate with car telematics service provider (TSP) and user (such as driver) side electronic devices to realize vehicle status display and control on electronic devices.
  • TSP car telematics service provider
  • user such as driver
  • T-box14 can send a request command to T-box14.
  • T-box14 After obtaining the control command, T-box14 sends a control message through the CAN bus and controls the vehicle 300. Finally, the operation results are fed back to the vehicle management application on the user-side electronic device.
  • the data read by T-box14 through CAN bus 11 can be transmitted to the TSP backend system through the network, and the TSP The background system forwards it to the electronic device on the user side for viewing by the user.
  • T-box14 may specifically include a communication module and a display screen.
  • the communication module can establish connections and communicate with other devices such as servers and user-side electronic devices through vehicle to everything (V2X) communication technology (cellular V2X, C-V2X) based on cellular networks.
  • V2X vehicle to everything
  • C-V2X may include, for example, V2X based on long term evolution (LTE) (LTE-V2X), 5G-V2X, etc.
  • the communication module can be used to implement communication between the vehicle 300 and a server, such as the server 200, and send asset information in the vehicle 300, such as software and hardware versions, vehicle identification, anti-replay parameters, etc., to the server. , so that the server can determine the upgrade package applicable to the vehicle 300, and the communication module can also be used to obtain the upgrade package and authorization file sent by the server, etc.
  • a server such as the server 200
  • asset information in the vehicle 300 such as software and hardware versions, vehicle identification, anti-replay parameters, etc.
  • the display screen is used to provide a visual interface to the driver.
  • the vehicle 300 may include one or more display screens, for example, it may include a vehicle-mounted display screen disposed in front of the driver's seat, a display screen disposed above the seat for displaying surrounding conditions, and may also include projecting information onto the windshield. Head-up digital display (HUD) on the computer, etc.
  • HUD Head-up digital display
  • T-box 14 may also be called a vehicle-machine system, a telematics processor, a vehicle gateway, etc., and the embodiments of this application do not limit this.
  • the transmission ECU123 is used to manage the transmission.
  • the transmission 15 can be used to change the engine speed and torque. It can fix or change the output shaft and input shaft transmission ratios in stages.
  • the components of the transmission 15 may include a transmission mechanism, a control mechanism, a power output mechanism, etc.
  • the main function of the speed change transmission mechanism is to change the value and direction of torque and rotational speed; the main function of the control mechanism is to control the transmission mechanism to realize the transformation of the transmission ratio, that is, to achieve gear shifting, in order to achieve variable speed and torque.
  • the driving recorder ECU 124 is used to manage the driving recorder 16 .
  • the driving recorder 16 components may include a host computer, a vehicle speed sensor, data analysis software, etc.
  • the driving recorder 16 refers to an instrument that records the images and sounds of the vehicle during driving, including driving time, speed, location and other related information. exist In the embodiment of the present application, when the vehicle is driving, the vehicle speed sensor collects the wheel speed and sends the vehicle speed information to the driving recorder 16 through the CAN bus.
  • ABS ECU125 is used to manage ABS17.
  • ABS17 automatically controls the braking force of the brake when the vehicle is braking, so that the wheels are not locked and are in a rolling and sliding state to ensure the maximum adhesion between the wheels and the ground.
  • the ABS will enter the anti-lock brake pressure adjustment process.
  • the sensor system 18 may include: an acceleration sensor, a vehicle speed sensor, a vibration sensor, a gyroscope sensor, a radar sensor, a signal transmitter, a signal receiver, etc.
  • the acceleration sensor and the vehicle speed sensor are used to detect the speed of the vehicle 300 .
  • the shock sensor can be disposed under the seat, on the seat belt, on the seat back, on the operating panel, on the airbag or in other locations to detect whether the vehicle 300 is collided and where the user is.
  • a gyro sensor may be used to determine the motion attitude of vehicle 300 .
  • Radar sensors can include lidar, ultrasonic radar, millimeter wave radar, etc.
  • the radar sensor is used to emit electromagnetic waves to illuminate the target and receive its echo, thereby obtaining information such as the distance from the target to the electromagnetic wave emission point, distance change rate (radial velocity), orientation, altitude, etc., thereby identifying other vehicles near the vehicle 300 , pedestrians or roadblocks, etc.
  • the signal transmitter and signal receiver are used to send and receive signals.
  • the signals can be used to detect the location of the user.
  • the signals can be, for example, ultrasonic waves, millimeter waves, lasers, etc.
  • Camera system 19 may include multiple cameras for capturing still images or video.
  • the cameras in the camera system 19 can be set in front, behind, side, or inside the car to facilitate functions such as assisted driving, driving recording, panoramic view, and in-car monitoring.
  • the sensor system 18 and the camera system 19 can be used to detect the surrounding environment to facilitate the vehicle 300 to make corresponding decisions to respond to environmental changes. For example, they can be used to complete the task of paying attention to the surrounding environment during the autonomous driving phase.
  • Microphone 20 also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or outputting a voice command, the user can speak close to the microphone 20 with the human mouth and input the sound signal to the microphone 20 .
  • the vehicle 300 may be provided with at least one microphone 20 . In other embodiments, the vehicle 300 may be provided with two microphones 20, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the vehicle 300 can also be equipped with three, four or more microphones 20 to form a microphone array to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
  • the vehicle 300 may also include multiple interfaces, such as a USB interface, an RS-232 interface, an RS485 interface, etc., and may be connected to external cameras, microphones, headphones, and user-side electronic devices.
  • multiple interfaces such as a USB interface, an RS-232 interface, an RS485 interface, etc., and may be connected to external cameras, microphones, headphones, and user-side electronic devices.
  • the memory in the vehicle 300 may be used to store the vehicle identity, anti-replay parameters, public keys and hash values of the public keys, and the like.
  • the content stored in the vehicle 300 please refer to the following content, which will not be discussed here.
  • Vehicle 300 may include more or fewer components than illustrated, some components combined, some components separated, or different component arrangements.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the vehicle 300 may also include a separate memory, battery, lights, wipers, instrument panel, audio, vehicle terminal (transmission control unit, TCU), auxiliary control unit (auxiliary control unit, ACU), smart entry and start-up. Passive entry passive start (PEPS), on board unit (OBU), body control module (BCM), charging interface, etc.
  • TCU transmission control unit
  • auxiliary control unit auxiliary control unit
  • PEPS Passive entry passive start
  • OBU on board unit
  • BCM body control module
  • charging interface etc.
  • FIG. 2B illustrates an electrical and electronic architecture diagram of the vehicle 300 .
  • the vehicle 300 includes multiple components. According to the multiple components included in the vehicle 300, the software and hardware of the vehicle 300 can be divided to obtain the overall layout plan of the vehicle electronic and electrical system. As shown in Figure 2B, the vehicle 300 can be divided into multiple functional domains.
  • One functional domain can include a domain controller (Domain Controller, DC) and multiple connected electronic control units (ECUs) and other components.
  • the functional domains of the vehicle may include: power domain, chassis domain, cockpit domain, body domain, and autonomous driving domain.
  • the upgrade of a vehicle actually refers to the upgrade of each component installed in the vehicle. Upgrades of components in different functional domains are mainly managed by their respective functional domains.
  • the domain controller DC contains two logical functional modules: Domain Upgrade Controller (Domain Update Controller, DUC) and Domain Installer (Domain Installer, DI). in:
  • the domain upgrade controller DUC is responsible for the upgrade packages of all components in the domain, downloading the authorization files of the upgrade packages, verifying the legality of the upgrade packages, and overall control of the upgrade of components in the domain.
  • the domain upgrade controller DUC's legality verification of the upgrade package may refer to verification of the outer signature in the upgrade package, and this verification is used to determine the source of the upgrade package (for example, the server 200 shown in Figure 1 ) is legal, whether the contents of the upgrade package have been tampered with, etc.
  • the specific description of the outer signature can be found in the following content, and will not be discussed here.
  • the domain installer DI is responsible for verifying the authorization file, verifying the legality of the upgrade package of this domain, and checking the conditions of the vehicle before upgrading, including voltage, speed, etc., before installing the upgrade package, and upgrading. During the process, the components of this domain are upgraded and refreshed.
  • the legality verification of the upgrade package by the domain installer DI may refer to the verification of the package signature in the upgrade package. This verification is used to determine whether the source of the upgrade package (for example, the server 100 shown in Figure 1) Legal, whether the contents of the upgrade package have been tampered with, etc.
  • the verification of authorization files includes verification of vehicle identity, verification of anti-replay parameters, verification of integrity information, signature verification of authorization files, etc. Specific descriptions of packaged signatures and authorization files can be See the subsequent content, which will not be expanded upon here.
  • the vehicle 300 also includes a Vehicle Update Controller (VUC), which is deployed on a certain domain controller DC.
  • VUC Vehicle Update Controller
  • the vehicle upgrade controller VUC can be responsible for interacting with the server (such as the server 200 shown in Figure 1) and uploading asset information to the server, such as software and hardware versions, vehicle identification, and anti-replay parameters. Wait, obtain the Download Policy (DP) package from the server.
  • the DP package can include the download address of the upgrade package of each functional domain.
  • the vehicle upgrade controller VUC can be used to parse the DP package, send the download address of the upgrade package to the domain controller DC of the corresponding functional domain, and coordinate the upgrade. Download and install the package so that each domain controller DC can download the upgrade package for the components in the functional domain, thereby completing the upgrade of each component of the vehicle. Specific descriptions of the DP package and obtaining the upgrade package through the DP package can be found in subsequent method embodiments, which will not be discussed here.
  • the module for verifying the authorization file is not limited to the domain installer DI.
  • the authorization file is verified through the domain upgrade controller DUC.
  • the embodiment of the present application does not limit the module for verifying the authorization file.
  • the domain controller DC generally supports a secure boot function, which can use a preset public key, such as the public key in the key pair generated by the server 100, to verify whether the software loaded on the vehicle is trusted.
  • a secure boot function which can use a preset public key, such as the public key in the key pair generated by the server 100, to verify whether the software loaded on the vehicle is trusted.
  • a preset public key such as the public key in the key pair generated by the server 100
  • only software signed by the private key corresponding to the public key can pass verification and start normally inside the vehicle, while software that fails verification cannot be loaded. In this way, attackers can be prevented from directly disassembling the vehicle components and maliciously reading and writing the vehicle's software. Harm the commercial interests of car manufacturers and software manufacturers.
  • the verification of the authorization file can be triggered again when the components are safely started through the safe start function. This further prevents attackers from directly disassembling the machine, importing upgrade packages that are not applicable to the vehicle, and changing components to software programs that have been upgraded through the upgrade packages. Due to the secure startup process of components, specifically the step-by-step startup of software, that is, the upper-level software starts the lower-level software, and before starting the lower-level software, the security of the lower-level software is verified, including the authorization file. Verification, package signature verification, etc.
  • the verification passes, it means that the next-level software is safe, and the control flow is handed over to the next-level software, and the security of the software continues to be verified, and so on, until the component
  • all the software passes the verification, it means that the software in the component is safe, that is, the software comes from the software supplier and has not been tampered with by the attacker, and the source of the software is not an old version upgrade package, an upgrade package for other vehicles, or one used in the research and development stage. upgrade packages, etc.
  • the component is upgraded using the upgrade package sent by the car cloud server, and the verification of the authorization file passes during the secure startup phase, it means that the program currently running on the component is imported into the program after being upgraded with the upgrade package sent by the car cloud server.
  • the software data of this component avoids the need for vehicles to run old version upgrade packages, upgrade packages for other vehicles, upgrade packages used in the research and development stage, and other software data in upgrade packages.
  • verifying the authorization file during the safe startup phase of the vehicle can prevent the vehicle from running unverified programs and prevent attackers from directly disassembling upgrade packages that are not applicable to the vehicle, such as old version upgrade packages and other upgrade packages.
  • the software data in the vehicle's upgrade package and the upgrade package used in the research and development phase are imported into the vehicle, thereby strictly controlling the safe operation of the vehicle during the startup phase, ensuring the safety of the vehicle and maintaining the business of the car factory and software manufacturer. Benefit.
  • the above electronic and electrical architecture diagram is only an illustrative example and does not constitute a limitation of the present application. It should be understood that in other embodiments of the present application, the electronic and electrical architecture diagram of the vehicle may also have other structures, and the embodiment of the present application does not limit the above electronic and electrical architecture. There are no restrictions on the names of domain controller DC, domain upgrade controller DUC, domain installer DI, and vehicle upgrade controller VUC mentioned in the architecture diagram.
  • FIG. 3 is a hardware structure diagram of the electronic device 500 provided by the embodiment of the present application.
  • electronic device 500 may include: one or more processors 201 , memory 202 , communication interface 203 , transmitter 205 , receiver 206 , coupler 207 and antenna 208 . These components can be connected through the bus 204 or other ways. Figure 3 takes the connection through the bus as an example. in:
  • the communication interface 203 may be used between the electronic device 500 and other communication devices, such as the electronic device 400 .
  • the communication interface 203 may be a 3G communication interface, a Long Term Evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc.
  • LTE Long Term Evolution
  • the electronic device 500 can also be configured with a wired communication interface 203 to support wired communication.
  • the backhaul link between the electronic device 500 and other servers can be a wired communication connection.
  • transmitter 205 and receiver 206 may be viewed as a wireless modem.
  • the transmitter 205 can be used to transmit the signal output by the processor 201.
  • Receiver 206 may be used to receive signals.
  • the number of each of the transmitter 205 and the receiver 206 may be one or more.
  • Antenna 208 may be used to convert electromagnetic energy in the transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in the transmission line.
  • the coupler 207 can be used to split the mobile communication signal into multiple channels and distribute them to multiple receivers 206 . It can be understood that the antenna 208 of the electronic device 500 can be implemented as a large-scale antenna array.
  • Memory 202 is coupled to processor 201 for storing various software programs and/or sets of instructions.
  • the memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk memories. storage device, flash memory device or other non-volatile solid-state storage device.
  • the memory 202 can store an operating system (hereinafter referred to as the system), such as uCOS, VxWorks, RTLinux and other embedded operating systems.
  • an operating system hereinafter referred to as the system
  • uCOS uCOS
  • VxWorks VxWorks
  • RTLinux embedded operating systems
  • the processor 201 may be used to read and execute computer-readable instructions.
  • the transmitter 205 can be used to send the installation package to the car cloud server.
  • the processor 201 may be configured to generate a key for package signing, and perform package signing on one or more upgrade files.
  • Memory 202 may be used to store locally generated keys, such as private keys used to package-sign upgrade files.
  • the transmitter 205 can be used to send DP packages, upgrade packages, authorization files, etc. to the vehicle or diagnostic terminal.
  • the receiver 206 may be used to receive installation packages sent by the supplier server, as well as asset information, download requests, etc. sent by the vehicle or diagnostic terminal.
  • the processor 201 can be used to generate a key pair, perform an outer signature on the installation package, determine the upgrade package based on the asset information, and generate authorization files and DP packages, etc.
  • the memory 202 may be used to store the upgrade package and locally generated keys, such as a private key used to sign the vehicle identity, anti-replay parameters, and integrity information, and a private key used to sign the outer layer of the installation package.
  • the electronic device 500 shown in FIG. 3 is only an implementation manner of the embodiment of the present application. In actual applications, the electronic device 500 may also include more or fewer components, which is not limited here.
  • FIG. 4 is a schematic flowchart of the vehicle verification method in the remote upgrade scenario provided by the embodiment of the present application.
  • the remote upgrade scenario mainly involves the interaction between the supplier server, the vehicle cloud server, and the vehicle.
  • the vehicle can obtain the upgrade package through wireless communication to complete the vehicle upgrade.
  • remote upgrades and the communication systems involved in remote upgrades please refer to the relevant content mentioned above and will not be repeated here.
  • the vehicle verification method may include:
  • the supplier server signs one or more upgrade files and generates an installation package.
  • the supplier server may refer to a server where the software supplier maintains vehicle components. After the developer develops an upgrade file for the vehicle component, the supplier server can obtain the newly developed upgrade file.
  • the supplier server may refer to the server 100 shown in Figure 1.
  • the server 100 For a specific description of the server 100, please refer to the relevant content of Figure 1, which will not be described again here.
  • the supplier server may provide one or more upgrade files for upgrading the component.
  • the one or more upgrade files can be used to achieve upgrade effects such as operating system updates for vehicle components, application software version updates, bug fixes, etc.
  • the one or more upgrade files may be used to upgrade one or more software included in the component.
  • an upgrade file can contain upgrade data of a software in the component.
  • Signing one or more upgrade files specifically refers to digitally signing the one or more upgrade files respectively, and obtaining the package signature of the one or more upgrade files.
  • the supplier server may compress the one or more upgrade files and the one or more packaging signatures to generate an installation package.
  • a digital signature also known as a public key digital signature
  • a digital string that can only be generated by the sender of the information and cannot be forged by others.
  • This digital string is also an effective proof of the authenticity of the information sent by the sender of the information.
  • the sender can generate a pair of keys and use the private key in the key pair to sign the information through a signature algorithm.
  • the recipient can use the public key in the key pair to verify the signature through the signature verification algorithm to determine whether the information comes from to the sender of the information and whether it has been tampered with during the sending process.
  • data signatures can ensure the legitimacy of the information, which includes that the source of the information is legitimate and has not been tampered with.
  • the supplier server uses its own private key to package and sign the upgrade file, so that the recipient of the upgrade file can confirm the source of the upgrade file based on the package signature and prevent others from impersonating the supplier server and sending it out.
  • the supplier server can generate a pair of keys, including public key 1 and private key 1, where private key 1 is kept locally and is used to sign the upgrade file, and public key 1 can be sent to the vehicle for After the vehicle obtains the upgrade package, it verifies the package signature.
  • the supplier server can send the public key used to verify the packet signature, such as public key 1, to the vehicle when the vehicle is upgraded, or it can be sent to the vehicle through the vehicle cloud server, such as , when the supplier server sends the installation package to the car cloud server, it also sends the public key to the car cloud server.
  • the supplier server can send the public key used to verify the signature to the CheCloud server in advance before signing the upgrade file.
  • the vehicle can directly preset the public key for verifying the signature into the vehicle's chip during the vehicle production line stage. The embodiment of this application does not limit the method and time for the vehicle to obtain the public key.
  • the signature of the upgrade file performed by the supplier server can also be called an inner signature, a small package signature, a package signature, etc., and the embodiment of this application does not limit this name.
  • the supplier server can use multi-level keys to implement package signatures for upgrade files.
  • the supplier server can generate multiple pairs of keys, and implement the package signature of the upgrade file through the step-by-step signature of the upper-level private key to the lower-level public key.
  • the supplier server when verifying the packaged signature, it is necessary to verify the packaged signature through level-by-level verification of the signature of the lower-level public key by the upper-level public key.
  • the following uses the third-level key as an example to introduce the detailed process of the supplier server signing the upgrade file.
  • the supplier server generates three pairs of keys: the packaged root public key and the packaged root private key, the packaged layer 2 public key and the packaged layer 2 private key, the packaged layer 3 public key and the packaged layer 3 private key.
  • Figure 5 is a schematic logical structure diagram of the supplier server signing the upgrade file provided by the embodiment of the present application.
  • the supplier server's signing of the upgrade file mainly includes the following steps:
  • the supplier server uses the compilation root private key to sign the compilation layer 2 public key and obtains the signature of the compilation layer 2 public key.
  • the supplier server uses the second-layer private key to sign the third-layer public key and obtains the signature of the third-layer public key.
  • the supplier server uses the packaged three-layer private key to sign the upgrade file and obtains the packaged signature.
  • the supplier server when sending the installation package to the Cheyun server, can include the above-mentioned packaged root public key, packaged second-level public key, packaged layer-2 public key signature, packaged layer-3 public key, packaged layer-2 public key, and packaged layer-2 public key.
  • the signature and packaged signature containing the third-level public key are sent to the vehicle, or forwarded to the vehicle through the vehicle cloud server.
  • the vehicle verifies the packaged signature in the upgrade package, it can use the above-mentioned packaged root public key, packaged second-level public key, etc.
  • the public key, the signature of the second-layer public key, the third-layer public key, the signature of the third-layer public key, and the signature are verified.
  • the subsequent step S115 The relevant content will not be expanded upon here.
  • the embodiment of the present application does not limit the number of key levels used by the supplier server.
  • the supplier server can generate four pairs of keys to implement the package signature of the upgrade file. The principle is similar to the above-mentioned supplier. The process of the server using the third-level key to sign the upgrade file will not be described again here.
  • the supplier server sends the installation package to the Cheyun server.
  • the car cloud server refers to a server that directly interacts with the vehicle. It can obtain and store installation packages sent by servers of multiple software vendors, and send the upgrade package to the vehicle when the vehicle needs to be upgraded.
  • the upgrade package is a packaged file of the installation package and the outer signature of the installation package. The specific description of the upgrade package and the outer signature can be found in the following content, which will not be discussed here.
  • the vehicle may refer to the terminal device where the vehicle is located, and the vehicle may be used to receive an upgrade package and implement vehicle upgrades based on the upgrade package.
  • the vehicle cloud server may refer to the server 200 shown in FIG. 1
  • the vehicle may refer to the vehicle 300 shown in FIG. 1 .
  • the server 200 and the vehicle 300 please refer to the relevant content in Figure 1 and will not be described again here.
  • the supplier server may not package and sign the upgrade file, and the embodiment of the present application does not limit this.
  • S101 is an optional step, so the installation package sent by the supplier server to the car cloud server in step S101 may include the upgrade file, but not the package signature.
  • the supplier server does not need to compress the upgrade file and the package signature of the upgrade file. That is to say, the data sent by the supplier server to the Cheyun server is not necessarily an installation package.
  • the supplier server can directly compress the upgrade file and package signature.
  • the package signature is sent to the car cloud server.
  • the embodiment of this application does not limit the data form of the data sent by the supplier server to the car cloud server.
  • the embodiment of this application does not limit the name of the installation package sent by the supplier server to the car cloud server.
  • the installation package may also be called a software package, an upgrade package, a compressed package, etc.
  • the Cheyun server signs the installation package and generates an upgrade package.
  • the car cloud server can perform data signature on the installation package to obtain the outer signature of the installation package.
  • the Cheyun server can package the installation package and the outer signature to generate the upgrade package and archive the installation package sent by the supplier server.
  • digital signatures please refer to the relevant content mentioned above and will not be repeated here.
  • the upgrade package can be used to enhance or add vehicle functions, such as autonomous driving functions, navigation functions, etc.
  • this function can also be called the first function.
  • the CheCloud server signs the installation package so that the recipient of the installation package can determine the source of the installation package based on the signature, preventing others from impersonating the CheCloud server and sending out upgrade packages containing the installation package.
  • the car cloud server can generate a pair of keys, including public key 2 and private key 2. Private key 2 is retained locally and is used to sign the installation package. Public key 2 can be sent to the vehicle for signing. The vehicle verifies the signature after obtaining the upgrade package.
  • the signature of the installation package performed by the car cloud server can also be called a large package signature, an outer signature, a vehicle manufacturer (Original Equipment Manufacturer, OEM) signature, etc.
  • OEM OEM
  • the embodiment of this application does not limit this name.
  • step S103 is optional.
  • the embodiment of the present application does not limit the name of the upgrade package.
  • the upgrade package may also be called a software package, an installation package, a software upgrade package, a software installation package, an installation file, etc.
  • the installation package sent by the supplier server to the car cloud server can also be called an upgrade package.
  • the installation packages sent by the supplier server to the car cloud server in order to distinguish the files for vehicle upgrade sent by the supplier server to the car cloud server, and The files sent by the car cloud server to the supplier server for vehicle upgrade are called installation packages, and the files sent by the car cloud server to the vehicle are called upgrade packages. It should be understood that this name does not constitute a limitation on the embodiments of the present application.
  • the vehicle sends asset information to the vehicle cloud server.
  • the vehicle sends asset information to the vehicle cloud server, and accordingly, the vehicle cloud server receives the asset information from the vehicle.
  • Asset information is used to describe relevant information required for vehicle upgrades, including but not limited to one or more of the following: software and hardware version information, vehicle identification, anti-replay parameters for this upgrade, etc.
  • the software and hardware version information can be used to determine the version of the upgrade package used for the software and hardware upgrade of the vehicle
  • the vehicle identity identifier can be used to identify the upgraded vehicle
  • the anti-replay parameters can identify the upgrade.
  • the vehicle identity can be used to uniquely identify the upgraded vehicle, and the anti-replay parameters can uniquely identify the upgraded vehicle.
  • the vehicle can obtain the version information of the software and hardware by querying the software and hardware installed in the vehicle.
  • vehicle identification and anti-replay parameters can be found in the following content, and will not be discussed here.
  • vehicle identity and anti-replay parameters please refer to the subsequent specific implementation of the vehicle identity and anti-replay parameters, which will not be discussed here.
  • the vehicle can send asset information to the vehicle cloud server when it needs to be upgraded.
  • the vehicle can periodically send asset information to the vehicle cloud server.
  • the vehicle can periodically update the asset information obtained by the vehicle cloud server.
  • the embodiment of this application does not limit the triggering timing of asset information sent by the vehicle.
  • Vehicles can trigger upgrades in the following two situations:
  • the vehicle can, after detecting the user's upgrade operation, send asset information to the vehicle cloud server in response to the operation, triggering the upgrade of the vehicle.
  • the vehicle receives the upgrade instruction from the car cloud server and triggers the upgrade.
  • the vehicle after receiving the upgrade instruction from the car cloud server, the vehicle can send the asset information to the car cloud server to trigger the upgrade of the vehicle.
  • the vehicle can passively trigger vehicle upgrades under the control of the vehicle cloud server.
  • the triggering timing of vehicle upgrade is not limited to the above two situations.
  • the vehicle can trigger the upgrade in combination with the above situations.
  • the vehicle can detect the upgrade instruction of the car cloud server and the user's upgrade operation at the same time.
  • the asset information is triggered to be sent to the vehicle cloud server.
  • the embodiment of the present application does not limit the triggering timing of the vehicle upgrade.
  • the vehicle can send asset information to the vehicle cloud server through the vehicle upgrade controller VUC.
  • vehicle upgrade controller VUC please refer to the relevant content in Figure 2B, which will not be described again here.
  • the car cloud server determines the upgrade package based on the asset information.
  • the vehicle cloud server may trigger the determination of the upgrade package after receiving the asset information, or the vehicle cloud server may trigger the determination of the upgrade package based on the asset information when the vehicle has an upgrade requirement, such as when an upgrade request from the vehicle is received.
  • the car cloud server can determine the components of the vehicle to be upgraded based on the software and hardware version information in the asset information and the upgrade version of the installation package obtained by the car cloud server from the supplier server, thereby determining the upgrade package that needs to be sent to the vehicle.
  • this upgrade package is the upgrade package for the vehicle parts to be upgraded.
  • the asset information indicates that the software version of the first component of the vehicle is V2.
  • the vehicle cloud server stores the V3 version upgrade package of the first component
  • the vehicle cloud server can determine that the first component is the version that needs to be upgraded. , then it is determined that the first component is a component to be upgraded of the vehicle, and the V3 version upgrade package of the first component is an upgrade package that needs to be sent to the vehicle.
  • step S103 the CheCloud server signs the installation package, or execution can be triggered after the CheCloud server receives the asset information and determines the installation package that meets the requirements based on the asset information.
  • this application actually The embodiment does not limit the timing when the CheCloud server signs the installation package.
  • the authorization file may include but is not limited to one or more of the following parameters: vehicle identification, anti-replay parameters, and integrity information.
  • the vehicle identity can be used to uniquely identify the upgraded vehicle.
  • the vehicle identity can be obtained based on the vehicle identity in the asset information sent by the vehicle.
  • the anti-replay parameter can identify this upgrade.
  • the anti-replay parameter can be obtained based on the anti-replay parameter in the asset information sent by the vehicle.
  • the integrity information is used to identify the upgrade package sent by the car cloud server during this upgrade process.
  • the integrity information is used to uniquely identify the upgrade package.
  • the integrity information may be a hash value calculated on the upgrade package using a hash function.
  • the integrity information can be parameters calculated by the Che Cloud server based on the upgrade package, or can be parameters calculated by the server provided by the software supplier based on the upgrade package and sent to the Che Cloud server.
  • the authorization file may also include a signature of the authorization file, and the signature of the authorization file is used to prove the legitimacy of the authorization file.
  • the signature of the authorization file can be obtained by digitally signing the parameters in the authorization file using the private key (hereinafter referred to as the authorization private key) of the car cloud server.
  • the signature of the authorization file may be a signature obtained by digitally signing the vehicle identity, anti-replay parameters, and integrity information in the authorization file.
  • the signature of the authorization file can be implemented as an example.
  • the car cloud server can generate a pair of keys, including public key 3 and private key 3. Private key 3 is retained locally and is used to calculate the authorization file.
  • the signature, public key 3, can be sent to the vehicle for the vehicle to verify the signature after obtaining the authorization file.
  • the signature of the authorization file is a signature calculated based on this one or more parameters.
  • the authorization file may also include a public key used to verify the signature of the authorization file (hereinafter referred to as the authorization public key), such as the above-mentioned public key 3. In this way, when the vehicle obtains the authorization file, the signature of the authorization file can be verified based on the authorization public key.
  • the authorization file may also include a legality certificate used to prove that the authorized public key is legal. For a specific description of the legality certificate, please refer to the subsequent specific implementation, which will not be discussed here.
  • the authorization file can include three parts: attribute field M, signature field and verification public key field.
  • the attribute domain M may include: vehicle identity identifier Space_Attr, anti-replay parameter Time_Attr, and integrity information Integrity_Attr.
  • the signature field includes the signature Sig(sk,M) calculated by the car cloud server on the attribute field M using its own authorized private key sk (for example, private key 3).
  • the verification public key field includes: the authorized public key pk (for example, public key 3) corresponding to the authorized private key sk. The authorized public key pk is used to verify the signature Sig(sk,M) in the signature field.
  • verification The public key field may also include: a validity certificate pk_validity_proof used to verify that the authorized public key pk is legitimate.
  • the structure of the authorization file shown in Table 1 is only an illustrative example and does not constitute a limitation on the authorization file.
  • the attribute domain of the authorization file may contain more or less information.
  • the attribute field may only include the vehicle identity identifier Space_Attr and the anti-replay parameter Time_Attr.
  • the verification public key field may not include the validity certificate pk_validity_proof.
  • the authorization document is not limited to consisting of the above three parts. The embodiment of this application does not limit the structure of the authorization file.
  • the vehicle identity sent by the vehicle to the car cloud server mentioned in step S103 may be different from the vehicle identity in the authorization file mentioned in step S106.
  • the asset information sent by the vehicle to the car cloud server may not include anti-replay parameters
  • the authorization file returned by the car cloud server to the vehicle may include anti-replay parameters, that is, the asset information mentioned in step S103 , the anti-replay parameter may not be included
  • the authorization file mentioned in step S106 may include the anti-replay parameter.
  • the subsequent implementation section on the anti-replay parameter which will not be discussed here.
  • the car cloud server determines the upgrade strategy.
  • upgrade packages for different components may be stored in different vehicle cloud servers.
  • the vehicle cloud server can determine the location of the upgrade packages of these components to be upgraded.
  • the storage address determines the upgrade strategy, which is used to indicate the download address of the upgrade package for the vehicle components to be upgraded.
  • the upgrade policy may refer to a download policy (DP) package
  • the DP package may include download addresses of upgrade packages for multiple components of the vehicle to be upgraded, and the download addresses may be used to obtain the upgrade packages.
  • the download address may be a uniform resource locator (URL).
  • the DP package may also include a download address of the authorization file, and the download address is used to obtain the authorization file.
  • the download address may be a URL.
  • the DP package may also include one or more of upgrade rules, upgrade conditions, download rules, etc.
  • upgrade rules can be used to define the order of the upgrade, whether rollback is required, and other rules.
  • Upgrade conditions can include whether the power supply is normal, storage space, network status, etc.
  • Download rules can be used to define the order of downloading and indicate the components of the upgrade package to be downloaded. etc. The embodiment of this application does not limit the content contained in the DP package.
  • the car cloud server sends the upgrade strategy to the vehicle, and accordingly, the vehicle obtains the upgrade strategy sent by the car cloud server.
  • the vehicle can obtain the upgrade strategy through the vehicle upgrade controller VUC.
  • vehicle upgrade controller VUC for details about the vehicle upgrade controller VUC, please refer to the relevant content of Figure 2B mentioned above, and will not be described again here.
  • the vehicle resolves the download address according to the upgrade strategy.
  • the download address may include a storage address, such as a first address, of an upgrade package for one or more components of the vehicle.
  • the download address may also include the storage address of the authorization file of the upgrade package.
  • the vehicle can parse the upgrade strategy through the vehicle upgrade controller VUC to obtain the download address of the upgrade package for one or more components.
  • the vehicle sends the download address to the corresponding functional domain according to the functional domain where the one or more components are located.
  • the domain controller DC For example, the vehicle obtains the download address 1 of the upgrade package of the first component and the download address 2 of the upgrade package of the second component according to the upgrade strategy. It is assumed that the first component is located in the first functional domain and the second component is located in the second functional domain. , then the vehicle sends the download address 1 to the domain controller DC in the first functional domain, and sends the download address 2 to the domain controller DC in the second functional domain.
  • the vehicle sends a download request to the vehicle cloud server according to the download address.
  • the vehicle sends a download request to the car cloud server, and accordingly, the car cloud server receives the download request from the vehicle.
  • the car cloud server here may refer to a server that stores the upgrade package requested by the download request.
  • this download request can also be used to obtain the authorization file.
  • the car cloud server sends the upgrade package to the vehicle.
  • the car cloud server sends the upgrade package to the vehicle, and accordingly, the vehicle receives the upgrade package from the car cloud server. Specifically, the vehicle can obtain the upgrade package through the domain upgrade controller DUC.
  • the car cloud server can also send the public key (for example, public key 1) and the public key for verifying the outer signature (for example, public key 2) are sent to the vehicle.
  • the car cloud server performs an outer signature on the installation package, it verifies the public key of the outer signature in advance and sends it to the vehicle.
  • the vehicle can directly store the public key inside the vehicle's chip during the vehicle production line stage. The embodiment of the present application does not limit the method and time for the vehicle to obtain the public key for verifying the outer signature.
  • car cloud server may also directly send the installation package to the vehicle without signing the installation package, and the embodiments of this application do not limit this.
  • the car cloud server sends the authorization file to the vehicle.
  • the car cloud server sends the authorization file to the vehicle, and accordingly, the vehicle receives the authorization file from the car cloud server. Specifically, the vehicle can obtain the authorization file through the domain upgrade controller DUC.
  • Vehicle acquisition authorization documents can include the following two situations:
  • the car cloud server after the car cloud server generates the authorization file, it can send the download address of the authorization file to the vehicle along with the upgrade policy. In this way, the vehicle can, after obtaining the upgrade policy, send the authorization file to the authorization file based on the download address of the authorization file.
  • the device where the file resides sends a download request.
  • step S108 the upgrade policy sent by the car cloud server to the vehicle may include the download address of the authorized file.
  • step S109 the download address parsed by the vehicle may include the download address of the authorized file.
  • step S110 the download request sent by the vehicle to the vehicle cloud server is also used to request the authorization file.
  • the car cloud server After the car cloud server generates the authorization file, it directly sends the authorization file to the vehicle without going through the process of sending the address first and then the authorization file.
  • step S108 the upgrade policy sent by the car cloud server to the vehicle may not include the download address of the authorized file.
  • step S109 the download address parsed by the vehicle may not include the download address of the authorized file.
  • step S110 the download request sent by the vehicle to the vehicle cloud server may only be used to request to obtain the upgrade package.
  • step S111 may be performed after step S112, or step S111 and step S112 may be performed simultaneously.
  • Vehicle verification of authorization documents may include one or more of the following:
  • the vehicle verifies the signature of the authorization file to verify the legality of the authorization file, including confirming the source of the authorization file. legal, and whether the authorization file has been tampered with. In this way, attackers can be prevented from maliciously tampering with the parameters in the authorization file after obtaining the authorization file, including: vehicle identification, anti-replay parameters, integrity information, etc.
  • the vehicle can use the authorized public key (for example, public key 3) to verify the signature to decrypt the signature, obtain the message digest of the parameters of the authorization file, and use the hash algorithm to decrypt the parameters in the authorization file received by the vehicle. Perform operations to obtain the locally calculated message digest.
  • the vehicle verifies the signature of the authorization file to determine whether the decrypted message digest is consistent with the locally calculated message digest.
  • the parameters of the authorization file include vehicle identification, anti-replay parameters, and integrity information.
  • the hash algorithm used by the vehicle for the authorization file is the same as the hash algorithm used by the car cloud server to sign the authorization file.
  • the vehicle identification in the vehicle verification authorization file is to determine whether the upgrade package sent by the car cloud server is an upgrade package suitable for the vehicle sent by the car cloud server. In this way, attackers can be prevented from sending upgrade packages from the server to other vehicles or using unauthorized upgrades to upgrade their own vehicles.
  • the vehicle can complete the verification of the vehicle identity by determining whether the vehicle identity in the authorization file is consistent with the local vehicle identity.
  • the verification of the vehicle identity please refer to the subsequent specific implementation, and will not be described in detail here.
  • the anti-replay parameter in the vehicle verification authorization file is to determine whether the upgrade package sent by the vehicle cloud server is an upgrade package suitable for this upgrade. In this way, attackers can be prevented from using a version of the upgrade package that is not suitable for the current upgrade of the vehicle to upgrade the vehicle.
  • the vehicle can complete the verification of the anti-replay parameters by determining whether the anti-replay parameters in the authorization file are consistent with the local anti-replay parameters.
  • the verification of anti-replay parameters please refer to the subsequent specific implementation, and will not be described in detail here.
  • the vehicle verifies the integrity information in the authorization file to determine whether the currently verified authorization file is the authorization file for the upgrade package. This can prevent attackers from counterfeiting the authorization file of the upgrade package and provide false vehicle identification, anti-replay parameters and other information for the vehicle, or prevent attackers from only intercepting the authorization file of the upgrade package and binding the authorization file to other upgrades.
  • the package is sent to this vehicle, affecting the safety of the vehicle.
  • the vehicle can use a hash function to calculate the hash value of the upgrade package received by the vehicle.
  • the hash value is the integrity information of the upgrade package calculated locally by the vehicle.
  • the vehicle determines the completeness information obtained by the local calculation.
  • the integrity information is consistent with the integrity information in the authorization file to complete the verification of the integrity information.
  • the hash function used by the vehicle for the upgrade package is the same as the hash function used by the vehicle cloud server when calculating the integrity information of the upgrade package.
  • the integrity information since the integrity information is used to bind the upgrade package and the authorization file, it prevents attackers from maliciously intercepting the authorization file and using the authorization file with other vulnerable upgrade packages to upgrade the vehicle, thus endangering the safety of the vehicle.
  • the transmission process of the authorization file and upgrade package itself is absolutely safe, or the authorization file and upgrade package are encrypted during the transmission process, making it impossible for attackers to obtain the contents of the authorization file and upgrade package, or the upgrade package and authorization file are inaccessible segmented so that an attacker cannot intercept the authorization file alone, the integrity information does not need to be included in the authorization file.
  • the Cheyun server can sign the authorization file and upgrade package when sending it, preventing attackers from maliciously splitting the authorization file and upgrade package.
  • the verification of the authorization file determines what needs to be verified based on the content contained in the authorization file. For example, when the authorization file only contains the vehicle identification, the verification of the authorization file may only include the vehicle identity. Verification of the identity. When the authorization file contains the vehicle identity and anti-replay parameters, the verification of the authorization file may include verification of the vehicle identity and verification of the anti-replay parameters.
  • the vehicle upgrade is specifically an upgrade of each component in the vehicle
  • the vehicle when the vehicle obtains the authorization file of the upgrade package, it can complete the verification of the authorization file through the domain controller DC of the functional domain where the component to be upgraded is located.
  • the vehicle can verify the authorization file through the domain installer DI in the domain controller DC.
  • the vehicle can also assist in completing the verification of the authorization file through the domain controller DC of other functional domains.
  • the verification of an authorization file can be completed by one or more domain controllers DC.
  • the embodiment of this application does not limit the number of domain controller DCs that verify authorization files.
  • the domain installer DI please refer to the relevant content of Figure 3 mentioned above, and will not be repeated here.
  • the vehicle determines whether the verification of the authorization file has passed.
  • the verification of the authorization file includes verification of the signature of the authorization file, verification of vehicle identification, verification of anti-replay parameters, and verification of integrity information
  • the digest is consistent with the locally calculated message digest
  • the vehicle identity in the authorization file is consistent with the local vehicle identity
  • the anti-replay parameters in the authorization file are consistent with the local anti-replay parameters.
  • the authorization file Only when the integrity information in the vehicle is consistent with the integrity information calculated locally, the vehicle determines that the verification of the authorization file has passed. Otherwise, when the signature verification, vehicle identity verification, and anti-replay parameter verification .
  • the verification of the authorization file will fail.
  • the vehicle can perform multiple verifications in the authorization file at the same time, or can perform individual verifications one by one, and the embodiment of the present application does not limit this.
  • the vehicle can first verify the signature of the authorization file, and then verify it after the signature verification passes. For the vehicle identity in the authorization file, after the vehicle identity is verified, the integrity information in the authorization file is verified. After the integrity information is verified, the anti-replay parameters in the authorization file are verified. If If the verification of the anti-replay parameters passes, it means that the verification of the authorization file passes. When any verification of the authorization file fails, the vehicle stops verification and determines that the verification of the authorization file fails.
  • step S115 When the vehicle determines that the verification of the authorization file passes, the vehicle executes step S115; otherwise, the vehicle executes step S118.
  • the vehicle can verify the upgrade package.
  • the upgrade package includes an installation package and an outer signature of the installation package.
  • the installation package includes one or more upgrade files and a package signature corresponding to the one or more upgrade files.
  • Verification of the upgrade package may include one or more of the following:
  • the vehicle verifies the outer signature to confirm whether the source of the upgrade package is legal when it is sent to the vehicle by the car cloud server, and whether the upgrade package has been tampered with.
  • the vehicle can use the domain upgrade controller DUC to verify the outer signature of the upgrade package using the public key in the signature-verification outer signature key pair generated by the vehicle cloud server.
  • the domain upgrade controller DUC please refer to the relevant content in Figure 3 mentioned above, and will not be repeated here.
  • the vehicle verifies the package signature to confirm whether the source of the installation package is legal when it is sent from the supplier server to the vehicle cloud server, and whether the installation package has been tampered with.
  • the package signature refers to the signature of the upgrade file by the supplier server.
  • the package signature please refer to the relevant content of the aforementioned step S101, which will not be described again here.
  • the vehicle can first unpack the installation package to obtain one or more upgrade files and one or more package signatures. Afterwards, the vehicle can use the calibration Verify the public key of the signature (for example, public key 1) to verify the packaged signature.
  • the calibration Verify the public key of the signature for example, public key 1
  • the vehicle can verify the package signature of the upgrade package through the domain installer DI using the public key in the signature-verification package signature key pair generated by the supplier server.
  • the domain installer DI please refer to the relevant content of Figure 3 mentioned above, and will not be repeated here.
  • the verification of the upgrade package determines what needs to be verified based on the signature contained in the upgrade package. For example, when the upgrade package only contains the outer signature, the verification of the upgrade package can only include the outer signature. When the upgrade package only contains the package signature, the verification of the upgrade package can only include the verification of the package signature. When the upgrade package includes the outer signature and the package signature, the verification of the upgrade package can only include the verification of the package signature. Verification can include verification of outer signatures and verification of packaged signatures. In addition, when the upgrade package received by the vehicle does not have a signature, the vehicle does not have signature verification of the upgrade package. For example, for the upgrade package of the electronic control unit ECU, the upgrade package may only contain the outer signature and not the packaged signature.
  • the vehicle does not need to verify the compilation signature during the upgrade phase, but verifies the compilation signature during the safe start phase.
  • the safe start phase please refer to the following content. , will not be expanded upon here.
  • the vehicle can first verify the outer signature through the domain upgrade controller DUC, and then verify the outer signature. After passing, verify the package signature through the domain installer DI.
  • the vehicle's verification of the package signature involves the verification process of multiple public keys.
  • the following uses the third-level key as an example to introduce the detailed process of the vehicle's verification of the package signature.
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server uses the third-level key to package and sign the upgrade file
  • the supplier server generates three pairs of keys: the package root public key and the package root private key, the package second-level public key and the package root private key.
  • the vehicle can obtain the packaged root public key, packaged layer 2 public key, packaged layer 2 public key signature, packaged layer 3 public key, packaged layer 3 public key signature, and packaged signature.
  • the supplier server using the third-level key to compile and sign the upgrade package please refer to the relevant content of Figure 5 mentioned above, and will not be repeated here.
  • Figure 6 is a schematic diagram of the logical structure of the package signature of the vehicle verification upgrade package provided by the embodiment of the present application.
  • vehicle verification package signature mainly includes the following steps:
  • Step 1 Vehicle verifies the credibility of the packaged root public key
  • the vehicle In order to prevent the packaged root public key received by the vehicle from being forged by an attacker, the vehicle first needs to verify the credibility of the packaged root public key.
  • the vehicle can store the hash value of the packaged root public key locally.
  • the hash value of the packaged root public key can be calculated, and then compared with the locally stored hash value. Compare the hash value of the wrapped root public key. If the two are consistent, it means that the wrapped root public key is trustworthy and not forged data. Otherwise, it means that the wrapped root public key is not trustworthy.
  • the hash value of the packaged root public key can be stored in the One Time Programmable (OTP) storage area of the chip, because the content of the OTP cannot be tampered with, and the non-tampering feature is guaranteed by the hardware mechanism. .
  • OTP One Time Programmable
  • the vehicle can perform step 2.
  • Step 2 The vehicle uses the packaged root public key to verify the signature of the packaged second-level public key.
  • the packaged root public key can be used to verify the signature.
  • the vehicle can perform step 3.
  • Step 3 The vehicle uses the packaged layer 2 public key to verify the signature of the packaged layer 3 public key.
  • the packaged layer 2 public key can be used to verify the signature.
  • the vehicle can perform step 4.
  • Step 4 The vehicle uses the three-layer public key of the package to verify the package signature.
  • the packaged three-layer public key can be used to verify the packaged signature.
  • the embodiment of the present application does not limit the number of key levels used by the supplier server.
  • the verification process of the package signature can be The principle involved in verifying the signatures of more public keys is similar to the vehicle's verification process of package signatures mentioned above, and will not be described again here.
  • the vehicle determines whether the verification of the upgrade package has passed.
  • the verification of the upgrade package passes; otherwise, the verification of the upgrade package fails.
  • step S117 is executed; otherwise, step S118 is executed.
  • Installing the upgrade package on the vehicle means that the vehicle executes the flashing of the upgrade package and writes the upgrade file in the upgrade package into the storage partition of the vehicle. Specifically, the upgrade file in the upgrade package of the vehicle component to be upgraded is written into the to-be-upgraded in the component's storage partition.
  • the vehicle can install the upgrade package through the domain installer DI to complete the upgrade of vehicle components.
  • the vehicle can only confirm that the upgrade package is suitable for the vehicle and that the source of the upgrade package is legal and has not been tampered with.
  • the installation upgrade will be triggered, and the safe operation of the vehicle will be strictly controlled from the vehicle upgrade stage to provide safety guarantee for the vehicle upgrade.
  • the vehicle upgrade will be canceled and the vehicle upgrade will fail.
  • the vehicle can be prevented from importing upgrade packages that are not applicable to the vehicle, such as upgrade packages of old versions, upgrade packages of other vehicles, upgrade packages used in the research and development stage, etc., so as to protect car owners, software suppliers, The commercial interests of car manufacturers are to improve vehicle safety.
  • the vehicle cloud server may also be called the first server
  • the supplier server may also be called the second server
  • the vehicle's local vehicle identity may also be called the vehicle identification.
  • the vehicle receives The received authorization file may also be called the first file
  • the received upgrade package may also be called the first upgrade package
  • the vehicle identity in the authorization file may also be called the first vehicle identification.
  • the replay parameter may also be called the first anti-replay parameter
  • the integrity information in the authorization file may also be called the first integrity information
  • the signature in the authorization file may also be called the first signature
  • the integrity information in the authorization file may also be called the first signature.
  • the authorized public key may also be called the first public key
  • the outer signature in the upgrade package may also be called the third signature
  • the packaged signature in the upgrade package may also be called the fourth signature.
  • Figure 7 is a schematic flowchart of the vehicle verification method in the near-end upgrade scenario provided by the embodiment of the present application.
  • the vehicle verification method may include:
  • the supplier server signs one or more upgrade files and generates an installation package.
  • the supplier server sends the installation package to the Cheyun server.
  • the Cheyun server signs the installation package and generates an upgrade package.
  • steps S201-S203 are the same as steps S101-S103 in Figure 4. Please refer to the relevant description.
  • the diagnostic terminal obtains the asset information of the vehicle.
  • the diagnostic terminal sends the asset information to the car cloud server.
  • steps S204-S205 are similar to step S104 in Figure 4.
  • the asset information of the vehicle in Figure 7 is read from the vehicle by establishing a wired connection with the vehicle through the diagnostic terminal. After that, the diagnostic terminal then Send asset information to the car cloud server.
  • the vehicle directly sends asset information to the vehicle cloud server.
  • the diagnostic terminal is used to obtain the asset information of the vehicle, obtain the upgrade package from the vehicle cloud server, and import the upgrade package into the vehicle through wired transmission.
  • the diagnostic terminal may refer to the electronic device 400 shown in FIG. 1 .
  • the electronic device 400 please refer to the relevant content of FIG. 1 and will not be described again here.
  • the user needs to manually connect the diagnostic terminal to the vehicle's port, such as the OBD port.
  • the diagnostic terminal can obtain the vehicle's asset information through the OBD port and import the upgrade package into the vehicle.
  • the car cloud server determines the upgrade package based on the asset information.
  • the car cloud server generates an authorization file.
  • the car cloud server determines the upgrade strategy.
  • steps S206-S208 are the same as steps S105-S107 in Figure 4. Please refer to the relevant description.
  • the car cloud server sends the upgrade strategy to the diagnostic terminal.
  • the diagnostic terminal parses the download address according to the upgrade policy.
  • the diagnostic terminal sends a download request to the car cloud server according to the download address.
  • the car cloud server sends the upgrade package to the diagnostic terminal.
  • the car cloud server sends the authorization file to the diagnostic terminal.
  • the diagnostic terminal sends the upgrade package to the vehicle.
  • the diagnostic terminal sends the authorization file to the vehicle.
  • steps S209-S215 are similar to steps S108-S112 in Figure 4.
  • the car cloud server in Figure 7 sends the upgrade policy to the diagnostic terminal, and the diagnostic terminal parses the download address. After that, the diagnostic terminal The terminal sends a download request to the car cloud server, and the car cloud server sends the upgrade package and authorization file to the diagnostic terminal, and the diagnosis terminal forwards the upgrade package and authorization file to the vehicle.
  • the car cloud server in Figure 4 directly sends the upgrade policy to the vehicle, and the vehicle parses the download address. After that, the vehicle sends a download request to the car cloud server, and the car cloud server directly sends the upgrade package and authorization file. to vehicles.
  • the diagnostic terminal sends the upgrade package and authorization file to the vehicle through a wired connection.
  • the diagnostic terminal is connected to the OBD port of the vehicle, and the upgrade package is transmitted to the vehicle through the OBD port. vehicle.
  • step S214 may be executed before step S213 or after step S215. It can be seen that step S214 only needs to be executed after step S212, and step S215 only needs to be executed after step S213.
  • the vehicle determines whether the verification of the authorization file has passed.
  • step S218 is executed; otherwise, step S221 is executed.
  • the vehicle determines whether the verification of the upgrade package has passed.
  • step S220 is executed; otherwise, step S221 is executed.
  • steps S216-S221 are similar to steps S113-S118 in Figure 4.
  • the vehicle verification authorization file in step S216 can be automatically triggered by the vehicle to verify the authorization file, or the diagnosis terminal can trigger the verification of the authorization file by the vehicle.
  • the vehicle verification upgrade package in step S218 The vehicle can automatically trigger the verification of the upgrade package, or the diagnostic terminal can trigger the vehicle's verification of the upgrade package.
  • step S220 the vehicle's installation of the upgrade package in the local upgrade scenario may include the following three stages:
  • the installation phase is mainly for the vehicle to flash the data of the upgrade package into the storage of the components to be upgraded.
  • the vehicle can switch the operating mode of the component to be upgraded back to the default session mode, thus ending the vehicle upgrade.
  • the vehicle does not need to be connected to the Internet, and is directly connected to the diagnostic terminal through a wire.
  • the diagnostic terminal takes the lead to complete the vehicle upgrade, and the vehicle will check whether the upgrade package is suitable for the vehicle before upgrading. Check whether the source of the package is legal and whether it has been tampered with. Strictly control the safe operation of the vehicle from the vehicle upgrade stage to ensure the commercial interests of car owners, software suppliers and car manufacturers.
  • the software in the component starts in sequence, and the previous software verifies the safety of the next software. After the verification is passed, the previous software hands over control to the next software, and so on. This completes the safe start of vehicle components.
  • Safe starting of the vehicle may refer to starting a function of the vehicle, such as a first function.
  • a function of the vehicle such as a first function.
  • the vehicle can trigger verification of the authorization file, and after passing the verification, trigger starting of the first function.
  • the following takes the first software to verify the second software during the safe startup of vehicle components as an example to introduce in detail the contents of the vehicle verification method in the safe startup scenario.
  • the second software may be a program upgraded using an upgrade package.
  • Step 1 Start the first software of the vehicle safely.
  • the first software may be software whose security has been verified, or it may be software that has absolute security when secure startup is started. Its absolute security is guaranteed by the hardware mechanism. At this time, the code of the first software is located in a storage area that cannot be tampered with, such as OCR.
  • Step 2 The vehicle verifies the authorization file through the first software.
  • the authorization file is the authorization file of the upgrade package when the second software is upgraded through the upgrade package.
  • the second software may be xloader.
  • the verification of the authorization file includes one or more of the following: verification of the signature of the authorization file, verification of vehicle identity, verification of integrity information, and verification of anti-replay parameters.
  • the verification of the authorization file by the vehicle in the safe start stage is similar to the verification of the authorization file in the upgrade stage.
  • the difference is that the integrity information verified in the safe start stage and the upgrade stage are different.
  • the vehicle verifies the integrity information of the image file of the second software. Specifically, the vehicle can use a hash algorithm to calculate the integrity information of the image file of the second software, and compare the integrity information with the integrity information in the authorization file. If they are consistent, the verification of the integrity information passes, otherwise , the integrity information verification failed.
  • mirroring is a form of file storage and a type of redundancy. The data on one disk has an identical copy on another disk, which is a mirror.
  • the so-called image file is actually similar to an installation package. It produces a specific series of files into a single file in a certain format to facilitate users to download and use, such as a test version of an operating system, a game, etc.
  • the vehicle can perform step 3, otherwise, the vehicle terminates the safe start.
  • Step 3 The vehicle verifies the package signature of the second software.
  • An upgrade package can upgrade one or more software in the component, and the package signature of the second software can be the package signature of one of the upgrade files in the upgrade package.
  • the second software is the software upgraded by using the upgrade package for the vehicle
  • the package signature of the upgrade package is stored in the storage partition of the second software, and the vehicle verifies the package signature of the second software. Verify the package signature of the second software.
  • the process of the vehicle verifying the package signature of the second software is similar to the process of verifying the package signature of the upgrade package during the vehicle upgrade phase.
  • the difference is that during the secure startup phase, the vehicle obtains the package signature of the second software and the public key used to verify the package signature from the storage partition of the second software to complete the verification of the package signature. .
  • the storage partition of the second software also includes other public keys and signatures of other public keys.
  • the verification of the packet signature please refer to the relevant content in the aforementioned step S115, which will not be described again here.
  • the vehicle can perform step 4; otherwise, the vehicle terminates the safe start.
  • step 3 can be executed before step 2.
  • the embodiment of the present application does not limit the execution order.
  • Step 4 The vehicle safely starts the second software.
  • the vehicle can transfer control to the second software, and the vehicle continues to verify the security of the next-level software of the second software (such as third software) through the second software, including verifying the authorization file. and package signature, and so on, until the vehicle has verified all the software of the current vehicle component, and the vehicle safely starts the vehicle component.
  • the vehicle can transfer control to the second software, and the vehicle continues to verify the security of the next-level software of the second software (such as third software) through the second software, including verifying the authorization file. and package signature, and so on, until the vehicle has verified all the software of the current vehicle component, and the vehicle safely starts the vehicle component.
  • the vehicle can receive the authorization file and upgrade package during the upgrade phase, and determine whether to use the upgrade package by verifying the authorization file. After that, during the safe start stage of the vehicle, the vehicle can verify the authorization file again. To prevent attackers from maliciously dismantling components and changing the vehicle’s upgraded data.
  • the upgrade package and authorization file mentioned in the safe start stage are the upgrade packages and authorization files obtained by the vehicle during the upgrade stage.
  • For specific information on obtaining the authorization file please refer to the relevant content of Figure 4 and Figure 7 mentioned above, which will not be discussed here. Repeat.
  • the vehicle identity is used to uniquely identify the currently upgraded vehicle, and further, uniquely represents the currently upgraded components.
  • the identity of the vehicle can be verified to prevent attackers from upgrading the vehicle using upgrade packages from other vehicles or upgrade packages used in the research and development phase that are not applicable to the vehicle.
  • the authorization file can be verified by the domain controller DC that downloaded the authorization file, or by the domain controller DC that downloaded the authorization file and other domain controller DCs.
  • the implementation of vehicle identity mainly involves the following two solutions:
  • the vehicle identity Space_Attr can be The chip ID of the domain controller DC.
  • the vehicle identity Space_Attr can be pre-stored in a non-tamperable storage area of the vehicle. In this way, other people can be prevented from maliciously tampering with the vehicle identity, and the credibility of the vehicle identity during the verification process can be ensured.
  • the vehicle identity Space_Attr can be fused in a one-time programmable (One Time Programmable, OTP) storage area of a chip of the domain controller DC.
  • OTP One Time Programmable
  • the vehicle when the vehicle needs to send asset information to the car cloud server, it can read the vehicle identity identifier Space_Attr from the OTP storage area of the domain controller DC, and then the vehicle verifies the vehicle identity identifier Space_Attr in the authorization file through the domain controller DC. At this time, you can determine whether the verification of the vehicle identity has passed by comparing whether the vehicle identity stored in the OTP storage area of the domain controller DC is consistent with the vehicle identity in the authorization file.
  • the vehicle can verify the electronic control unit ECU through the domain controller DC connected to the electronic control unit ECU.
  • the vehicle identity in the authorization file is the chip ID of the domain controller DC.
  • the verification of the authorization file corresponding to the upgrade package of the electronic control unit ECU can also be completed by itself.
  • the embodiment of the present application does not limit the verification components of the authorization file of the electronic control unit ECU. That is to say, the vehicle identification may be used to identify the first component, and the first component may refer to an upgraded component or a component that manages the upgraded component (eg, a second component).
  • the vehicle identity identifier Space_Attr in the authorization file may include: the chip IDs of the multiple domain controllers DC.
  • vehicle identity is only the chip of component DC1 ID
  • the verification can pass, and vehicle B can trigger the upgrade of component ECU2 in vehicle B without legally obtaining the upgrade package. This allows attackers to exploit this vulnerability and upgrade vehicles without following formal upgrade methods, thereby affecting the commercial interests of car owners, software suppliers and car manufacturers.
  • a vehicle identification tag may be used to identify the first component and the third component.
  • the first component may be an upgrade component, or may be a component that manages the upgrade component (for example, the second component).
  • the vehicle identity identifier Space_Attr in the authorization file may include: the chip IDs of the multiple domain controller DCs, and the signature verification public keys generated by the one or more domain controller DCs.
  • the vehicle identity identifier Space_Attr in the authorization file may include: cores of the multiple domain controllers DC. Slice ID, and signature verification public keys generated by these multiple domain controller DCs.
  • the vehicle identity in the asset information sent by the vehicle to the car cloud server can be different from the vehicle identity in the authorization file returned by the car cloud server.
  • the vehicle identity sent by the vehicle and the vehicle identity returned by the car cloud server please refer to the description of the vehicle identity sent by the vehicle and the vehicle identity returned by the car cloud server in the following example.
  • the vehicle identity mark Space_Attr mainly involves two related stages of the vehicle: the vehicle production line stage and the vehicle upgrade stage.
  • the vehicle production line stage it mainly includes the following steps:
  • the production line equipment tool binds the chip IDs of the first domain controller and the second domain controller, as well as the signature verification public keys generated by the first domain controller and the second domain controller, and uploads them to the car cloud server.
  • the data uploaded by the production line equipment tool includes: socid_one: socid_two, pk_one: pk_two.
  • the data not only indicates the four parameters of the chip ID of the first domain controller and the second domain controller, and the signature verification public key generated by the first domain controller and the second domain controller, but also indicates these four parameters.
  • the binding relationship of the four parameters When the car cloud server obtains one or more of the four parameters, it can find the four parameters related to the one or more parameters based on the binding relationship.
  • the vehicle upgrade stage it mainly includes the following steps:
  • a vehicle When a vehicle sends asset information, it can send the chip ID of at least one domain controller DC (for example, the chip ID of the first domain controller, sociod_one) as the vehicle identity identifier to the car cloud server.
  • DC chip ID of the first domain controller, sociod_one
  • the vehicle cloud server can find multiple domain controls containing the chip ID of the domain controller received during the vehicle production line stage based on the chip ID of at least one domain controller DC.
  • the chip ID of the controller, and the signature verification public keys generated by these multiple domain controllers that is, the chip IDs of the first domain controller and the second domain controller, and the signature verification public keys generated by the first domain controller and the second domain controller. Verification public key.
  • the car cloud server uses the chip IDs of the first domain controller and the second domain controller and the signature verification public keys generated by the first domain controller and the second domain controller as the vehicle identity and puts them into the authorization file. , sent to the vehicle.
  • the vehicle passes the first domain controller and the second domain controller to verify the vehicle identity in the authorization file.
  • the vehicle identity in the asset information sent by the vehicle can be the chip ID of a domain controller DC, such as the chip ID of the first domain controller, but the vehicle identity in the authorization file returned by the car cloud server is multiple.
  • the chip ID of a domain controller and the generated signature verification public key for example, the chip ID of the first domain controller and the second domain controller, and the signature verification public key generated by the first domain controller and the second domain controller. key.
  • the vehicle can only send one parameter, and the vehicle cloud server can find all parameters related to this parameter based on this parameter, and return all parameters to the vehicle together.
  • other parameters related to the parameter may refer to all parameters stored in the car cloud server that have a binding relationship with the parameter.
  • step 4 The above-mentioned vehicle upgrade stage and the detailed verification process of step 4 will be described in detail below through Figure 8 .
  • Figure 8 is a flow chart of interaction between multiple domain controllers when verifying the vehicle identity in the authorization file provided by the embodiment of the present application.
  • these multiple domain controllers take the first domain controller and the second domain controller as an example.
  • the interaction process between the domain controllers is as follows:
  • the first domain controller verifies whether the chip ID of the first domain controller in the authorization file is consistent with the chip ID of the local first domain controller.
  • the authorization file includes: the chip IDs of the first domain controller and the second domain controller, and the public keys generated by the first domain controller and the second domain controller.
  • the first domain controller may first obtain the chip ID of the local first domain controller, and then compare whether the chip ID of the local first domain controller is consistent with the chip ID of the first domain controller in the authorization file. If they are consistent, step S302 is executed.
  • the first domain controller sends the authorization file to the second domain controller.
  • the second domain controller verifies whether the chip ID of the second domain controller in the authorization file is consistent with the chip ID of the local second domain controller.
  • the second domain controller may first obtain the chip ID of the local second domain controller, and then compare whether the chip ID of the local second domain controller is consistent with the chip ID of the second domain controller indicated in the authorization file. If they are consistent, step S304 is executed.
  • the second domain controller uses the signature private key to calculate the signature of the authorization file.
  • the signature private key is the signature private key sk_two in the signature-verification key pair generated by the second domain controller in a secure system environment during the vehicle production line stage.
  • the second domain controller uses the signature private key to sign the parameters in the authorization file to obtain the signature of the authorization file.
  • the second domain controller sends the signature of the authorization file to the first domain controller.
  • the first domain controller verifies the signature of the authorization file using the signature verification public key of the second domain controller in the authorization file.
  • the verification public key is the signature verification public key pk_two in the signature-verification key pair generated by the second domain controller in a secure system environment during the vehicle production line stage.
  • the first domain controller can find the signature verification public key generated by the second domain controller in the authorization file.
  • the first domain controller verifies the signature of the authorization file. Specifically, the first domain controller verifies the signature of the authorization file using the signature verification public key of the second domain controller.
  • the verification of the vehicle identity can be verification of the chip IDs of multiple domain controllers and verification of the signature of the authorization file.
  • the signature verification public key of the second domain controller used in the above vehicle identification is to further ensure the credibility of the information sent by the second domain controller to the first domain controller. If the data transmission process before the domain controller is sufficiently secure, the public key may not be involved in the vehicle identification.
  • the production line equipment tool can only read and upload the chip ID.
  • the vehicle upgrade stage it does not involve using the public key to calculate The signature of the authorization document and the process of using that signature to verify the vehicle's identity.
  • step S301 in addition to verifying the vehicle identity, the domain controller will also verify the anti-replication process. Put the parameters and complete the information Information, etc., for example, in step S301, in addition to verifying the chip ID, the first domain controller will also verify the signature of the authorization file, integrity information, anti-replay parameters, etc., after all verifications pass Only then will step S302 be executed to send the authorization file to the second domain controller. In addition, in step S302, in addition to verifying the chip ID, the second domain controller will also verify the signature of the authorization file, etc. Step S304 will be executed only after all verifications pass. For specific details about the verification process of the authorization file, please refer to the relevant content of the aforementioned steps S107-S108, which will not be described again here.
  • the first domain controller may be a Telematics BOX (Tbox), and the second domain controller may be a cockpit domain controller (CDC).
  • Tbox Telematics BOX
  • CDC cockpit domain controller
  • the vehicle identity identifier Space_Attr in the authorization file specifically includes: socid_Tbox: socid_CDC and pk_Tbox: pk_CDC.
  • socid_Tbox is the chip ID of Tbox
  • socid_CDC is the chip ID of CDC
  • pk_Tbox is the public key generated by Tbox
  • pk_CDC is the public key generated by CDC.
  • pk_Tbox: pk_CDC is used to represent the binding relationship between Tbox and CDC's public key.
  • the structure of the signed authorization file shown in Table 2 is only an illustrative example and does not constitute a limitation on the authorization file.
  • the specific implementation process of the vehicle identity identifier Space_Attr is described above by taking two domain controllers as an example. However, the embodiment of this application does not limit the number of domain controllers involved in verifying the authorization file.
  • the vehicle identity identifier Space_Attr may include the binding relationship of the chip IDs of the three domain controllers and the binding relationship of the public keys generated by the three domain controllers.
  • the anti-replay parameter Time_Attr is used to uniquely identify an upgrade.
  • the anti-replay parameter Time_Attr can be verified to prevent attackers from using old version upgrade packages to upgrade the vehicle.
  • Solution 1 Use Replay Protected MemoryBlock (RPMB) to set the anti-replay parameter Time_Attr
  • RPMB is a storage partition with security features. When data is written to RPMB, the validity of the data will be verified. Only the designated sender can write the data. At the same time, when reading data, a signature mechanism is also provided to ensure that the other party reads it. The data obtained is the internal data of RPMB, not the data forged by the attacker. Therefore, in practical applications, RPMB is usually used to store some data that needs to be prevented from illegal tampering.
  • the anti-replay parameter Time_Attr can be stored in the RPMB of the domain controller.
  • the anti-replay parameter Time_Attr can be designed in the following two ways:
  • the vehicle and the vehicle cloud server can reserve a "secret code".
  • the vehicle verifies the anti-replay parameter Time_Attr, only the "secret code” If they are consistent, the verification of the anti-replay parameter Time_Attr will pass.
  • the anti-replay parameter Time_Attr can be a random number nonce, and the random number is a number that is only valid once.
  • the only valid one time means that when the vehicle upgrades and generates the anti-replay parameter Time_Attr, the random number
  • the nonces are different, that is, each generated anti-replay parameter Time_Attr uniquely represents an upgrade.
  • the vehicle and the vehicle cloud server agree on a random number A during a certain upgrade. Only when the anti-replay parameter Time_Attr sent by the vehicle cloud server to the vehicle during this upgrade is the random number A, the anti-replay parameter The verification of Time_Attr is passed.
  • the anti-replay parameter Time_Attr mainly involves the following implementation process:
  • the vehicle Before the vehicle sends asset information to the vehicle cloud server, the vehicle can randomly generate a string nonce in a secure system environment, such as a TEE environment, and write the string nonce into the RPMB as the anti-replay parameter Time_Attr.
  • a secure system environment such as a TEE environment
  • the vehicle sends the nonce as the anti-replay parameter Time_Attr along with the asset information to the vehicle cloud server.
  • the vehicle cloud server After the vehicle cloud server obtains the nonce, it uses the nonce as the anti-replay parameter Time_Attr in the authorization file and sends it to the vehicle.
  • the vehicle After obtaining the anti-replay parameter Time_Attr in the authorization file, the vehicle reads the anti-replay parameter Time_Attr from the local RPMB and determines the anti-replay parameter Time_Attr in the authorization file. Check whether the replay parameter Time_Attr is consistent with the local anti-replay parameter Time_Attr. If the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter Time_Attr, the anti-replay parameter verification passes; otherwise, the anti-replay parameter verification fails.
  • steps S103-S114 please refer to the relevant content of Figure 4, and will not be described again here.
  • the above only describes in detail the specific implementation process of the anti-replay parameter Time_Attr in the remote upgrade scenario.
  • the specific implementation process of the anti-replay parameter Time_Attr is similar to the remote upgrade scenario, but different What is interesting is that in the near-end upgrade scenario, the vehicle and the vehicle cloud server transfer asset information, signed upgrade packages, and authorization files through the diagnostic terminal, while in the remote upgrade scenario, the vehicle and the vehicle cloud server interact directly, without involving the diagnostic terminal. transit.
  • the anti-replay parameter Time_Attr is generated by the vehicle.
  • the anti-replay parameter Time_Attr can also be generated by the vehicle cloud server and sent to the vehicle.
  • the application embodiment does not limit the device that generates the anti-replay parameter Time_Attr when using random numbers to set the anti-replay parameter Time_Attr.
  • the vehicle and the vehicle cloud server can agree on a counter.
  • the value of the counter can be incremented in one direction according to the version of the upgrade package.
  • the vehicle and the vehicle cloud server can The car cloud server can use the value of this counter as an anti-replay parameter.
  • the anti-replay parameters received by the vehicle are inconsistent with the local anti-replay parameters, it means that the car cloud server Upgrade package sent The version of does not match the version of the upgrade package required for vehicle upgrade.
  • the anti-replay parameter Time_Attr is a value that increases in one direction.
  • the value that increases each time is 1.
  • the anti-replay parameter Time_Attr may be 5
  • the anti-replay parameter Time_Attr may be 6.
  • the anti-replay parameter Time_Attr received by the vehicle is 5
  • it means that the upgrade package sent by the car cloud server may be the upgrade package sent by the vehicle when it is upgraded for the fifth time.
  • the verification of the anti-replay parameter Time_Attr failed.
  • each version of the upgrade package for the vehicle will correspond to an anti-replay parameter, and the anti-replay parameters of different versions are inconsistent.
  • the anti-replay parameter is 7.
  • the upgrade package sent by the car cloud server may be the V6 version upgrade package, which is For an old version of the upgrade package, the vehicle determines that the anti-replay parameter verification fails, and the vehicle cancels the upgrade.
  • the vehicle can be prevented from being upgraded with an old version of the upgrade package, ensuring that each vehicle upgrade is different from the previous upgrade.
  • Figure 9 is a sequence diagram of a vehicle upgrade provided by an embodiment of the present application.
  • the vehicle was successfully upgraded using upgrade packages V1, V2, and V3 at time points T1, T2, and T3 respectively.
  • the counter value will be increased by 1.
  • T1, T2, and T3 vehicles can be successfully upgraded because of the anti-replay in the authorization file 1 received by the vehicle at T1, the authorization file 2 received at T2, and the authorization file 3 received at T3.
  • the parameters are 0, 1, and 2 respectively.
  • the vehicle's local anti-replay parameter is 3. It can be seen that if T4 receives the authorization file 1 and upgrade package V1 sent at T1 again, since the anti-replay parameter in authorization file 1 is 0, which is inconsistent with the local anti-replay parameter, the vehicle will not Upgrading with upgrade package V1 avoids the vehicle being upgraded with the old version upgrade package again. If at T4, the vehicle receives the anti-replay parameter in authorization file 4 as 3, the vehicle can use the upgrade package V4 to upgrade.
  • Scenario 2 The vehicle changes the value of the counter after being upgraded to a vulnerable version
  • the counter will only be incremented by one when the vehicle is upgraded to a vulnerable version.
  • the anti-replay parameters of different versions may be the same. Only when the vehicle has been upgraded to a vulnerable version, the anti-replay parameters will be changed. Changes occur.
  • the value of the vehicle change counter can be triggered by the vehicle cloud server. Specifically, when the car cloud server detects that the vehicle has been upgraded to a vulnerable version, it sends an adjustment instruction to the vehicle. The vehicle can trigger a change in the value of the technical counter based on the adjustment instruction. For example, the value of the counter is increased by 1.
  • the vehicle will only change the value of the counter when it has been upgraded to a vulnerable version, which can reduce the frequency of changing the value of the counter.
  • FIG. 10 is a sequence diagram of another vehicle upgrade provided by an embodiment of the present application.
  • the vehicle was successfully upgraded using upgrade packages V1, V2, and V3 at time points T1, T2, and T3 respectively, and the anti-replay parameter in the authorization file for each upgrade was 0.
  • the vehicle will increase the counter value by 1.
  • the local anti-replay parameter of the vehicle is 1 at this time. It can be seen that if the authorization file 2 and upgrade package V2 sent at T2 are received again at time T5, since the anti-replay parameter in authorization file 2 is 0, which is inconsistent with the local anti-replay parameter, the vehicle will not Upgrading using the upgrade package V2 avoids the vehicle being upgraded with the old version upgrade package again. If at T5, the vehicle receives the anti-replay parameter in authorization file 4 as 1, the vehicle can use the upgrade package V4 to upgrade.
  • the vehicle when using a counter to set the anti-replay parameter Time_Attr, the vehicle can determine the value of the counter before sending asset information to the vehicle cloud server, and use this value as the anti-replay parameter.
  • the replay parameter Time_Attr is written into RPMB, and then this value is used as the anti-replay parameter Time_Attr and is sent to the Che Cloud server along with the asset information. Then the authorization file sent by the Che Cloud server is received and the anti-replay parameter Time_Attr in the authorization file is verified. .
  • step S103 and step S203 may not include the anti-replay parameter Time_Attr.
  • the vehicle and the car cloud server both agree to use a counter to set the anti-replay parameter Time_Attr, that is, under what circumstances the value of the counter is changed, and the initial value of the counter, then the vehicle and the car cloud server can use the counter to set the anti-replay parameter Time_Attr. , determine the anti-replay parameter Time_Attr locally.
  • the vehicle and the vehicle cloud server agree to change the value of the counter every time a version is upgraded, and the initial value is 0. Then when the vehicle is upgraded for the third time, the vehicle and the vehicle cloud server can determine the current anti-replay parameter Time_Attr to be 3.
  • the domain controller can use the RPMB settings in other domain controller DCs to set up defenses.
  • the replay parameter Time_Attr overcomes the defect that some domain controller DCs do not have RPMB and cannot use RPMB to set the anti-replay parameter Time_Attr.
  • the first domain controller completes After verifying other parameters except the anti-replay parameter Time_Attr, the authorization file is sent to the second domain controller, and the second domain controller verifies the anti-replay parameter Time_Attr.
  • the counter value can be stored in NV-Cnt and used as the anti-replay parameter Time_Attr. This can ensure that the anti-replay parameters cannot be tampered with and ensure the credibility of the verification process of the anti-replay parameters.
  • the fusing mechanism is to blow the fuse bit in the chip to change the state of the fuse bit one-time and irreversibly, thereby protecting the The data cannot be tampered with after being stored.
  • NV-Cnt for setting the anti-replay parameter Time_Attr.
  • the initial value of NV-Cnt is 0.
  • the embodiment of the present application does not limit the initial value of NV-Cnt.
  • the vehicle uses the changed value of NV-Cnt as the anti-replay parameter Time_Attr and sends it to the vehicle cloud server along with the asset information.
  • the car cloud server then uses the value of the NV-Cnt as the anti-replay parameter Time_Attr and sends it to the vehicle along with the authorization file.
  • the vehicle After obtaining the anti-replay parameter Time_Attr in the authorization file, the vehicle reads the anti-replay parameter Time_Attr from the local NV-Cnt, and determines whether the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter. Check whether the parameter Time_Attr is consistent. If the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter Time_Attr, the anti-replay parameter verification passes; otherwise, the anti-replay parameter verification fails.
  • the counter value changes every time the vehicle upgrades to a version, and the vehicle upgrades to a new version.
  • the value of the counter is changed once after the version of the vulnerability is released.
  • the numerical change of NV-Cnt is guaranteed by the hardware mechanism, the numerical change is irreversible, and the number of digits of V-Cnt is fixed, so the number of numerical changes of NV-Cnt is limited.
  • 32-bit NV-Cnt supports up to 32 fusing times, that is, NV-Cnt can only support changing values up to 32 times. It can be seen that changing the counter value after the vehicle has been upgraded to a vulnerable version can reduce the number of changes to the NV-Cnt value, extend the use time of the chip as much as possible, and avoid frequent replacement of vehicle parts.
  • the second solution when verifying the authorization file in the secure boot scenario, compared to the first solution, using the second solution to set the anti-replay parameter Time_Attr can improve the vehicle detection efficiency. This is because the secure startup of components is a step-by-step verification process for each software in the startup chain, and RPMB can only be verified at the later stage of the startup chain. Therefore, it cannot protect the security of the front end of the startup chain, and the verification efficiency is low.
  • the anti-replay parameter Time_Attr set by NV-Cnt can protect the security of the front end of the startup chain and improve verification efficiency.
  • Solution 3 Combine RPMB and NV-Cnt to set the anti-replay parameter Time_Attr
  • the anti-replay parameter Time_Attr can include: the random number nonce stored in the RPMB of the domain controller DC, and the value of NV-Cnt in the domain controller DC.
  • Table 3 illustrates another possible structure of the signed authorization file provided by the embodiment of the present application.
  • the anti-replay parameter Time_Attr in the authorization file specifically includes: NV-Cnt_CDC, nonce_CDC.
  • NV-Cnt_CDC is the value in NV-Cnt of CDC
  • nonce_CDC is the random number generated by CDC.
  • the upgraded component is an electronic control unit ECU
  • the verification of the authorization file corresponding to the electronic control unit ECU can be verified by its connected domain controller DC
  • the anti-replay parameters The setup can be done by this domain controller DC.
  • the anti-replay parameters in the authorization file corresponding to the electronic control unit ECU are generated by the domain controller DC to which it is connected.
  • the anti-replay parameters are parameters agreed between the car cloud server and the vehicle to identify the local upgrade of the vehicle.
  • the anti-replay parameters can be updated with each upgrade of the vehicle, so this is the anti-replay parameter.
  • the parameters are only used for one upgrade of the logo.
  • the anti-replay parameters can also be updated from time to time. In this case, the anti-replay parameters can be updated under preset circumstances. For example, the car cloud server discovers the existence of an old version upgrade package that has been sent. When a vulnerability occurs, the vehicle is notified to follow the vehicle cloud server and update the anti-replay parameters simultaneously.
  • the integrity information Integrity_Attr is used to uniquely identify this upgrade and the upgrade package sent by the Che Cloud server.
  • the integrity information Integrity_Attr in the authorization file can be used to uniquely identify the upgrade package sent by the vehicle cloud server. That is to say, when the vehicle receives the upgrade package and the authorization file of the upgrade package, the vehicle can determine whether the authorization file is the authorization file of the upgrade package received by the vehicle by verifying the integrity information Integrity_Attr, or replace it with In other words, determine whether the upgrade package received by the vehicle is complete or has been tampered with. In this way, attackers can be prevented from forging upgrade packages and using fake upgrade packages to upgrade vehicles, ensuring the safety of vehicle upgrades.
  • the integrity information Integrity_Attr in the authorization file can be used to uniquely identify the vehicle's upgraded software data after it is upgraded according to the upgrade package sent by the vehicle cloud server.
  • the vehicle can determine whether the vehicle's data is based on the integrity information Integrity_Attr during safe startup.
  • the software data after the upgrade package is upgraded. In this way, it can be prevented that after the vehicle is upgraded, the attacker can directly disassemble the vehicle, illegally import the upgrade package into the vehicle components, and change the software data of the vehicle components.
  • the integrity information Integrity_Attr contains different contents.
  • the integrity information Integrity_Attr is introduced below according to different vehicle upgrade methods.
  • Full upgrade means that when a vehicle is upgraded, the vehicle is upgraded by downloading the complete software data and directly moving the downloaded software data to the location where the software runs.
  • the integrity information Integrity_Attr may include the hash value Hash[] of the upgrade package, which is a hash value calculated using a hash algorithm for the upgrade package.
  • Differential upgrade means that when a vehicle is upgraded, it is implemented by downloading the incremental part that is different from the old version of the software data, then using the algorithm to synthesize the upgraded version of the software data based on the incremental part, and then moving it to the location where the software runs.
  • Vehicle upgrades
  • the upgrade package sent by the car cloud server only contains software data that is different before and after the component upgrade.
  • the upgrade package sent by the car cloud server can also be called a differential package.
  • the authorization file sent by the vehicle cloud server to the vehicle contains two integrity information, and different integrity information is verified during the vehicle upgrade stage and the safe startup stage.
  • the hash value Hash_full[] of the image file may also be called the second integrity information.
  • A/B upgrade means ensuring the normal operation of one system and upgrading the other system during the upgrade process.
  • the integrity information Integrity_Attr may include: the hash value Hash_update[] of the upgrade package, and the hash value Hash_rollback[] of the rollback file.
  • the hash value Hash_update[] of the upgrade package is the hash value calculated using the hash algorithm for the upgrade package.
  • the hash value Hash_diff[] of the upgrade package is used to verify the integrity information when verifying the authorization file during the vehicle upgrade phase and secure startup phase.
  • the hash value Hash_rollback[] of the rollback file is the hash value calculated by combining the current vehicle data and the upgraded data. This rollback file contains the data contained in the parts when the vehicle part upgrade fails and is rolled back to the original version.
  • the hash value Hash_rollback[] of the rollback file is used to verify the data in the vehicle after the vehicle upgrade fails.
  • the vehicle cloud server can determine the vehicle upgrade method based on the software and hardware information of the asset information terminal, thereby determining the integrity information that needs to be sent to the vehicle.
  • the hash value Hash_rollback[] of the rollback file may also be called the third integrity information.
  • the integrity information Integrity_Attr has different expression forms for different components that are upgraded. The following combines two solutions to introduce the integrity information Integrity_Attr.
  • the integrity information Integrity_Attr may refer to a value calculated using a hash algorithm for the entire upgrade package.
  • This method of calculating hash values for the entire upgrade package can speed up the verification of integrity information.
  • the vehicle only needs to calculate the hash value of the upgrade package when verifying the authorization file, and determine whether the hash value matches the integrity information in the authorization file. If the information is consistent, you can determine whether the integrity information verification has passed.
  • the vehicle only needs to calculate the hash value of the entire software of the vehicle component when verifying the authorization file, and determine whether the hash value is consistent with the complete new information in the authorization file. Whether the integrity information verification passes.
  • the integrity information Integrity_Attr may refer to multiple hash values calculated using a hash algorithm on multiple upgrade files included in the upgrade package.
  • the integrity information Integrity_Attr is represented as an array containing multiple values.
  • This method of calculating the hash value of the upgrade file can make the integrity check of the upgrade package more accurate. Based on these multiple hash values, the vehicle can more accurately know that during the transmission of the upgrade package, the upgrade package has been damaged. The tampered part, or the software part of the component that was tampered with during the vehicle start-up phase.
  • the integrity information may include one or more parameters, and the one or more parameters may be used to identify the upgrade package.
  • the integrity information Integrity_Attr can be set comprehensively based on the vehicle upgrade method and vehicle upgrade components.
  • the integrity information Integrity_Attr is the hash value calculated for the entire upgrade package of the component.
  • the integrity information Integrity_Attr can include the hash values of multiple upgrade files in the upgrade package, as well as multiple complete images after the upgrade. The hash value of the file.
  • the car cloud server Since the signature of the authorized file is encrypted using the authorized private key generated by the CheCloud server, and the verification of the signature is also implemented through the authorized public key provided by the CheCloud server, in order to prevent attackers from forging the authorized private key and To authorize the public key to tamper with the authorization file, the car cloud server needs to have a verification mechanism that can verify the legitimacy of the authorized public key when it provides the authorized public key for verifying the signature.
  • the legality of the authorization public key can be verified first.
  • Option 1 The vehicle pre-stores in the chip the hash value of the authorized public key used to verify the signature of the authorized file.
  • the vehicle can reserve a fuse bit in the OTP of the chip for storing the hash value of the authorized public key for verifying the signature of the authorized file. It can be seen that storing the hash value of the authorized public key in OTP can prevent attackers from tampering with the hash value of the authorized public key stored locally in the vehicle, ensuring the credibility of the verification mechanism when verifying the legitimacy of the authorized public key. Spend.
  • the hash algorithm can be used to calculate the hash value of the authorization public key in the authorization file, and then the hash value is compared with the authorization stored locally in the vehicle for verifying the signature of the authorization file. Compare the hash value of the public key. If the two are consistent, it means that the authorized public key in the authorization file is legal and has not been tampered with. Otherwise, it means that the authorized public key in the authorization file is illegal.
  • the authorization file does not need to contain the legality proof pk_validity_proof of the authorization public key.
  • Solution 2 Reuse the public key to verify the package signature
  • the Cheyun server After the Cheyun server generates a key pair for encrypting and verifying the signature of the authorized file, it can send the authorized public key in the key pair to the supplier server, and the supplier server uses the private key to generate the package signature.
  • the authorized public key is encrypted, the signature of the authorized public key is obtained, and the signature is sent to the car cloud server. In this way, when the vehicle obtains the authorized public key in the authorization file and the signature of the authorized public key, the legitimacy of the authorized public key can be verified through the public key used to verify the package signature.
  • the legality proof of the authorized public key can be the signature obtained when the supplier server uses the private key to generate the package signature and digitally signs the authorized public key.
  • the supplier server uses the private key to generate the packet signature, and the obtained signature of the authorization file may also be called a second signature.
  • the vehicle can calculate the message digest of the authorized public key in the authorization file, and use the public key used to decrypt the package signature to decrypt the legality certificate of the authorized public key in the authorization file, obtaining A message digest.
  • the vehicle can determine whether the message digest in the authorization file has not been tampered with by comparing the message digest with the calculated message digest of the authorization public key in the authorization file. If the two are consistent, it indicates authorization.
  • the authorized public key in the file is legal and has not been tampered with. Otherwise, it means that the authorized public key in the authorization file is illegal.
  • the CheCloud server can generate a key pair on its own to forge the package signature in the upgrade package, thus causing a problem between the supplier server and the CheCloud server. Confusion about signature capabilities.
  • the package signature is obtained by the supplier's server using a third-level key to sign the upgrade file, when the vehicle verifies the package signature, it needs to be verified three times to finally complete the verification of the package signature.
  • the relevant content in the aforementioned step S115 please refer to the relevant content in the aforementioned step S115.
  • the legality proof of the authorized public key is the signature of the authorized public key by the supplier server using the wrapped root private key in the third-level key. Then the car cloud server can generate a pair of keys at the next level of the authorized public key and authorized private key, and use the private key in the key pair to sign the upgrade package.
  • the vehicle verifies the signature
  • the effect of vehicle verification three times can also be achieved, and the verification of the signature and the verification of the packaged signature generated by the supplier server start from verifying the packaged root public key generated by the supplier server. It can be seen that the Cheyun server can forge the possibility of compiling signatures, which reduces the credibility of verification of compilation signatures.
  • the signature capabilities of the supplier server and the car cloud server can be distinguished by specifying the purpose of the authorized public key, or by using multi-level keys to set the signature of the authorized public key.
  • the purpose of the authorized public key means that when the car cloud server sends the authorized public key to the vehicle, it also includes the purpose information of the authorized public key. This purpose information is used to indicate that the authorized public key can only be used to verify authorization. Sign the file, thereby distinguishing the signature capabilities of the supplier server and the car cloud server from the use of public keys. For example, the usage information can be stored in the usage field.
  • the number of verifications when verifying the signature of the authorized public key should be greater than the number of verifications when verifying the packaged signature, so as to distinguish the supplier from the number of verifications Signature capabilities of servers and car cloud servers.
  • Figure 11 is a flow chart of the interaction between the supplier server and the car cloud server when multi-level keys are used to set the signature of the authorized public key provided by the embodiment of the present application.
  • the interaction process between the supplier server and the car cloud server includes:
  • the car cloud server sends the authorized public key to the supplier server.
  • the authorization public key is the public key generated by the car cloud server and used to verify the signature of the authorization file.
  • the signature of the authorization file is obtained by using the authorization private key to sign the authorization file on the Cheyun server.
  • the authorized public key please refer to the foregoing content and will not be repeated here.
  • the supplier server generates N pairs of keys.
  • N ⁇ M-1, and N is a positive integer.
  • the supplier server uses the wrapped root private key and the N pairs of keys to sign the authorized public key.
  • the package root private key is the first-level private key among the multi-level keys used to implement package signature.
  • the N pairs of keys may include: the first public key and the first private key, the second public key and the second private key, ..., the Nth public key and the Nth private key.
  • the supplier server can use the wrapped root private key to sign the first public key to obtain the signature of the first public key. , use the first private key to sign the second public key, and obtain the signature of the second public key..., use the Nth private key to sign the authorized public key, and obtain the signature of the authorized public key, thereby realizing the use of multi-level encryption
  • the key sets the signature of the authorized public key.
  • the following uses a specific example to describe how the supplier server uses the wrapped root private key and the N pairs of keys to implement the signature of the authorized public key.
  • the supplier server uses a three-level key to implement package signature and generates 2 pairs of keys for signing the authorization file.
  • FIG. 12 is a schematic structural diagram of a multi-level key provided by an embodiment of the present application.
  • the packaged root public key and packaged root private key, packaged layer 2 public key and packaged layer 2 private key, packaged layer 3 public key and packaged layer 3 private key shown in Figure 12 are the suppliers.
  • a third-level key generated by the server. This third-level key is used to complete the package signature of the upgrade file in the upgrade package.
  • the one-vehicle-authorization public key and one-vehicle authorization private key, the authorization root public key, and the authorization root private key shown in Figure 12 are two pairs of keys generated by the supplier server to implement the signature of the authorization file.
  • the supplier server can use the packaged root private key to sign the one-vehicle-authorized public key to obtain the signature of the one-vehicle-authorized public key, and use the one-vehicle authorized private key to sign the authorized root public key to obtain authorization.
  • the authorized root private key For the signature of the root public key, use the authorized root private key to sign the authorized public key to obtain the signature of the authorized public key.
  • the authorized root public key Verify the signature of the authorized public key, and verify the signature of the authorized file with the authorized public key. This is a four-step verification process. This can avoid the problem of the CheCloud server generating a key pair on its own to forge the package signature of the upgrade package.
  • the supplier server sends the signature of the authorized public key to the car cloud server.
  • the supplier server can send the signature of the authorized public key to the CheCloud server as proof of the legality of the authorized public key, thereby achieving the purpose of reusing the public key for verification and package signature to verify the legality of the authorized public key.
  • vehicle manufacturer A vehicles produced by vehicle manufacturer A
  • vehicle cloud server A the server of vehicle manufacturer A
  • vehicle manufacturer B Vehicles produced by vehicle manufacturer B
  • vehicle cloud server A vehicle manufacturer A's server
  • Server B (hereinafter referred to as Cheyun Server B) obtains the upgrade package and completes the upgrade.
  • Figure 13 is a logical schematic diagram of the supplier server signing the authorized public keys of multiple car cloud servers provided by the embodiment of the present application.
  • car cloud server A and car cloud server B that sign the authorized public key through the supplier server.
  • the supplier server uses the key generator Kg(1 n ) to generate a pair of keys (pk, sk), where sk is the package secret used to package the upgrade file x with the package signature Sig(sk,x). key, pk is the packet public key used to verify the packet signature ⁇ x .
  • Cheyun server A uses the key generator Kg(1 n ) to generate a pair of keys (pk A , sk A ), where sk A is used to sign the authorization file auth_doc A Sig (sk A , auth_doc A ) Authorization private key, pk A is the authorization public key used to verify the signature ⁇ auth_doc A of the authorization file auth_doc A.
  • Cheyun server B uses the key generator Kg(1 n ) to generate a pair of keys (pk B , sk B ) , where sk B is the authorization private key used to sign the authorization file auth_doc B Sig (sk B , auth_doc B ), and pk B is the authorization public key used to verify the signature ⁇ auth_doc B of the authorization file auth_doc B.
  • the car cloud server A can send pk A to the supplier server, and the supplier server can use sk to sign the pk A , that is, Sig(sk,pk A ), get the signature ⁇ A of pk A , and return it to the car cloud server A.
  • Cloud server A can send pk A to the supplier server, and the supplier server can use sk to sign the pk A , that is, Sig(sk,pk A ), get the signature ⁇ A of pk A , and return it to the car cloud server A.
  • Cloud server A can send pk A to the supplier server, and the supplier server can use sk to sign the pk A , that is, Sig(sk,pk A ), get the signature ⁇ A of pk A , and return it to the car cloud server A.
  • the car cloud server B can send pk B to the supplier server, and the supplier server can use sk to sign the pk B , that is, Sig(sk,pk B ), get the signature ⁇ B of pk B , and return it to the car cloud server B.
  • Cloud server B can send pk B to the supplier server, and the supplier server can use sk to sign the pk B , that is, Sig(sk,pk B ), get the signature ⁇ B of pk B , and return it to the car cloud server B.
  • Cloud server B can send pk B to the supplier server, and the supplier server can use sk to sign the pk B , that is, Sig(sk,pk B ), get the signature ⁇ B of pk B , and return it to the car cloud server B.
  • Distinguishing the authorized public keys of the car cloud servers of different vehicle manufacturers is to avoid the loss of the authorized private keys of the car cloud servers of some vehicle manufacturers, which will also affect other vehicle manufacturers. That is to say, after the vehicle obtains the authorization file, it can first determine whether the generator of the authorization public key in the authorization file is the target car manufacturer, and then decide whether to use the authorization public key to verify the legality of the authorization file.
  • the vehicle manufacturer can use a black/white list to set the target vehicle manufacturer.
  • the authorization public key generated by the vehicle manufacturer in the white list is a public key that is allowed to be used to verify the authorization file
  • the authorization public key generated by the vehicle manufacturer in the black list is
  • Authorization public key is a public key that is not allowed to be used to verify authorized files.
  • the vehicle manufacturer can send the whitelist to the vehicle in advance before the vehicle verifies the authorization file.
  • the vehicle first determines the authorization public key before verifying the legality of the authorization file. Is the generator in the whitelist a car manufacturer? If so, the vehicle can use the authorized public key to verify the legality of the authorized file. Otherwise, the vehicle cannot use the authorized public key to verify the legality of the authorized file.
  • the vehicle manufacturer can send the black/white list to the supplier server before providing the black/white list, and the key pair generated by the supplier server sets the black/white list sign. Further, the supplier server can use multi-level keys to set the signature of the black/white list.
  • the following uses a specific example to describe how the supplier server uses multi-level keys to set the signature of the black/white list.
  • FIG. 14 is a schematic structural diagram of another multi-level key provided by an embodiment of the present application.
  • authorized public key A and authorized private key A Key pair generated for car factory server A, authorized public key B and authorized public key B
  • the key pair generated for the car factory server B, the packaged root public key (pk 1 ) and the packaged root private key (sk 1 ), the one-vehicle-one-authorization public key (pk 2 ) and the one-vehicle-one-authorization private key (sk 2 ), authorized root public key and authorized root private key A key pair generated by the supplier server to set the signature of the authorized public key A of the car manufacturer server A and the authorized public key B of the car manufacturer server B.
  • I won’t go into details here.
  • the supplier server can also generate a pair of keys: the permission public key and license private key And use the one-vehicle-one-authorized private key to sign the license public key to obtain the signature of the license public key. Use the license private key to sign whitelist A and whitelist B to obtain the signature of whitelist A and the signature of whitelist B.
  • the car manufacturer's server can send a permission list to the vehicle, and the permission list can include: a whitelist set by the vehicle manufacturer, and the signature of the whitelist.
  • Table 4 shows the structure of authorization file A
  • Table 5 shows the structure of authorization file B
  • Table 6 shows the structure of the permission list A sent by car manufacturer server A
  • Table 7 shows the structure of car manufacturer server B.
  • the authorization file A may include three parts: attribute field M 1 , signature field and authorized public key field.
  • the attribute domain M 1 may include: vehicle identity identifier Space_Attr1, anti-replay parameter Time_Attr1, and integrity information Integrity_Attr1.
  • the signature domain includes the car cloud server A using its own authorized private key.
  • the authorized public key field includes: authorized public key and, for verification Multiple parameters for the legality of Signature Sig(sk 1 ,pk 2 ) of key pk 2 , authorized root public key Authorized root public key signature Authorized public key signature Among them, the authorized public key Used to verify signature Authorized root public key Used for school Verification signature One vehicle, one authorized public key pk 2 is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
  • the authorization file B may include three parts: attribute field M 2 , signature field and authorized public key field.
  • the attribute domain M 2 may include: vehicle identity identifier Space_Attr2, anti-replay parameter Time_Attr2, and integrity information Integrity_Attr2.
  • the signature domain includes the car cloud server B using its own authorized private key.
  • the authorized public key field includes: authorized public key and, for verification Multiple parameters for the legality of Signature Sig(sk 1 ,pk 2 ) of key pk 2 , authorized root public key Authorized root public key signature Authorized public key signature Among them, the authorized public key Used to verify signature Authorized root public key Used to verify signature One vehicle, one authorized public key pk 2 is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
  • the permission list A may include three parts: attribute domain M A , signature domain and key chain domain.
  • the attribute domain M A may include: vehicle identity identifier Space_Attr1, anti-replay parameter Time_Attr1 and whitelist public key
  • the signing domain includes the vendor server with its own licensing private key
  • the key chain domain includes: packaged root public key (pk 1 ), one-car-one-authorized public key (pk 2 ), one-car-one authorized public key (pk 2 ) signature Sig (sk 1 , pk 2 ), license public key key License public key signature Among them, the license public key Used to verify signature One vehicle, one authorized public key (pk 2 ) is used to verify signatures
  • the packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
  • the permission list B may include three parts: the attribute field MB , the signature field and the key chain field.
  • the attribute domain M B may include: vehicle identity identifier Space_Attr2, anti-replay parameter Time_Attr2 and whitelist public key
  • the signing domain includes the vendor server with its own licensing private key
  • the key chain domain includes: packaged root public key (pk 1 ), one-car-one-authorized public key (pk 2 ), one-car-one authorized public key (pk 2 ) signature Sig (sk 1 , pk 2 ), license public key License public key signature Among them, the license public key Used to verify signature One vehicle, one authorized public key (pk 2 ) is used to verify signatures
  • the packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
  • the signature in the signature field is used to prove the legality of the attribute field MB .
  • the key chain field contains the public key used to verify the signature and the legality certificate of the public key.
  • the permission list or black/white list may also be called the first list.
  • the permission list may contain more or fewer parameters.
  • the attribute field can contain only whitelist public keys, and when the supplier server uses more or fewer levels of key pairs to set up the whitelist's signature, the keychain field can contain more or fewer public keys. key and public key signature.
  • the vehicle upgrade verification method can verify the upgrade package received by the vehicle during the vehicle upgrade stage, only when the upgrade package is an upgrade package suitable for the current upgrade of the vehicle. , the vehicle upgrade is triggered.
  • the upgrade package is not applicable to the vehicle, for example, an upgrade package for an old version, an upgrade package for other vehicles, or an upgrade package used in the research and development phase, the vehicle upgrade will be cancelled.
  • this method can also Triggers the verification of vehicle upgraded data. Only when the vehicle upgraded data is the data obtained through the vehicle upgrade stage and the upgrade package, the vehicle can be started to run. This avoids malicious disassembly by attackers and will not be applicable. Import the vehicle's upgrade package into the vehicle and change the vehicle's data to ensure vehicle safety.
  • each step in the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the method steps disclosed in conjunction with the embodiments of this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • This application also provides an electronic device, which may include a memory and a processor.
  • the memory can be used to store computer programs; the processor can be used to call the computer program in the memory, so that the electronic device executes the method executed by the supplier server, vehicle cloud server or vehicle in any of the above embodiments.
  • This application also provides a chip system that includes at least one processor for implementing the functions involved in the method executed by the supplier server, vehicle cloud server, or vehicle in any of the above embodiments.
  • the chip system further includes a memory, the memory is used to store program instructions and data, and the memory is located within the processor or outside the processor.
  • the chip system can be composed of chips or include chips and other discrete devices.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be implemented in hardware or software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software code stored in memory.
  • the memory may be integrated with the processor or may be provided separately from the processor, which is not limited by the embodiments of the present application.
  • the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be separately provided on different chips.
  • the embodiments of this application vary on the type of memory, and The arrangement of the memory and processor is not specifically limited.
  • the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC). It can also be a central processor (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), or a microcontroller (micro controller unit (MCU), or a programmable logic device (PLD) or other integrated chip.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • CPU central processor unit
  • NP network processor
  • DSP digital signal processing circuit
  • MCU microcontroller
  • PLD programmable logic device
  • the present application also provides a computer program product.
  • the computer program product includes: a computer program (which can also be called a code, or an instruction). When the computer program is run, it causes the computer to execute any of the above embodiments. A method executed by any one of the server, vehicle cloud server or vehicle.
  • This application also provides a computer-readable storage medium that stores a computer program (which may also be called a code, or an instruction).
  • a computer program which may also be called a code, or an instruction.
  • the computer program When the computer program is run, the computer is caused to execute the method executed by any one of the supplier server, vehicle cloud server, or vehicle in any of the above embodiments.
  • the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capabilities.
  • each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an AP 800plication specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC AP 800plication specific integrated circuit
  • FPGA field programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the disclosed method can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the embodiment of the present application also provides a device.
  • the device may specifically be a component or module, and the device may include one or more connected processors and memories. Among them, memory is used to store computer programs. When the computer program is executed by one or more processors, the device is caused to execute the methods in each of the above method embodiments.
  • the devices, computer-readable storage media, computer program products or chips provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be described again here.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed in the present application are a vehicle verification method, and a related apparatus and system. The method mainly relates to a vehicle and a server, wherein the vehicle can receive a vehicle identity identifier and/or an anti-replay parameter, and integrity information and an upgrade package, which are sent by the server. During the upgrade of the vehicle, upon determining that the vehicle identity identifier, which is sent by the server, is consistent with a local vehicle identity identifier, and/or the anti-replay parameter, which is sent by the server, is consistent with a local anti-replay parameter, and the integrity information, which is sent by the server, is consistent with integrity information which is calculated according to the upgrade package that is sent by the server, the vehicle can be upgraded according to the upgrade package, wherein the vehicle identity identifier is used for identifying the vehicle, and the anti-replay parameter is used for identifying the present upgrade. In this way, a vehicle can be prevented from being upgraded using an upgrade package that is not suitable for the vehicle, for example, an upgrade package of an earlier version, upgrade packages of other vehicles, and an upgrade package which is used in a research and development stage.

Description

车辆校验方法、相关装置及系统Vehicle verification methods, related devices and systems
本申请要求于2022年06月01日提交中国专利局、申请号为202210618805.7、申请名称为“车辆校验方法、相关装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on June 1, 2022, with the application number 202210618805.7 and the application name "Vehicle Verification Method, Related Devices and Systems", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及车联网、通信技术领域,尤其涉及车辆校验方法、相关装置及系统。This application relates to the field of Internet of Vehicles and communication technologies, and in particular to vehicle verification methods, related devices and systems.
背景技术Background technique
随着汽车领域车联网技术的不断发展,车辆上搭载的软硬件越来越多,使得车辆的软件功能越来越复杂。而在车辆的运行过程中及技术的不断发展下,某些软件功能也会逐渐显露出其存在的缺陷或其落后性,因此需要对车辆进行不断的升级更新,优化软件功能或开发新的软件功能,提升车辆的性能,实现车辆的智能化。With the continuous development of Internet of Vehicles technology in the automotive field, more and more software and hardware are installed on vehicles, making the vehicle's software functions more and more complex. During the operation of the vehicle and the continuous development of technology, certain software functions will gradually reveal their flaws or backwardness. Therefore, it is necessary to continuously upgrade and update the vehicle, optimize software functions or develop new software. function, improve the performance of the vehicle and realize the intelligence of the vehicle.
发明内容Contents of the invention
本申请提供了车辆校验方法、相关装置及系统,实现了车辆的安全升级或安全启动,保障了车辆的安全。This application provides vehicle verification methods, related devices and systems, realizes the safe upgrade or safe start of the vehicle, and ensures the safety of the vehicle.
第一方面,本申请提供了一种车辆校验方法,其特征在于,方法包括:车辆接收到第一文件和第一升级包,第一文件包括:第一车辆标识,第一完整性信息,和,根据第一车辆标识以及第一完整性信息确定的第一签名;车辆使用第一服务器的公钥校验第一签名,且校验通过;第一服务器用于管理车辆的升级;车辆确定第一车辆标识与车辆的车辆标识相同,且,第一升级包为第一完整性信息指示的升级包;车辆根据第一升级包进行升级,以增强第一功能或增加第一功能。In a first aspect, this application provides a vehicle verification method, which is characterized in that the method includes: the vehicle receives a first file and a first upgrade package, and the first file includes: a first vehicle identification, first integrity information, and, the first signature determined based on the first vehicle identification and the first integrity information; the vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle is determined The first vehicle identification is the same as the vehicle identification, and the first upgrade package is an upgrade package indicated by the first integrity information; the vehicle is upgraded according to the first upgrade package to enhance the first function or add the first function.
实施本申请实施例提供的方法,车辆可以在需要升级时,获取到授权文件和升级包,在使用升级包进行升级之前,车辆会对授权文件进行校验,包括:车辆身份标识的校验、完整性信息的校验、签名的校验。其中,校验签名是为了判断授权文件是否由管理车辆升级的车云服务器发送,以及授权文件是否被第三方篡改,校验完整性信息是为了判断接收到的升级包,是否为车云服务器同该授权文件一起发送的升级包,避免第三方将车云服务器一起发送的升级包和授权文件中的升级包替换成其他升级包,校验车辆身份标识是为了判断接收到的升级包是否为车云服务器专门发送给该车辆的升级包,避免混用车云服务器给其他车辆发送的用于升级的升级包,或者使用未携带车辆身份标识的升级包。在授权文件的校验通过后,车辆即可使用该升级包进行升级。By implementing the method provided by the embodiments of this application, the vehicle can obtain the authorization file and upgrade package when it needs to be upgraded. Before using the upgrade package for upgrade, the vehicle will verify the authorization file, including: verification of the vehicle identity, Verification of integrity information and verification of signatures. Among them, the purpose of verifying the signature is to determine whether the authorization file is sent by the car cloud server that manages vehicle upgrades, and whether the authorization file has been tampered with by a third party. The purpose of verifying the integrity information is to determine whether the received upgrade package is the same as the car cloud server. The upgrade package sent together with the authorization file prevents third parties from replacing the upgrade package sent together with the car cloud server and the upgrade package in the authorization file with other upgrade packages. The purpose of verifying the vehicle identity is to determine whether the received upgrade package is a vehicle The cloud server sends the upgrade package specifically to the vehicle to avoid mixing upgrade packages sent by the vehicle cloud server to other vehicles for upgrade, or using upgrade packages that do not carry the vehicle identity. After the authorization file is verified, the vehicle can be upgraded using the upgrade package.
这样,一方面,可以避免车辆使用车云服务器发送给其他车辆的升级包进行升级,例如车主从非官方渠道获取到的官方发送给其他车辆的升级包,以更低或免费的价格完成车辆的升级,避免损害车厂和软件供应商的利益;另一方面,车辆可以校验升级包是否由可信的服务器发送给,只使用可信服务器发送过的升级包进行升级,由于服务器并不会将不用于授权的升级包,例如研发阶段使用的升级包、携带病毒的升级包、存在漏洞的升级包等等发送给车辆,因此车辆只会根据安全的升级包进行升级,保障了车辆使用升级包进行升级的安全性。 In this way, on the one hand, the vehicle can be prevented from being upgraded using the upgrade package sent by the car cloud server to other vehicles. For example, if the owner obtains the official upgrade package sent to other vehicles from unofficial channels, the vehicle can be upgraded at a lower or free price. Upgrade to avoid harming the interests of car manufacturers and software suppliers; on the other hand, the vehicle can verify whether the upgrade package is sent by a trusted server, and only use the upgrade package sent by the trusted server for upgrade, because the server will not Upgrade packages that are not used for authorization, such as upgrade packages used in the research and development stage, upgrade packages carrying viruses, upgrade packages with vulnerabilities, etc., are sent to the vehicle. Therefore, the vehicle will only be upgraded according to the safe upgrade package, ensuring that the vehicle uses the upgrade package. Security for making upgrades.
结合第一方面,在一种实施方式中,车辆根据第一升级包进行升级之后,方法还包括:车辆再次使用第一服务器的公钥校验第一签名,并且校验通过,车辆再次确定第一车辆标识与车辆的车辆标识相同,且,升级后的车辆的数据包括第一完整性信息指示的升级包中的数据;车辆启动第一功能。In conjunction with the first aspect, in one implementation, after the vehicle is upgraded according to the first upgrade package, the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and if the verification passes, the vehicle determines the first signature again. A vehicle identification is the same as the vehicle identification, and the upgraded vehicle data includes data in the upgrade package indicated by the first integrity information; the vehicle activates the first function.
进一步地,车辆除了在升级阶段进行授权文件的校验外,还可以在安全启动阶段再次校验授权文件,只有授权文件的校验通过后,车辆才会进行启动,这样,可以避免任何未经授权的软件程序在车辆中运行,保证车辆运行的软件程序来源于升级阶段,授权文件校验通过后,安装的升级包,避免车辆运行车云服务器发送给其他车辆的升级包中的软件程序,或者,研发阶段使用的升级包中的软件程序等等,保证了车辆的安全运行。Furthermore, in addition to verifying the authorization file during the upgrade stage, the vehicle can also verify the authorization file again during the safe start stage. Only after the verification of the authorization file passes, the vehicle will be started. In this way, any unauthorized access can be avoided. The authorized software program runs in the vehicle. The software program that ensures the operation of the vehicle comes from the upgrade stage. After the authorization file is verified and passed, the upgrade package is installed to prevent the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles. Or, the software programs in the upgrade package used in the research and development stage ensure the safe operation of the vehicle.
第二方面,本申请提供了另一种车辆校验方法,方法包括:车辆接收到第一文件和第一升级包,第一文件包括:第一防重放参数,第一完整性信息,和,根据第一防重放参数和第一完整性信息确定的第一签名;车辆使用第一服务器的公钥校验第一签名,且校验通过;第一服务器用于管理车辆的升级;车辆确定第一防重放参数与车辆的防重放参数相同,且,第一升级包为第一完整性信息指示的升级包;车辆的防重放参数用于标识车辆本次的升级;车辆根据第一升级包进行升级,以增强第一功能或增加第一功能。In a second aspect, this application provides another vehicle verification method. The method includes: the vehicle receives a first file and a first upgrade package. The first file includes: a first anti-replay parameter, a first integrity information, and , the first signature determined based on the first anti-replay parameter and the first integrity information; the vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle It is determined that the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the first upgrade package is the upgrade package indicated by the first integrity information; the anti-replay parameter of the vehicle is used to identify this upgrade of the vehicle; the vehicle is based on The first upgrade package is upgraded to enhance the first function or add the first function.
实施本申请实施例提供的方法,车辆可以在需要升级时,获取到授权文件和升级包,在使用升级包进行升级之前,车辆会对授权文件进行校验,包括:防重放参数的校验、完整性信息的校验、签名的校验。其中,校验签名是为了判断授权文件是否由管理车辆升级的车云服务器发送,以及授权文件是否被第三方篡改,校验完整性信息是为了判断接收到的升级包,是否为车云服务器同该授权文件一起发生的升级包,避免第三方将车云服务器一起发送的升级包和授权文件中的升级包替换成其他升级包,校验防重放参数是否了保证车辆能够根据与车云服务器约定的升级包版本的升级包进行升级。例如,车辆与服务器可以在每次升级时约定不同的防重放参数,如果攻击者利用老版本的升级包的漏洞来攻击车辆,截取服务器给车辆发送的升级包,并替换成老版本的升级包,但是由于老版本的升级包的防重放参数与车辆本次升级的防重放参数不一致,车辆不会根据该老版本的升级包进行升级,从而预防了攻击者重放老版本的升级包,利用老版本的漏洞攻击车辆,保障了车辆的安全以及车主的利益。By implementing the method provided by the embodiments of this application, the vehicle can obtain the authorization file and upgrade package when it needs to be upgraded. Before using the upgrade package to upgrade, the vehicle will verify the authorization file, including: verification of anti-replay parameters. , Verification of integrity information and verification of signatures. Among them, the purpose of verifying the signature is to determine whether the authorization file is sent by the car cloud server that manages vehicle upgrades, and whether the authorization file has been tampered with by a third party. The purpose of verifying the integrity information is to determine whether the received upgrade package is the same as the car cloud server. The upgrade package that is generated together with the authorization file prevents third parties from replacing the upgrade package sent together with the car cloud server and the upgrade package in the authorization file with other upgrade packages, and verifies whether the anti-replay parameters are correct to ensure that the vehicle can pass the upgrade package with the car cloud server. Upgrade with the upgrade package of the agreed upgrade package version. For example, the vehicle and the server can agree on different anti-replay parameters for each upgrade. If an attacker exploits the vulnerability of the old version of the upgrade package to attack the vehicle, intercept the upgrade package sent by the server to the vehicle and replace it with the old version of the upgrade package. package, but because the anti-replay parameters of the old version of the upgrade package are inconsistent with the anti-replay parameters of the current vehicle upgrade, the vehicle will not be upgraded based on the old version of the upgrade package, thus preventing attackers from replaying the old version of the upgrade. package, using the vulnerabilities of old versions to attack vehicles, ensuring the safety of vehicles and the interests of car owners.
结合第二方面,在一种实施方式中,第一文件还包括第一车辆标识,第一签名为根据第一车辆标识和第一防重放参数确定的签名;车辆根据第一升级包进行升级之前,方法还包括:车辆确定第一车辆标识和车辆的车辆标识相同。Combined with the second aspect, in one implementation, the first file further includes a first vehicle identification, and the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter; the vehicle is upgraded according to the first upgrade package Previously, the method also includes: the vehicle determines that the first vehicle identification is the same as the vehicle identification of the vehicle.
进一步地,授权文件的校验,还可以包括:车辆身份标识的校验。校验车辆身份标识是为了保证车辆接收到的升级包为车云服务器发送给的适用于本车辆的升级包。避免车辆使用车云服务器发送给其他车辆的升级包进行升级,或者研发阶段使用的升级包进行升级,从车辆的升级阶段保障车辆的安全。Further, the verification of the authorization file may also include verification of the vehicle identity. The purpose of verifying the vehicle identity is to ensure that the upgrade package received by the vehicle is the upgrade package sent by the car cloud server and is suitable for the vehicle. Prevent vehicles from being upgraded using upgrade packages sent by the car cloud server to other vehicles, or upgrade packages used in the research and development stage, to ensure vehicle safety from the vehicle upgrade stage.
结合第二方面,在一种实施方式中,车辆根据第一升级包进行升级之后,方法还包括:车辆再次使用第一服务器的公钥校验第一签名,且校验通过;车辆再次确定第一防重放参数与车辆的防重放参数相同,且,升级后的车辆的数据包括第一完整性信息指示的升级包中的数据;车辆启动第一功能。 Combined with the second aspect, in one embodiment, after the vehicle is upgraded according to the first upgrade package, the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and the verification passes; the vehicle again determines the first signature. The first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the upgraded vehicle data includes data in the upgrade package indicated by the first integrity information; the vehicle activates the first function.
进一步地,车辆除了在升级阶段进行授权文件的校验外,还可以在安全启动阶段再次校验授权文件,包括:签名的校验、防重放参数的校验、完整性信息的校验。这样,可以保证车辆运行的软件程序为官方服务器,即车云服务器发送的升级包中的软件程序,进一步地,不是来源于老版本的升级包中的软件程序,避免攻击者在车辆的运行阶段使用老版本升级包的漏洞攻击车辆。Furthermore, in addition to verifying the authorization file during the upgrade phase, the vehicle can also verify the authorization file again during the secure startup phase, including: verification of signatures, verification of anti-replay parameters, and verification of integrity information. In this way, it can be ensured that the software program running on the vehicle is the official server, that is, the software program in the upgrade package sent by the car cloud server. Furthermore, it does not come from the software program in the upgrade package of the old version, which prevents attackers from running the vehicle during the operation phase. Use vulnerabilities in older version upgrade packages to attack vehicles.
结合第二方面,在一种实施方式中,车辆根据第一升级包进行升级之后,方法还包括:车辆再次使用第一服务器的公钥校验第一签名,且校验通过;车辆再次确定第一防重放参数与车辆的防重放参数相同,且,第一车辆标识与车辆的车辆标识相同,且,升级后的车辆的数据包括第一完整性信息指示的升级包中的数据;车辆启动第一功能。Combined with the second aspect, in one embodiment, after the vehicle is upgraded according to the first upgrade package, the method further includes: the vehicle uses the public key of the first server again to verify the first signature, and the verification passes; the vehicle again determines the first signature. The first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the first vehicle identification is the same as the vehicle identification of the vehicle, and the data of the upgraded vehicle includes the data in the upgrade package indicated by the first integrity information; the vehicle Start the first function.
进一步地,车辆除了在升级阶段进行授权文件的校验外,还可以在安全启动阶段再次校验授权文件,包括:签名的校验、防重放参数的校验、车辆身份标识的校验、完整性信息的校验。这样,可以保证车辆运行的软件程序为官方服务器,即车云服务器发送的升级包中的软件程序,进一步地,不是来源于老版本的升级包、研发阶段使用的升级包、车云服务器给其他车辆发送的升级包中的软件程序,保障车辆运行阶段的安全。Furthermore, in addition to verifying the authorization file during the upgrade phase, the vehicle can also verify the authorization file again during the safe startup phase, including: verification of signatures, verification of anti-replay parameters, verification of vehicle identity, Verification of integrity information. In this way, it can be ensured that the software program running on the vehicle is the official server, that is, the software program in the upgrade package sent by the car cloud server. Furthermore, it does not come from the upgrade package of the old version, the upgrade package used in the research and development stage, or the upgrade package sent by the car cloud server to other The software program in the upgrade package sent by the vehicle ensures the safety of the vehicle during its operation.
第三方面,本申请提供了另一种车辆校验方法,方法包括:车辆接收到第一文件和第一升级包,第一文件包括:第一车辆标识,第一完整性信息,和,根据第一车辆标识以及第一完整性信息确定的第一签名;车辆检测到启动第一功能的指令,第一功能为车辆根据第一升级包进行升级后增强或增加的功能;车辆使用第一服务器的公钥校验第一签名,且校验通过;第一服务器用于管理车辆的升级;车辆再次确定第一车辆标识与车辆的车辆标识相同,且,升级后的车辆的数据包括第一完整性信息指示的升级包中的数据;车辆启动第一功能。In a third aspect, this application provides another vehicle verification method. The method includes: the vehicle receives a first file and a first upgrade package. The first file includes: a first vehicle identification, first integrity information, and, according to The first vehicle identification and the first signature determined by the first integrity information; the vehicle detects an instruction to activate the first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package; the vehicle uses the first server The public key verifies the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle again determines that the first vehicle identification is the same as the vehicle identification, and the upgraded vehicle data includes the first complete The data in the upgrade package indicated by the sexual information; the vehicle starts the first function.
实施本申请实施例提供的方法,车辆可以在升级阶段接收到升级包和授权文件,并根据该升级包进行升级,在车辆启动时,再使用授权文件校验车辆升级后的软件程序,是否来源于服务器专门发送给该车辆的升级包中的软件程序,只有在校验通过后,车辆才会进行启动。这样,可以避免任何未经授权的软件程序在车辆中运行,保证车辆运行的软件程序来源于升级阶段接收到的升级包中的软件程序,并在启动阶段,确定该升级包为车云服务器发送的适用于本车辆的升级包,避免车辆运行车云服务器发送给其他车辆的升级包中的软件程序,或者,研发阶段使用的升级包中的软件程序等等,保证了车辆的安全运行。By implementing the method provided by the embodiments of this application, the vehicle can receive the upgrade package and authorization file during the upgrade phase, and perform upgrades based on the upgrade package. When the vehicle is started, the authorization file is then used to verify whether the vehicle's upgraded software program comes from the source The vehicle will start only after the software program in the upgrade package sent by the server to the vehicle has passed the verification. In this way, any unauthorized software program can be prevented from running in the vehicle. The software program that ensures the operation of the vehicle comes from the software program in the upgrade package received during the upgrade stage, and during the startup stage, it is determined that the upgrade package is sent by the car cloud server. The upgrade package applicable to this vehicle prevents the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles, or the software program in the upgrade package used in the research and development stage, etc., ensuring the safe operation of the vehicle.
第四方面,本申请提供了另一种车辆校验方法,方法包括:车辆接收到第一文件和第一升级包,第一文件包括:第一防重放参数,第一完整性信息,和,根据第一防重放参数以及第一完整性信息确定的第一签名;车辆检测到启动第一功能的指令,第一功能为车辆根据第一升级包进行升级后增强或增加的功能;车辆使用第一服务器的公钥校验第一签名,且校验通过;第一服务器用于管理车辆的升级;车辆再次确定第一防重放参数与车辆的车辆标识相同,且,升级后的车辆的数据包括第一完整性信息指示的升级包中的数据;车辆启动第一功能。In a fourth aspect, this application provides another vehicle verification method. The method includes: the vehicle receives a first file and a first upgrade package. The first file includes: a first anti-replay parameter, a first integrity information, and , the first signature determined based on the first anti-replay parameter and the first integrity information; the vehicle detects an instruction to start the first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package; the vehicle The first signature is verified using the public key of the first server, and the verification passes; the first server is used to manage the upgrade of the vehicle; the vehicle again determines that the first anti-replay parameter is the same as the vehicle identification of the vehicle, and the upgraded vehicle The data includes the data in the upgrade package indicated by the first integrity information; the vehicle starts the first function.
实施本申请实施例提供的方法,车辆可以在升级阶段接收到升级包和授权文件,并根据该升级包进行升级,在车辆启动时,再使用授权文件校验车辆升级后的软件程序,是否来源于服务器专门发送给该车辆本次升级的升级包中的软件程序,只有在校验通过后,车辆才会进行启动。这样,可以避免任何未经授权的软件程序在车辆中运行,保证车辆运行的软件程 序来源于升级阶段接收到的升级包中的软件程序,并在启动阶段,确定该升级包为车云服务器发送的适用于车辆本次升级的升级包,避免车辆运行老版本的升级包中的软件程序等等,保证了车辆的安全运行。By implementing the method provided by the embodiments of this application, the vehicle can receive the upgrade package and authorization file during the upgrade phase, and perform upgrades based on the upgrade package. When the vehicle is started, the authorization file is then used to verify whether the vehicle's upgraded software program comes from the source The software program in the upgrade package sent by the server to the vehicle for this upgrade will only start after the verification passes. In this way, any unauthorized software programs can be prevented from running in the vehicle, and the software programs running on the vehicle can be guaranteed to The program is derived from the software program in the upgrade package received during the upgrade stage, and during the startup stage, it is determined that the upgrade package is an upgrade package sent by the car cloud server that is suitable for the current upgrade of the vehicle, so as to prevent the vehicle from running an old version of the upgrade package. Software programs, etc., ensure the safe operation of the vehicle.
结合第四方面,在一种实施方式中,第一文件还包括第一车辆标识,第一签名为根据第一车辆标识和第一防重放参数确定的签名;车辆启动第一功能之前,方法还包括:车辆确定第一车辆标识和车辆的车辆标识相同。进一步地,授权文件的校验还包括对车辆身份标识的校验,可以进一步避免车辆运行车云服务器发送给其他车辆的升级包中的软件程序,或者,研发阶段使用的升级包中的软件程序等等,保证车辆的安全运行。Combined with the fourth aspect, in one implementation, the first file further includes a first vehicle identification, and the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter; before the vehicle starts the first function, the method It also includes: the vehicle determines that the first vehicle identification is the same as the vehicle identification of the vehicle. Furthermore, the verification of the authorization file also includes the verification of the vehicle identity, which can further prevent the vehicle from running the software program in the upgrade package sent by the car cloud server to other vehicles, or the software program in the upgrade package used in the research and development phase. etc. to ensure the safe operation of the vehicle.
结合第二方面、第四方面,在一种实施方式中,车辆的防重放参数随着车辆的每一次升级而更新且仅用于标识车辆的一次升级,或者,车辆的防重放参数用于标识车辆的多次升级。Combined with the second aspect and the fourth aspect, in one embodiment, the anti-replay parameters of the vehicle are updated with each upgrade of the vehicle and are only used to identify an upgrade of the vehicle, or the anti-replay parameters of the vehicle are Multiple upgrades to identify vehicles.
在一种情况下,防重放参数可以为每次升级随机生成的随机数,该随机数可用于唯一标识一次升级,也就是说,每次升级时,车云服务器和车辆都可以约定一个随机生成的“暗号”,保证车辆在任何一次升级都不会使用老版本的升级包进行升级。In one case, the anti-replay parameter can be a random number randomly generated for each upgrade. This random number can be used to uniquely identify an upgrade. That is to say, for each upgrade, the car cloud server and the vehicle can agree on a random number. The generated "secret code" ensures that the vehicle will not be upgraded using an old version of the upgrade package at any time.
在另一种情况下,防重放参数可以为单调递增的计数值,该计数值可以在每次升级时发生更改,也可以在预设条件发发送更改,例如发现老版本升级包中存在漏洞。其中,每次更改计数值,可以保证车辆在任何一次升级都不会使用老版本的升级包进行升级,在发现老版本升级包存在漏洞时更改计数值,可以避免在发现老版本存在漏洞后,车辆使用老版本升级包进行升级。In another case, the anti-replay parameter can be a monotonically increasing count value, which can change each time it is upgraded, or can be changed under preset conditions, such as when a vulnerability is found in an old version upgrade package. . Among them, each time the count value is changed, it can be ensured that the vehicle will not be upgraded using the old version of the upgrade package at any time. Changing the count value when a vulnerability in the old version of the upgrade package is discovered can avoid the need to The vehicle is upgraded using the old version upgrade package.
结合第二方面、第四方面,在一种实施方式中,车辆的防重放参数存储于重放保护存储分区RPMB或一次性可编程存储区域OTP中。Combined with the second aspect and the fourth aspect, in one implementation, the anti-replay parameters of the vehicle are stored in the replay protection storage partition RPMB or the one-time programmable storage area OTP.
车辆将本地的防重放参数存放在RPMB和OTP中,可以避免第三方恶意篡改本地存放的防重放参数,保证车辆在对接收到的防重放参数和本地的防重放参数进行比较时,本地的防重放参数的可信度。The vehicle stores the local anti-replay parameters in RPMB and OTP, which can prevent third parties from maliciously tampering with the locally stored anti-replay parameters and ensure that the vehicle compares the received anti-replay parameters with the local anti-replay parameters. , the credibility of local anti-replay parameters.
结合第一方面、第三方面,在一种实施方式中,车辆的车辆标识存储于一次性可编程存储区域OTP中。Combining the first aspect and the third aspect, in one implementation, the vehicle identification of the vehicle is stored in the one-time programmable storage area OTP.
车辆将本地的防重放参数存放在OTP中,可以避免第三方恶意篡改本地存放的车辆身份标识,保证车辆在对接收到的车辆身份标识和本地的车辆身份标识进行比较时,本地的车辆身份标识的可信度。The vehicle stores local anti-replay parameters in the OTP, which can prevent third parties from maliciously tampering with the locally stored vehicle identity and ensure that when the vehicle compares the received vehicle identity with the local vehicle identity, the local vehicle identity The credibility of the logo.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,在第一升级包为第一完整性信息标识的升级包的情况下,第一完整性信息包括一个或多个参数,一个或多个参数用于标识第一升级包。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one embodiment, when the first upgrade package is an upgrade package identified by the first integrity information, the first integrity information includes a or multiple parameters, one or more parameters are used to identify the first upgrade package.
也就是说,完整性信息可以为一个参数,该参数用于标识整个升级包中的数据,这样,当车辆校验完整性信息时,可以快速确定升级包中的数据是否被篡改,或者,完整性信息可以为多个参数,这多个参数可以分别标识升级包中的多个升级文件,这样,当车辆校验完整性信息时,可以精准的确定升级包中的哪些数据遭到了篡改。 That is to say, the integrity information can be a parameter that is used to identify the data in the entire upgrade package. In this way, when the vehicle verifies the integrity information, it can quickly determine whether the data in the upgrade package has been tampered with, or whether it is complete. The sexual information can be multiple parameters, and these multiple parameters can respectively identify multiple upgrade files in the upgrade package. In this way, when the vehicle verifies the integrity information, it can accurately determine which data in the upgrade package has been tampered with.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,第一文件还包括:第一公钥;车辆预存有第一服务器的公钥的第一标识,车辆使用第一服务器的公钥校验第一签名之前,方法还包括:车辆确定第一公钥的标识;在第一公钥的标识和第一标识相同的情况下,车辆确定第一公钥为第一服务器的公钥。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, the first file further includes: a first public key; the vehicle has a first identifier of the public key of the first server pre-stored, and the vehicle Before using the public key of the first server to verify the first signature, the method further includes: the vehicle determines the identity of the first public key; when the identity of the first public key is the same as the first identity, the vehicle determines that the first public key is The public key of the first server.
也就是说,授权文件中还可以包括校验该授权文件中的签名的授权公钥,在校验该签名之前,车辆可以先校验该授权公钥是否被第三方篡改,保证签名校验的可信度。其中,车辆可以在本地预置授权公钥的标识,例如哈希值,如果接受到的授权公钥的哈希值与本地预置的哈希值相同,则说明该授权公钥来源于车云服务器,且没有被第三方篡改。也就是说,车辆可以通过本地预置授权公钥的标识来实现对接收到的公钥的校验。That is to say, the authorization file can also include the authorization public key for verifying the signature in the authorization file. Before verifying the signature, the vehicle can first verify whether the authorization public key has been tampered with by a third party to ensure that the signature verification is successful. Credibility. Among them, the vehicle can preset the identification of the authorized public key locally, such as a hash value. If the hash value of the received authorized public key is the same as the locally preset hash value, it means that the authorized public key comes from the car cloud. server and has not been tampered with by a third party. That is to say, the vehicle can verify the received public key through the identification of the locally preset authorized public key.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,第一文件中还包括:第一公钥,和,根据第一公钥确定的第二签名,车辆使用第一服务器的公钥校验第一签名之前,方法还包括:车辆使用第二服务器的公钥校验第二签名;其中,第二服务器为开发并提供车辆升级所需的升级包的服务器;在第二签名的校验通过的情况下,车辆确定第一公钥为第一服务器的公钥。In combination with the first aspect, the second aspect, the third aspect, and the fourth aspect, in one implementation, the first file further includes: a first public key, and a second signature determined based on the first public key, the vehicle Before using the public key of the first server to verify the first signature, the method also includes: the vehicle uses the public key of the second server to verify the second signature; wherein the second server is a server that develops and provides an upgrade package required for vehicle upgrades. ; When the verification of the second signature passes, the vehicle determines that the first public key is the public key of the first server.
也就是说,当授权文件中包括校验该授权文件中的签名的授权公钥时,可以通过除车云服务器和车辆之外的其他可信第三方来提供该授权公钥的合法性证明,该可信的第三方可以是指软件供应商。也就是说,车辆可以通过该软件供应商的供应商服务器提供的合法性证明来判断授权公钥是否来源于车云服务器,且未被篡改,保证签名校验的可信度。That is to say, when the authorization file includes an authorization public key that verifies the signature in the authorization file, other trusted third parties other than the car cloud server and the vehicle can provide proof of the legitimacy of the authorization public key. The trusted third party may refer to the software vendor. In other words, the vehicle can use the legality certificate provided by the software supplier's supplier server to determine whether the authorized public key comes from the vehicle cloud server and has not been tampered with, ensuring the credibility of the signature verification.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,车辆存储有第一公钥的用途信息,用途信息用于指示第一公钥仅用于校验第一签名。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, the vehicle stores usage information of the first public key, and the usage information is used to indicate that the first public key is only used to verify the first public key. One signature.
当授权文件中的授权公钥的合法性由供应商服务器保证时,该第一公钥的用途信息用于规定授权公钥的用途,避免供应商服务器和车云服务器的签名能力混淆,避免车云服务器拥有伪造升级包的签名的可能性。When the legitimacy of the authorized public key in the authorization file is guaranteed by the supplier server, the purpose information of the first public key is used to specify the purpose of the authorized public key to avoid confusion between the signature capabilities of the supplier server and the car cloud server. The cloud server has the possibility of forging the signature of the upgrade package.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,车辆使用第一服务器的公钥校验第一签名之前,方法还包括:车辆确定第一公钥为第一服务器允许车辆使用的公钥。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, before the vehicle uses the public key of the first server to verify the first signature, the method further includes: the vehicle determines that the first public key is The first server allows the vehicle to use the public key.
由于车云服务器可以存在多个,不同的车辆可以获取到不同车云服务器发送给的授权文件和升级包。车云服务器除了向车辆发送授权文件和升级包之外,还可以控制车辆允许或禁止用来校验授权文件的签名的授权公钥,这样,可以对不同车云服务器提供的授权公钥进行区分,避免部分车辆厂商的车云服务器的授权私钥丢失,而连带影响到其他车辆厂商。Since there can be multiple car cloud servers, different vehicles can obtain authorization files and upgrade packages sent by different car cloud servers. In addition to sending authorization files and upgrade packages to the vehicle, the car cloud server can also control the vehicle to allow or prohibit the authorization public key used to verify the signature of the authorization file. In this way, the authorization public keys provided by different car cloud servers can be distinguished. , to avoid the loss of authorized private keys of some vehicle manufacturers' car cloud servers, which will also affect other vehicle manufacturers.
结合第一方面,第二方面,第四方面,在一种实施方式中,车辆的车辆标识用于标识车辆的第一部件;车辆根据第一升级包进行升级,具体包括:车辆根据第一升级包进行第一部件或第二部件的升级,第二部件的升级由第一部件管理。Combining the first aspect, the second aspect, and the fourth aspect, in one embodiment, the vehicle identification of the vehicle is used to identify the first component of the vehicle; the vehicle is upgraded according to the first upgrade package, which specifically includes: the vehicle is upgraded according to the first upgrade package The package performs an upgrade of the first component or the second component, and the upgrade of the second component is managed by the first component.
由于车辆的升级具体为车辆各部件的升级,车辆身份标识可用于标识车辆升级的部件,进一步地,车辆身份标识可以为部件的芯片ID,或者,对于安全能力较低的部件,对于该部件的升级,其车辆身份标识为管理该部件的,安全能力较强的部件的标识,例如该部件的芯片ID。 Since the upgrade of the vehicle specifically refers to the upgrade of each component of the vehicle, the vehicle identity identifier can be used to identify the components of the vehicle upgrade. Further, the vehicle identity identifier can be the chip ID of the component, or, for components with lower security capabilities, for components with lower security capabilities, the vehicle identity identifier can be the chip ID of the component. When upgraded, the vehicle identity is the identification of a component with strong security capabilities that manages the component, such as the chip ID of the component.
结合第一方面,第二方面,第四方面,在一种实施方式中,在车辆升级第二部件的情况下,车辆的身份标识还用于标识第三部件。Combining the first aspect, the second aspect, and the fourth aspect, in one embodiment, when the vehicle upgrades the second component, the vehicle's identity is also used to identify the third component.
其中,车辆身份标识用于标识多个部件,可以防止出现对车辆进行恶意换件的攻击场景。Among them, the vehicle identity is used to identify multiple components, which can prevent the occurrence of malicious parts replacement attack scenarios on the vehicle.
结合第一方面,第二方面,第四方面,在一种实施方式中,车辆通过第一部件校验第一文件,或者,车辆通过第一部件和第三部件校验第一文件。With reference to the first aspect, the second aspect, and the fourth aspect, in one implementation, the vehicle verifies the first file through the first component, or the vehicle verifies the first file through the first component and the third component.
也就是说,当车辆进行一个部件的升级时,该授权文件的校验可以由一个或多个部件校验完成。That is to say, when the vehicle undergoes a component upgrade, the verification of the authorization file can be completed by one or more component verifications.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,其特征在于,第一文件还包括:第二完整性信息,第一签名还根据第二完整性信息确定,车辆确定升级后的车辆的数据包括第一完整性信息指示的升级包中的数据,具体包括:车辆确定升级后的车辆的数据与第二完整性信息指示的数据相同,第二完整性信息指示的数据包括第一升级包中的数据。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, it is characterized in that the first file further includes: second integrity information, and the first signature is also based on the second integrity information. It is determined that the vehicle determines that the upgraded vehicle data includes the data in the upgrade package indicated by the first integrity information, specifically including: the vehicle determines that the upgraded vehicle data is the same as the data indicated by the second integrity information, and the second integrity information The data indicated by the information includes data in the first upgrade package.
当车辆的升级方式为差分升级时,此时升级包为差分包,授权文件中的完整性信息可以包括:差分包中的数据的完整性信息,和,完整升级数据的完整性信息。When the vehicle upgrade mode is differential upgrade, the upgrade package is a differential package. The integrity information in the authorization file may include: the integrity information of the data in the differential package, and the integrity information of the complete upgrade data.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,第一文件还包括:第三完整性信息,第一签名还根据第三完整性信息确定,在第一签名的校验通过的情况下,第三完整性信息用于指示车辆升级失败后的数据。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in an implementation manner, the first file further includes: third integrity information, the first signature is further determined based on the third integrity information. If the verification of a signature passes, the third integrity information is used to indicate the data after the vehicle upgrade fails.
当车辆的升级方式为A/B升级时,授权文件中的完整性信息可以包括:升级包中的数据的完整性信息,和,升级失败后的数据的完整性信息。避免攻击者利用车辆升级失败,恶意篡改车辆中的数据。When the vehicle upgrade mode is A/B upgrade, the integrity information in the authorization file may include: the integrity information of the data in the upgrade package, and the integrity information of the data after the upgrade fails. This prevents attackers from maliciously tampering with data in the vehicle by taking advantage of vehicle upgrade failures.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,第一升级包中包括第三签名和/或第四签名,第三签名由第一服务器签名得到,第四签名由第二服务器签名得到,第二服务器为开发并提供车辆升级所需的升级文件的服务器;车辆根据第一升级包进行升级之前,方法还包括:车辆使用第一服务器的公钥校验第三签名,且校验通过;和/或,车辆使用第二服务器的公钥校验第四签名,且校验通过。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, the first upgrade package includes a third signature and/or a fourth signature, and the third signature is obtained by signing the first server, The fourth signature is obtained by signing the second server, which is a server that develops and provides upgrade files required for vehicle upgrades; before the vehicle is upgraded according to the first upgrade package, the method also includes: the vehicle uses the public key of the first server to verify the signature. The vehicle verifies the third signature and the verification passes; and/or the vehicle uses the public key of the second server to verify the fourth signature and the verification passes.
在上述实施例中,升级包中可以包括编包签名和外层签名,其中,编包签名由供应商服务器对升级文件签名得到,外层签名由车云服务器对升级包签名得到。车辆可以通过校验编包签名来判断升级文件由供应商服务器发送,且传输过程中未被第三方篡改,校验外层签名可以判断升级包由车云服务器发送给,且传输过程中未被第三方篡改,从而保证车辆升级时使用的升级包来源可靠,且未被篡改。In the above embodiment, the upgrade package may include a package signature and an outer signature. The package signature is obtained by the supplier server signing the upgrade file, and the outer signature is obtained by the CheCloud server signing the upgrade package. The vehicle can determine by verifying the package signature that the upgrade file was sent by the supplier server and that it was not tampered with by a third party during the transmission process. By verifying the outer signature, the vehicle can determine that the upgrade package was sent by the vehicle cloud server and that it was not tampered with by a third party during the transmission process. Third-party tampering to ensure that the upgrade package used when upgrading the vehicle is from a reliable source and has not been tampered with.
结合第一方面、第二方面、第三方面、第四方面,在一种实施方式中,车辆接收到第一文件和第一升级包之前,方法还包括:车辆接收到升级策略;车辆根据升级策略确定第一地址,第一地址为存储第一升级包的地址;车辆向第一地址所在的服务器发送下载请求,下载请求用于请求获取第一升级包。Combining the first aspect, the second aspect, the third aspect and the fourth aspect, in one implementation, before the vehicle receives the first file and the first upgrade package, the method further includes: the vehicle receives the upgrade strategy; the vehicle performs the upgrade according to The policy determines the first address, which is the address where the first upgrade package is stored; the vehicle sends a download request to the server where the first address is located, and the download request is used to request to obtain the first upgrade package.
在上述实施例中,车辆可以通过接收升级包的下载地址,根据该下载地址从相应的车云 服务器获取升级所需的升级包,这样可以加快车辆获取升级包的速度,减少升级包在各车云服务器中所占用的存储空间。In the above embodiment, the vehicle can receive the download address of the upgrade package and download the upgrade package from the corresponding car cloud according to the download address. The server obtains the upgrade package required for the upgrade, which can speed up the vehicle to obtain the upgrade package and reduce the storage space occupied by the upgrade package in each vehicle cloud server.
第五方面,本申请提供了另一种车辆校验方法,方法包括:第一服务器获取车辆的车辆标识;第一服务器确定升级包的完整性信息,完整性信息用于标识升级包;第一服务器根据车辆标识和完整性信息确定签名;第一服务器发送文件和升级包,文件包括:车辆标识、完整性信息和签名;升级包用于升级车辆。In a fifth aspect, this application provides another vehicle verification method. The method includes: the first server obtains the vehicle identification of the vehicle; the first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package; The server determines the signature based on the vehicle identification and integrity information; the first server sends a file and an upgrade package. The file includes: vehicle identification, integrity information and signature; the upgrade package is used to upgrade the vehicle.
实施本申请实施例提供的方法,车云服务器可以在向车辆发送升级包时,将针对该升级包的授权文件一起发送给车辆,其中,该授权文件中可以包括:车辆身份标识、完整性信息、签名。其中,签名由于证明该授权文件由车云服务器发送,避免第三方伪造授权文件,完整性信息用于绑定升级包和授权文件,避免第三方恶意截取授权文件,将授权文件与伪造的升级包一起发送给车辆,车辆身份标识用于指示此次发送的升级包为专门针对该车辆所发送的升级包。这样,可以避免车辆使用车云服务器发送给其他车辆的升级包进行升级,或者,使用其他不用于售卖的升级包,例如,研发阶段使用的升级包、携带病毒的升级包、存在漏洞的升级包等等进行升级,保证车辆使用合法且合适的升级包进行升级,或者,保证车辆运行的数据来源于合法且合适的升级包,保证车辆的安全运行,维护车主、车厂和软件供应商的利益。Implementing the method provided by the embodiments of this application, the car cloud server can send the authorization file for the upgrade package to the vehicle when sending the upgrade package to the vehicle, where the authorization file can include: vehicle identity identification, integrity information ,sign. Among them, the signature proves that the authorization file was sent by the Cheyun server, preventing a third party from forging the authorization file. The integrity information is used to bind the upgrade package and the authorization file, preventing a third party from maliciously intercepting the authorization file and combining the authorization file with the forged upgrade package. are sent to the vehicle together, and the vehicle identity identifier is used to indicate that the upgrade package sent this time is an upgrade package sent specifically for the vehicle. In this way, vehicles can be prevented from being upgraded using upgrade packages sent by the car cloud server to other vehicles, or from using other upgrade packages not for sale, such as upgrade packages used in the research and development stage, upgrade packages carrying viruses, and upgrade packages with vulnerabilities. Wait for the upgrade to ensure that the vehicle is upgraded using a legal and appropriate upgrade package, or to ensure that the vehicle operation data comes from a legal and appropriate upgrade package to ensure the safe operation of the vehicle and safeguard the interests of car owners, car manufacturers and software suppliers.
结合第五方面,在一种实施方式中,第一服务器根据车辆标识和完整性信息确定签名,具体包括:第一服务器根据防重放参数、车辆标识和完整性信息确定签名,防重放参数用于标识车辆本次的升级。Combined with the fifth aspect, in one implementation, the first server determines the signature based on the vehicle identification and integrity information, which specifically includes: the first server determines the signature based on the anti-replay parameters, the vehicle identification, and the integrity information, and the anti-replay parameters Used to identify this upgrade of the vehicle.
进一步地,授权文件中还可以包括防重放参数,保证车辆能够根据与服务器约定的升级版本的升级包进行升级。还可以避免攻击者重放老版本的升级包,利用老版本的漏洞攻击车辆,保障了车辆的安全以及车主的利益。Furthermore, the authorization file may also include anti-replay parameters to ensure that the vehicle can be upgraded according to the upgrade package of the upgraded version agreed with the server. It can also prevent attackers from replaying the old version of the upgrade package and using the vulnerabilities of the old version to attack the vehicle, ensuring the safety of the vehicle and the interests of the car owner.
第六方面,本申请实施例提供了另一种车辆校验方法,方法包括:第一服务器确定升级包的完整性信息,完整性信息用于标识升级包;第一服务器根据防重放参数和完整性信息确定签名,防重放参数用于标识车辆本次的升级;第一服务器发送文件和升级包,文件包括:防重放参数、完整性信息和签名;升级包用于升级车辆。In the sixth aspect, embodiments of the present application provide another vehicle verification method. The method includes: the first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package; the first server determines the integrity information of the upgrade package according to the anti-replay parameters and The integrity information determines the signature, and the anti-replay parameters are used to identify the current upgrade of the vehicle; the first server sends a file and an upgrade package. The file includes: anti-replay parameters, integrity information, and signature; the upgrade package is used to upgrade the vehicle.
实施本申请实施例提供的方法,车云服务器可以在向车辆发送升级包时,将针对该升级包的授权文件一起发送给车辆,其中,该授权文件中可以包括:防重放参数、完整性信息、签名。其中,签名由于证明该授权文件由车云服务器发送,避免第三方伪造授权文件,完整性信息用于绑定升级包和授权文件,避免第三方恶意截取授权文件,将授权文件与伪造的升级包一起发送给车辆,防重放参数用于标识车辆的本次升级。避免车辆根据该老版本的升级包进行升级,从而预防了攻击者重放老版本的升级包,利用老版本的漏洞攻击车辆,保障了车辆的安全以及车主的利益。Implementing the method provided by the embodiments of this application, the car cloud server can send the authorization file for the upgrade package to the vehicle when sending the upgrade package to the vehicle, where the authorization file can include: anti-replay parameters, integrity information, signature. Among them, the signature proves that the authorization file was sent by the Cheyun server, preventing a third party from forging the authorization file. The integrity information is used to bind the upgrade package and the authorization file, preventing a third party from maliciously intercepting the authorization file and combining the authorization file with the forged upgrade package. Sent to the vehicle together, the anti-replay parameters are used to identify this upgrade of the vehicle. This prevents the vehicle from being upgraded based on the old version of the upgrade package, thereby preventing attackers from replaying the old version of the upgrade package and using the vulnerabilities of the old version to attack the vehicle, thus ensuring the safety of the vehicle and the interests of the car owner.
结合第六方面,在一种实施方式中,第一服务器根据防重放参数和完整性信息确定签名,具体包括:第一服务器根据防重放参数、车辆的车辆标识和完整性信息确定签名。With reference to the sixth aspect, in one implementation, the first server determines the signature based on the anti-replay parameters and the integrity information, which specifically includes: the first server determines the signature based on the anti-replay parameters, the vehicle identification of the vehicle, and the integrity information.
进一步地,授权文件中还可以包括车辆身份标识,避免车辆混用车云服务器给其他车辆发送的升级包,或者研发阶段使用的升级包等等。 Furthermore, the authorization file may also include vehicle identification to prevent vehicles from mixing upgrade packages sent by the vehicle cloud server to other vehicles, or upgrade packages used in the research and development stage, etc.
结合第五方面、第六方面,在一种实施方式中,方法还包括:第一服务器发送第一列表,第一列表指示了第一服务器允许或禁止车辆校验签名时,使用的公钥。In conjunction with the fifth aspect and the sixth aspect, in one implementation, the method further includes: the first server sending a first list, the first list indicating the public keys used when the first server allows or prohibits the vehicle from verifying the signature.
由于车云服务器可以存在多个,不同的车辆可以获取到不同车云服务器发送给的授权文件和升级包。车云服务器除了向车辆发送授权文件和升级包之外,还可以控制车辆允许或禁止用来校验授权文件的签名的授权公钥,这样,可以对不同车云服务器提供的授权公钥进行区分,避免部分车辆厂商的车云服务器的授权私钥丢失,而连带影响到其他车辆厂商。Since there can be multiple car cloud servers, different vehicles can obtain authorization files and upgrade packages sent by different car cloud servers. In addition to sending authorization files and upgrade packages to the vehicle, the car cloud server can also control the vehicle to allow or prohibit the authorization public key used to verify the signature of the authorization file. In this way, the authorization public keys provided by different car cloud servers can be distinguished. , to avoid the loss of authorized private keys of some vehicle manufacturers' car cloud servers, which will also affect other vehicle manufacturers.
结合第五方面、第六方面,在一种实施方式中,文件还包括第一服务器生成的,用于校验签名的公钥。In combination with the fifth and sixth aspects, in one implementation, the file further includes a public key generated by the first server and used to verify the signature.
结合第五方面、第六方面,在一种实施方式中,文件还包括公钥的签名,第一服务器发送文件和升级包之前,方法还包括:第一服务器向第二服务器发送公钥,第二服务器为开发并提供车辆升级所需的升级文件的服务器;第一服务器接收公钥的签名,公钥的签名由第二服务器根据公钥确定。In combination with the fifth and sixth aspects, in one implementation, the file further includes a signature of the public key. Before the first server sends the file and the upgrade package, the method further includes: the first server sends the public key to the second server, and the first server sends the public key to the second server. The second server is a server that develops and provides upgrade files required for vehicle upgrades; the first server receives the signature of the public key, and the signature of the public key is determined by the second server based on the public key.
也就是说,授权文件中的授权公钥的合法性可以由供应商服务器保证,保证车辆在校验授权文件中的签名的可信度。In other words, the legitimacy of the authorization public key in the authorization file can be guaranteed by the supplier server to ensure the credibility of the vehicle's signature in the verification authorization file.
第七方面,本申请提供了一种车辆,包括存储器,一个或多个处理器,以及一个或多个程序;一个或多个处理器在执行一个或多个程序时,使得车辆实现如第一方面或第一方面的任意一种实施方式、第二方面或第二方面的任意一种实施方式、第三方面或第三方面的任意一种实施方式、第四方面或第四方面的任意一种实施方式所描述的方法。In a seventh aspect, the application provides a vehicle, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the vehicle implements the first aspect or any embodiment of the first aspect, the second aspect or any embodiment of the second aspect, the third aspect or any embodiment of the third aspect, the fourth aspect or any one of the fourth aspect method described in each embodiment.
第八方面,本申请提供了一种电子设备,包括存储器,一个或多个处理器,以及一个或多个程序;一个或多个处理器在执行一个或多个程序时,使得电子设备实现第五方面或第五方面的任意一种实施方式、第六方面或第六方面的任意一种实施方式所描述的方法。In an eighth aspect, the present application provides an electronic device, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the first The method described in the fifth aspect or any embodiment of the fifth aspect, the sixth aspect or any embodiment of the sixth aspect.
第九方面,本申请提供了一种通信系统,系统包括第七方面的车辆和第八方面的电子设备。In a ninth aspect, the present application provides a communication system, which includes the vehicle of the seventh aspect and the electronic device of the eighth aspect.
第十方面,本申请提供了一种计算机可读存储介质,包括指令,当指令在电子设备上运行时,使得电子设备执行如第一方面或第一方面的任意一种实施方式、第二方面或第二方面的任意一种实施方式、第三方面或第三方面的任意一种实施方式、第四方面或第四方面的任意一种实施方式、第五方面或第五方面的任意一种实施方式、第六方面或第六方面的任意一种实施方式所描述的方法。In a tenth aspect, the present application provides a computer-readable storage medium, including instructions. When the instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect or any one of the embodiments of the first aspect or the second aspect. Or any embodiment of the second aspect, the third aspect or any embodiment of the third aspect, the fourth aspect or any embodiment of the fourth aspect, the fifth aspect or any one of the fifth aspect The method described in any one of the embodiments, the sixth aspect, or the sixth aspect.
可以看出,在车辆升级前或启动前,通过对升级包携带的数据,包括车辆身份标识、防重放参数等等,进行校验,可以避免车辆将不适用于本车辆的升级包导入本车辆,或者,避免车辆运行不适用于本车辆的升级包中的数据,进而影响车辆的安全,保障了车主、车厂与软件供应商之间的商业利益。 It can be seen that before the vehicle is upgraded or started, by verifying the data carried in the upgrade package, including vehicle identification, anti-replay parameters, etc., the vehicle can be prevented from importing upgrade packages that are not suitable for the vehicle. vehicle, or to prevent the vehicle from running the data in the upgrade package that is not applicable to the vehicle, thereby affecting the safety of the vehicle, and safeguarding the commercial interests between car owners, car manufacturers and software suppliers.
附图说明Description of the drawings
图1为本申请实施例提供的通信系统10的结构示意图;Figure 1 is a schematic structural diagram of a communication system 10 provided by an embodiment of the present application;
图2A为本申请实施例提供的车辆300的结构示意图;Figure 2A is a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application;
图2B为本申请实施例提供的车辆300的电子电气架构图;Figure 2B is an electronic and electrical architecture diagram of the vehicle 300 provided by an embodiment of the present application;
图3为本申请实施例提供的电子设备500的硬件结构图;Figure 3 is a hardware structure diagram of the electronic device 500 provided by the embodiment of the present application;
图4为本申请实施例提供的远端升级场景下,车辆校验方法的流程示意图;Figure 4 is a schematic flow chart of the vehicle verification method in the remote upgrade scenario provided by the embodiment of the present application;
图5为本申请实施例提供的供应商服务器对升级包进行签名的逻辑结构示意图;Figure 5 is a schematic diagram of the logical structure of the supplier server signing the upgrade package provided by the embodiment of the present application;
图6为本申请实施例提供的车辆验证升级包的编包签名的逻辑结构示意图;Figure 6 is a schematic diagram of the logical structure of the package signature of the vehicle verification upgrade package provided by the embodiment of the present application;
图7为本申请实施例提供的近端升级场景下,车辆校验方法的流程示意图;Figure 7 is a schematic flow chart of the vehicle verification method in the near-end upgrade scenario provided by the embodiment of the present application;
图8为本申请实施例提供的多个域控制器校验授权文件中的车辆身份标识时,域控制器之间的交互流程图;Figure 8 is a flow chart of interaction between domain controllers when multiple domain controllers verify the vehicle identity in the authorization file provided by the embodiment of the present application;
图9为本申请实施例提供的一种车辆升级的时序图;Figure 9 is a sequence diagram of a vehicle upgrade provided by an embodiment of the present application;
图10为本申请实施例提供的另一种车辆升级的时序图;Figure 10 is a sequence diagram of another vehicle upgrade provided by an embodiment of the present application;
图11为本申请实施例提供的采用多级密钥设置授权公钥的签名时,供应商服务器和车云服务器之间的交互流程图;Figure 11 is a flow chart of the interaction between the supplier server and the car cloud server when multi-level keys are used to set the signature of the authorized public key provided by the embodiment of the present application;
图12为本申请实施例提供的一种多级密钥的结构示意图;Figure 12 is a schematic structural diagram of a multi-level key provided by an embodiment of the present application;
图13为本申请实施例提供的供应商服务器对多个车云服务器的授权公钥进行签名的逻辑示意图;Figure 13 is a logical schematic diagram of the supplier server signing the authorized public keys of multiple car cloud servers provided by the embodiment of this application;
图14为本申请实施例提供的另一种多级密钥的结构示意图。Figure 14 is a schematic structural diagram of another multi-level key provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below with reference to the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise stated, "/" means or, for example, A/B can mean A or B; "and/or" in the text is only a way to describe related objects. The association relationship means that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms “first” and “second” are used for descriptive purposes only and shall not be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, “plurality” The meaning is two or more.
为了实现车辆的升级,可以通过将升级包导入并安装在车辆的系统内部,达到拓展或增强车辆软件功能的升级效果。例如,在车辆具备自动驾驶的硬件能力的前提下,可以通过导入自动驾驶功能的升级包,开启车辆的自动驾驶功能。又例如,可以在车辆存在软件漏洞时,通过导入更高版本的升级包,修复该软件漏洞。In order to upgrade the vehicle, the upgrade package can be imported and installed in the vehicle system to achieve the upgrade effect of expanding or enhancing the vehicle software functions. For example, on the premise that the vehicle has the hardware capabilities for autonomous driving, the autonomous driving function of the vehicle can be enabled by importing an upgrade package for the autonomous driving function. For another example, when a vehicle has a software vulnerability, the software vulnerability can be fixed by importing a higher version upgrade package.
其中,车辆的升级方式主要包括以下两种:Among them, the vehicle upgrade methods mainly include the following two types:
1)远端升级1) Remote upgrade
远端升级,又称空中下载(Over-the-Air,OTA)升级,OTA升级是指车辆通过无线网络,与拥有升级包的服务器直接交互,获取升级包并完成升级。Remote upgrade, also known as Over-the-Air (OTA) upgrade, OTA upgrade means that the vehicle directly interacts with the server that holds the upgrade package through the wireless network to obtain the upgrade package and complete the upgrade.
可以看出,OTA升级可以实现远程修复车辆的软件故障,汽车制造商不必召回车辆进行 维修,降低了汽车制造商的召回成本,车主也可以便捷快速的完成车辆的修复,降低了车主的时间成本。It can be seen that OTA upgrades can remotely repair vehicle software faults, and automakers do not have to recall vehicles for repairs. Maintenance reduces the recall costs of automobile manufacturers, and car owners can also complete vehicle repairs conveniently and quickly, reducing the time cost of car owners.
2)近端升级2) Near-end upgrade
在近端升级场景下,拥有升级包的设备可以通过车辆的端口,例如,通过有线连接车辆的车载自动诊断系统(On Board Diagnostics,OBD)端口,将升级包导入车辆并触发安装,进而完成车辆的升级。例如,车辆可以行驶至汽车销售服务门店,即4S店,由4S店的售后工作人员连接诊断仪/上位机至车辆的OBD端口,将升级包导入车辆进而完成车辆的升级。In the near-end upgrade scenario, the device with the upgrade package can use the vehicle's port, for example, through a wired connection to the vehicle's on-board diagnostic system (On Board Diagnostics, OBD) port, import the upgrade package into the vehicle and trigger the installation, thereby completing the vehicle upgrade. For example, the vehicle can drive to a car sales and service store, that is, a 4S store, and the after-sales staff of the 4S store will connect the diagnostic instrument/host computer to the OBD port of the vehicle, import the upgrade package into the vehicle, and complete the vehicle upgrade.
可以理解的是,除了OTA升级,其他合法的升级方式,例如USB升级、卡包升级都可以看做是近端升级。It is understandable that in addition to OTA upgrades, other legal upgrade methods, such as USB upgrades and card package upgrades, can be regarded as near-end upgrades.
可以看出,在近端升级场景下,车辆可以在未连接网络的情况下,实现车辆的快速升级。It can be seen that in the near-end upgrade scenario, the vehicle can be quickly upgraded without being connected to the network.
综上,不论是远端升级还是近端升级,都需要将升级包导入车辆中,来实现车辆的升级,这就存在这样一个问题,由于车辆仅单方面的接收升级包,那么攻击者可以将不适用该车辆的升级包,例如老版本的升级包、其他车辆的升级包、研发阶段使用的升级包等,导入该车辆,进而影响车主、车厂和软件供应商的商业利益。In summary, whether it is a remote upgrade or a local upgrade, the upgrade package needs to be imported into the vehicle to achieve the vehicle upgrade. This presents a problem. Since the vehicle only receives the upgrade package unilaterally, the attacker can Upgrade packages that are not applicable to the vehicle, such as upgrade packages for older versions, upgrade packages for other vehicles, upgrade packages used in the research and development stage, etc., are imported into the vehicle, thereby affecting the commercial interests of car owners, car manufacturers and software suppliers.
例如,攻击者可以将存在漏洞的老版本的升级包导入车辆,进而利用该漏洞攻击车辆,损害车主的利益。又例如,攻击者可以以更低的售价将官方(例如车厂)发送给其他车辆的升级包导入车辆,实现和在官方购买同等的效果,损害车厂和软件供应商的商业利益。又例如,攻击者可以将研发阶段使用的升级包导入车辆,利用该升级包中自带的特权,恶意修改车辆的程序,降低车辆的安全性,损害车主的利益。For example, an attacker can import an older version of an upgrade package with a vulnerability into a vehicle, and then use the vulnerability to attack the vehicle and harm the interests of the car owner. For another example, attackers can import upgrade packages sent by officials (such as car manufacturers) to other vehicles into vehicles at a lower price, achieving the same effect as purchasing from the official website, harming the commercial interests of car manufacturers and software suppliers. For another example, an attacker can import the upgrade package used in the research and development stage into the vehicle, and use the privileges included in the upgrade package to maliciously modify the vehicle's program, reduce the safety of the vehicle, and harm the interests of the car owner.
因此,如何避免攻击者将不适用于该车辆的升级包,例如老版本的升级包、其他车辆的升级包、研发阶段使用的升级包等等导入该车辆,或者,如何避免上述不适用于该车辆的升级包中的数据在车辆中运行,是目前亟待解决的问题。Therefore, how to prevent attackers from importing upgrade packages that are not applicable to the vehicle, such as old version upgrade packages, upgrade packages for other vehicles, upgrade packages used in the research and development stage, etc., or how to avoid the above being not applicable to the vehicle. The data in the vehicle's upgrade package is running in the vehicle, which is an urgent problem that needs to be solved.
本申请实施例提供了一种车辆校验方法,该方法主要涉及车辆和服务器,服务器存储车辆升级所需的升级包。服务器可以在车辆需要升级时,将车辆身份标识、完整性信息以及根据该车辆身份标识、完整性信息计算的签名和升级包发送给车辆,其中,车辆身份标识用于唯一标识该升级的车辆,完整性信息用于标识该升级包。车辆在接收到车辆身份标识,完整性信息,签名以及升级包后,可以先对签名进行校验,确定该车辆身份标识来源于服务器,且没有被第三方篡改后,再校验接收到的车辆身份标识与车辆本地的身份标识,以及,接收到的完整性信息与车辆对接收到的升级包计算得到的完整性信息是否一致,如果一致,则说明车辆接收到的升级包为服务器专门发送给该车辆的升级包,车辆则可以根据该升级包触发车辆的升级。The embodiment of the present application provides a vehicle verification method, which mainly involves a vehicle and a server. The server stores upgrade packages required for vehicle upgrades. When the vehicle needs to be upgraded, the server can send the vehicle identity, integrity information, and the signature and upgrade package calculated based on the vehicle identity and integrity information to the vehicle, where the vehicle identity is used to uniquely identify the upgraded vehicle. Integrity information is used to identify the upgrade package. After receiving the vehicle identity, integrity information, signature and upgrade package, the vehicle can first verify the signature to make sure that the vehicle identity comes from the server and has not been tampered with by a third party, and then verify the received vehicle. The identity identifier is consistent with the local identity identifier of the vehicle, and whether the received integrity information is consistent with the integrity information calculated by the vehicle for the received upgrade package. If they are consistent, it means that the upgrade package received by the vehicle was specifically sent by the server to The vehicle's upgrade package, the vehicle can trigger vehicle upgrades based on the upgrade package.
也就是说,服务器给不同的车辆发送升级包时,都携带了标识该车辆的车辆身份标识,避免车辆在升级时,混用服务器给其他车辆发送的用于升级的升级包,或者使用未携带车辆身份标识的升级包。That is to say, when the server sends upgrade packages to different vehicles, they all carry the vehicle identity that identifies the vehicle. This prevents the vehicle from mixing upgrade packages sent by the server to other vehicles for upgrade, or using uncarried vehicles when upgrading. Identity upgrade package.
这样,一方面,可以避免车辆使用服务器发送给其他车辆的升级包进行升级,例如车主从非官方渠道获取到的官方发送给其他车辆的升级包,以更低或免费的价格完成车辆的升级,避免损害车厂和软件供应商的利益;另一方面,车辆可以校验升级包是否由可信的服务器发送,只使用可信服务器发送的升级包进行升级,由于服务器并不会将不用于售卖的升级包,例如,研发阶段使用的升级包、携带病毒的升级包、存在漏洞的升级包等等发送给车辆,因 此车辆只会根据安全的升级包进行升级,进一步地,即使车辆接收到第三方发送的篡改后的升级包或伪造的升级包,也不会校验通过,也就不会根据该升级包进行升级,从而保证了车辆使用升级包进行升级的安全性。In this way, on the one hand, it is possible to prevent the vehicle from being upgraded using the upgrade package sent by the server to other vehicles. For example, the car owner obtains the official upgrade package sent to other vehicles from unofficial channels and completes the vehicle upgrade at a lower or free price. Avoid harming the interests of car manufacturers and software suppliers; on the other hand, the vehicle can verify whether the upgrade package is sent by a trusted server, and only use the upgrade package sent by the trusted server for upgrade, because the server will not use the upgrade package that is not for sale. Upgrade packages, for example, upgrade packages used in the research and development stage, upgrade packages carrying viruses, upgrade packages with vulnerabilities, etc. are sent to the vehicle, because This vehicle will only be upgraded based on a secure upgrade package. Furthermore, even if the vehicle receives a tampered upgrade package or a forged upgrade package sent by a third party, it will not pass the verification and will not proceed based on the upgrade package. Upgrade, thereby ensuring the safety of vehicles using upgrade packages.
本申请实施例还提供了另一种车辆校验方法,该方法主要涉及车辆和服务器,服务器可以在车辆需要升级时,将防重放参数、完整性信息以及根据该防重放参数、完整性信息计算的签名和适用于本次升级的升级包发送给车辆,其中,防重放参数用于标识此次升级,完整性信息用于标识该升级包。车辆在接收到防重放参数、签名以及升级包后,可以先对签名进行校验,确定该防重放参数来源于服务器,且没有被第三方篡改后,再校验接收到的防重放参数与车辆本地的防重放参数,以及,接收到的完整性信息与车辆对接收到的升级包计算得到的完整性信息是否一致,如果一致,则说明车辆接收到的升级包为服务器发送的适用于本次升级的升级包,车辆则可以根据该升级包触发车辆的升级车辆。The embodiment of the present application also provides another vehicle verification method. This method mainly involves the vehicle and the server. When the vehicle needs to be upgraded, the server can transfer the anti-replay parameters and integrity information according to the anti-replay parameters and integrity information. The signature calculated by the information and the upgrade package applicable to this upgrade are sent to the vehicle. The anti-replay parameters are used to identify this upgrade, and the integrity information is used to identify the upgrade package. After receiving the anti-replay parameters, signature and upgrade package, the vehicle can first verify the signature to make sure that the anti-replay parameters come from the server and have not been tampered with by a third party, and then verify the received anti-replay data. The parameters are consistent with the local anti-replay parameters of the vehicle, and whether the received integrity information is consistent with the integrity information calculated by the vehicle for the received upgrade package. If they are consistent, it means that the upgrade package received by the vehicle was sent by the server. The upgrade package is applicable to this upgrade, and the vehicle can trigger the vehicle upgrade based on the upgrade package.
也就是说,服务器给车辆发送升级包时,携带了标识车辆本次升级的防重放参数,服务器通过该防重放参数来区分车辆不同版本的升级。That is to say, when the server sends the upgrade package to the vehicle, it carries the anti-replay parameters that identify the current upgrade of the vehicle. The server uses the anti-replay parameters to distinguish upgrades of different versions of the vehicle.
可以看出,该车辆校验方法可以保证车辆能够根据与服务器约定的升级版本的升级包进行升级。例如,车辆与服务器可以在每次升级时约定不同的防重放参数,如果攻击者利用老版本的升级包的漏洞来攻击车辆,截取服务器给车辆发送的升级包,并替换成老版本的升级包,但是由于老版本的升级包的防重放参数与车辆本次升级的防重放参数不一致,车辆不会根据该老版本的升级包进行升级,从而预防了攻击者重放老版本的升级包,利用老版本的漏洞攻击车辆,保障了车辆的安全以及车主的利益。It can be seen that this vehicle verification method can ensure that the vehicle can be upgraded according to the upgrade package of the upgraded version agreed with the server. For example, the vehicle and the server can agree on different anti-replay parameters for each upgrade. If an attacker exploits the vulnerability of the old version of the upgrade package to attack the vehicle, intercept the upgrade package sent by the server to the vehicle and replace it with the old version of the upgrade package. package, but because the anti-replay parameters of the old version of the upgrade package are inconsistent with the anti-replay parameters of the current vehicle upgrade, the vehicle will not be upgraded based on the old version of the upgrade package, thus preventing attackers from replaying the old version of the upgrade. package, using the vulnerabilities of old versions to attack vehicles, ensuring the safety of vehicles and the interests of car owners.
在一些实施例中,上述两种车辆校验方法可以结合实施。具体的,服务器可以将车辆身份标识、防重放参数和完整信信息,以及根据该车辆身份标识、防重放参数、完整性信息计算的签名,随升级包一起发送给车辆,并在校验时,在车辆身份标识、防重放参数和完整性信息的校验都通过后再触发车辆的升级。具体关于车辆身份标识和防重放参数的校验可以参考前述两个实施例中的描述,且本实施例的有益效果可以包含上述两个车辆校验方法的有益效果。In some embodiments, the above two vehicle verification methods can be implemented in combination. Specifically, the server can send the vehicle identity, anti-replay parameters and complete information, as well as the signature calculated based on the vehicle identity, anti-replay parameters, and integrity information, along with the upgrade package to the vehicle, and verify it. When the vehicle identity, anti-replay parameters and integrity information are all verified, the vehicle upgrade is triggered. For specific verification of the vehicle identity and anti-replay parameters, reference may be made to the descriptions in the two aforementioned embodiments, and the beneficial effects of this embodiment may include the beneficial effects of the above two vehicle verification methods.
需要注意的是,上述提及的车辆身份标识和/或防重放参数,以及完整性信息,以及根据车辆身份标识和/或防重放参数,以及完整性信息得到的签名可以包含在授权文件里面,也就是说,服务器可以在车辆需要升级时,向车辆发送升级包和授权文件,车辆可以在使用升级包升级之前,先校验该授权文件,具体关于授权文件和授权文件的校验的描述可以参见后续内容,这里先不展开。It should be noted that the vehicle identity and/or anti-replay parameters and integrity information mentioned above, and the signature obtained based on the vehicle identity and/or anti-replay parameters and integrity information can be included in the authorization file. Inside, that is to say, the server can send the upgrade package and authorization file to the vehicle when the vehicle needs to be upgraded. The vehicle can verify the authorization file before using the upgrade package to upgrade. Specifically, the verification of the authorization file and authorization file is as follows The description can be found in the following content, and will not be expanded upon here.
可以看出,在车辆升级前,通过对升级包携带的数据,包括车辆身份标识、防重放参数等等,进行校验,可以避免车辆将不适用于本车辆的升级包导入本车辆,进而影响车辆的安全,保障了车主、车厂与软件供应商之间的商业利益。It can be seen that before the vehicle is upgraded, by verifying the data carried in the upgrade package, including vehicle identification, anti-replay parameters, etc., the vehicle can be prevented from importing upgrade packages that are not suitable for the vehicle, and thus It affects the safety of vehicles and protects the commercial interests among car owners, car manufacturers and software suppliers.
下面结合图1介绍本申请实施例提供的通信系统10。The communication system 10 provided by the embodiment of the present application will be introduced below with reference to FIG. 1 .
图1为本申请实施例提供的通信系统10的结构示意图。如图1所示,该通信系统10可包括:服务器100、服务器200、车辆300。其中:Figure 1 is a schematic structural diagram of a communication system 10 provided by an embodiment of the present application. As shown in FIG. 1 , the communication system 10 may include: a server 100 , a server 200 , and a vehicle 300 . in:
服务器100可以是指软件供应商维护车辆部件的服务器,以下可称为供应商服务器,服务器100为开发和提供所述车辆升级所需的升级包的服务器。服务器100的数量可以为一个或多个。服务器100可以存储有用于升级车辆部件的一个或多个升级文件,服务器100可以对这一个或多个升级文件进行签名,得到一个或多个升级文件的编包签名,并将这一个或多 个升级文件以及编包签名打包成安装包发送给服务器200。其中,编包签名用于证明该安装包由服务器100发送,且传输过程中未被篡改。具体关于编包签名的描述可以参见后续内容,这里先不展开。The server 100 may refer to a server used by a software supplier to maintain vehicle components, which may be referred to as a supplier server below. The server 100 is a server that develops and provides upgrade packages required for vehicle upgrades. The number of servers 100 may be one or more. The server 100 may store one or more upgrade files for upgrading vehicle components. The server 100 may sign the one or more upgrade files, obtain the package signatures of the one or more upgrade files, and convert the one or more upgrade files into The upgrade file and the package signature are packaged into an installation package and sent to the server 200. The package signature is used to prove that the installation package is sent by the server 100 and has not been tampered with during transmission. The specific description of package signature can be found in the following content, which will not be discussed here.
服务器200可以是指车辆厂商的服务器,以下可称为车云服务器,服务器200用于管理车辆的升级。服务器200的数量可以为一个或多个。服务器200可以从各个软件供应商的服务器(例如服务器100)获取针对车辆不同部件的安装包,对安装包进行外层签名,并对安装包和外层签名进行打包,得到升级包。外层签名由于证明该升级包由服务器200发送,且传输过程中未被篡改。另外,服务器200还可以获取车辆300的资产信息,根据该资产信息生成授权文件,并直接与车辆进行交互,将升级包,以及授权文件发送给车辆,以供车辆实现升级。其中,资产信息可包括车辆300的软硬件版本,以及车辆身份标识、防重放参数等等。具体关于外层签名的描述可以参见后续内容,这里先不展开。The server 200 may refer to a vehicle manufacturer's server, which may be referred to as a vehicle cloud server below. The server 200 is used to manage vehicle upgrades. The number of servers 200 may be one or more. The server 200 can obtain the installation packages for different components of the vehicle from the servers of various software suppliers (for example, the server 100), perform an outer signature on the installation package, and package the installation package and the outer signature to obtain an upgrade package. The outer signature proves that the upgrade package was sent by the server 200 and has not been tampered with during transmission. In addition, the server 200 can also obtain the asset information of the vehicle 300, generate an authorization file based on the asset information, and directly interact with the vehicle to send the upgrade package and authorization file to the vehicle for the vehicle to upgrade. Among them, the asset information may include the software and hardware versions of the vehicle 300, as well as vehicle identification, anti-replay parameters, and so on. The specific description of the outer signature can be found in the following content, and will not be discussed here.
车辆300可以是指需要升级的车辆。车辆300可用于向服务器200发送资产信息,接收升级包以及授权文件,并对授权文件进行校验,包括授权文件中的签名校验,防重放参数的校验,车辆身份标识的校验、完整性信息的校验等等,以及对升级包中的外层签名和内层签名的校验,根据该升级包实现车辆的升级。具体关于授权文件的校验、以及升级包中的外层签名和内层签名的校验过程,可以参见后续内容,这里先不展开。Vehicle 300 may refer to a vehicle that needs to be upgraded. The vehicle 300 can be used to send asset information to the server 200, receive upgrade packages and authorization files, and verify the authorization files, including signature verification in the authorization file, verification of anti-replay parameters, verification of vehicle identity, Verification of integrity information, etc., as well as verification of the outer signature and inner signature in the upgrade package, and vehicle upgrades are implemented based on the upgrade package. For details about the verification of the authorization file and the verification process of the outer signature and the inner signature in the upgrade package, please refer to the following content, which will not be discussed here.
在一些实施例中,在远端升级场景下,服务器100可以对一个或多个升级文件进行编包签名,并升级文件和编包签名打包成一个安装包发送给服务器200,服务器200可以获取到不同版本、针对车辆不同部件的安装包,对该升级包进行外层签名并打包,得到针对车辆不同部件的升级包,在车辆300需要升级时,服务器200可以确定适用于车辆300的升级版本的,待升级部件的升级包,生成该升级包的授权文件,并将升级包以及授权文件发送给车辆300,车辆300再校验授权文件以及升级包中的签名,在校验通过后,根据该升级包进行车辆升级。In some embodiments, in a remote upgrade scenario, the server 100 can package and sign one or more upgrade files, and package the upgrade files and package signatures into an installation package and send it to the server 200, and the server 200 can obtain Installation packages of different versions and for different components of the vehicle are externally signed and packaged to obtain upgrade packages for different components of the vehicle. When the vehicle 300 needs to be upgraded, the server 200 can determine the upgrade version applicable to the vehicle 300 , the upgrade package of the component to be upgraded, generates the authorization file of the upgrade package, and sends the upgrade package and the authorization file to the vehicle 300. The vehicle 300 then verifies the authorization file and the signature in the upgrade package. After the verification is passed, according to the Upgrade packages for vehicle upgrades.
在另一些实施例中,在近端升级场景下,通信系统10还可以包括电子设备400。电子设备400中转服务器200发送给车辆300的升级包。例如,电子设备400可用于获取服务器200发送的升级包,以及授权文件,并通过有线传输的方式将升级包,以及授权文件导入车辆300。示例性地,电子设备400可以是指汽车销售门店中的诊断仪、电脑等设备。In other embodiments, in a near-end upgrade scenario, the communication system 10 may also include an electronic device 400. The electronic device 400 relays the upgrade package sent to the vehicle 300 by the server 200 . For example, the electronic device 400 can be used to obtain the upgrade package and the authorization file sent by the server 200, and import the upgrade package and the authorization file into the vehicle 300 through wired transmission. For example, the electronic device 400 may refer to equipment such as a diagnostic instrument and a computer in a car sales store.
在本申请实施例中,近端升级和远端升级的不同点仅在与,在车辆300需要升级时,车辆300可以通过电子设备400的中转,来实现与服务器200的交互。也就是说,当车辆通过近端升级的方式进行升级时,服务器200可以将升级包发送给电子设备400,电子设备400再通过有线传输的方式将该升级包导入车辆300,车辆300再根据该升级包进行车辆升级。In the embodiment of the present application, the only difference between the near-end upgrade and the remote upgrade is that when the vehicle 300 needs to be upgraded, the vehicle 300 can interact with the server 200 through the relay of the electronic device 400 . That is to say, when the vehicle is upgraded through near-end upgrade, the server 200 can send the upgrade package to the electronic device 400, and the electronic device 400 then imports the upgrade package into the vehicle 300 through wired transmission, and the vehicle 300 then according to the Upgrade packages for vehicle upgrades.
本申请实施例不限制服务器100、服务器200、车辆300与电子设备400之间的通信连接方式。具体地,该通信连接可以是有线连接、无线连接。其中,该无线连接可以是高保真无线通信(wireless fidelity,Wi-Fi)连接、蓝牙连接、红外线连接、NFC连接、ZigBee连接等近距离连接,也可以是远距离连接,远距离连接包括但不限于基于2G,3G,4G,5G以及后续标准协议的移动网络的远距离连接。例如,服务器100可以通过无线连接的方式将升级包以及升级包的签名发送给服务器200。The embodiment of the present application does not limit the communication connection method between the server 100, the server 200, the vehicle 300 and the electronic device 400. Specifically, the communication connection may be a wired connection or a wireless connection. Among them, the wireless connection can be a high-fidelity wireless communication (wireless fidelity, Wi-Fi) connection, a Bluetooth connection, an infrared connection, an NFC connection, a ZigBee connection and other short-range connections, or it can be a long-distance connection, and the long-distance connection includes but does not Limited to long-distance connections based on mobile networks based on 2G, 3G, 4G, 5G and subsequent standard protocols. For example, the server 100 may send the upgrade package and the signature of the upgrade package to the server 200 through a wireless connection.
另外,需要注意的是,本申请各实施例中提到的服务器,例如服务器100或服务器200等等,可以是一个服务器,也可以是指多个服务器组成的服务器集群。例如,服务器200可以为多个服务器通过分布式架构部署的服务器集群,集群中可以包括云计算服务器、内容分发网络(Content Delivery Network,CDN)服务器、网络时间协议(Network Time Protocol, NTP)、域名解析系统(Domain Name System,DNS)服务器等等中的一个或者多个。其中,各个服务器之间可以相互协调,共同完成计算、数据存储、通信等功能。例如,服务器200可以包括服务器201和服务器202,服务器201和服务器202都包含各个软件供应商提供的升级包,车辆300可以与服务器201交互,完成车辆的升级,也可以与服务器202交互,完成车辆的升级。为了方便描述,本申请实施例中将单个服务器、分布式服务器、服务器集群等统称为服务器。In addition, it should be noted that the server mentioned in the embodiments of this application, such as server 100 or server 200, etc., may be one server or a server cluster composed of multiple servers. For example, the server 200 can be a server cluster in which multiple servers are deployed through a distributed architecture. The cluster can include a cloud computing server, a Content Delivery Network (Content Delivery Network, CDN) server, and a Network Time Protocol (Network Time Protocol). NTP), Domain Name System (Domain Name System, DNS) server, etc. One or more. Among them, various servers can coordinate with each other to jointly complete functions such as computing, data storage, and communication. For example, the server 200 can include a server 201 and a server 202. Both the server 201 and the server 202 include upgrade packages provided by various software vendors. The vehicle 300 can interact with the server 201 to complete the vehicle upgrade, and can also interact with the server 202 to complete the vehicle upgrade. upgrade. For convenience of description, in the embodiments of this application, a single server, a distributed server, a server cluster, etc. are collectively referred to as servers.
具体关于远端升级和近端升级的概念解释可以参见前述内容,这里不再赘述。具体关于远端升级和近端升级过程中,各设备之间的详细交互过程可以参见后续方法实施例,这里先不赘述。For a specific explanation of the concepts of remote upgrade and near-end upgrade, please refer to the above content and will not be repeated here. For details about the detailed interaction process between the devices during the remote upgrade and local upgrade processes, please refer to subsequent method embodiments, and will not be described in detail here.
图2A为本申请实施例提供的车辆300的结构示意图。FIG. 2A is a schematic structural diagram of a vehicle 300 provided by an embodiment of the present application.
如图2A所示,车辆300包括:控制器局域网络(controller area network,CAN)总线11、多个电子控制单元(electronic control unit,ECU)、发动机13、车载盒子(telematics box,T-box)14、变速器15、行车记录仪16、防抱死系统(antilock brake system,ABS)17、传感器系统18、摄像系统19,麦克风20,等等。As shown in Figure 2A, the vehicle 300 includes: a controller area network (CAN) bus 11, a plurality of electronic control units (ECUs), an engine 13, and a vehicle box (telematics box, T-box) 14. Transmission 15. Driving recorder 16. Antilock brake system (ABS) 17. Sensor system 18. Camera system 19. Microphone 20, etc.
CAN总线11是支持分布式控制或实时控制的串行通信网络,用于连接车辆300的各个部件。在CAN总线11上的任何部件都可以监听到CAN总线11上传输的所有数据。CAN总线11传输的帧可以包含数据帧、远程帧、错误帧、过载帧,不同的帧传输不同类型的数据。在本申请实施例中,CAN总线11可用于传输各个部件在基于语音指令的控制方法中涉及到的数据,该方法的具体实现可参考后文方法实施例的详细描述。The CAN bus 11 is a serial communication network that supports distributed control or real-time control and is used to connect various components of the vehicle 300 . Any component on the CAN bus 11 can monitor all data transmitted on the CAN bus 11. The frames transmitted by CAN bus 11 can include data frames, remote frames, error frames, and overload frames. Different frames transmit different types of data. In the embodiment of the present application, the CAN bus 11 can be used to transmit data involved in various components in the control method based on voice instructions. For the specific implementation of this method, please refer to the detailed description of the method embodiment below.
不限于CAN总线11,在其他一些实施例中,车辆300的各个部件还可以通过其他方式来连接及通信。如,各个部件还可以通过车载以太网(ethernet)局域互联网络(local interconnect network,LIN)总线、FlexRay及常用车载网络系统(media oriented systems,MOST)总线等等通信,本申请实施例对此不做限制。以下实施例以各个部件通过CAN总线11通信进行说明。Not limited to the CAN bus 11, in some other embodiments, various components of the vehicle 300 can also be connected and communicated through other methods. For example, each component can also communicate through the vehicle Ethernet (ethernet) local interconnect network (LIN) bus, FlexRay and common vehicle network system (media oriented systems, MOST) bus, etc., the embodiments of this application are No restrictions. The following embodiments are described based on the communication of various components through the CAN bus 11.
ECU相当于车辆300的处理器或大脑,用于根据从CAN总线11上获取的指令或者根据用户输入的操作,指示对应的部件执行相应的动作。ECU可以由安全芯片、微处理器((microcontroller unit,MCU)、随机存取存储器(random access memory,RAM)、只读存储器(random-only memory,ROM)、输入/输出接口(I/O)、模拟/数字转换器(A/D转换器)以及输入、输出、整形、驱动等大规模集成电路组成。The ECU is equivalent to the processor or brain of the vehicle 300 and is used to instruct corresponding components to perform corresponding actions according to instructions obtained from the CAN bus 11 or according to operations input by the user. ECU can be composed of a security chip, a microprocessor (microcontroller unit, MCU), a random access memory (random access memory, RAM), a read-only memory (random-only memory, ROM), and an input/output interface (I/O). , analog/digital converter (A/D converter) and input, output, shaping, drive and other large-scale integrated circuits.
ECU的种类繁多,不同种类的ECU可以用于实现不同的功能。There are many types of ECUs, and different types of ECUs can be used to implement different functions.
车辆300中的多个ECU例如可包括:发动机ECU121,车载盒子(telematics box,T-box)的ECU122,变速器ECU123,行车记录仪ECU124,防抱死系统(antilock brake system,ABS)ECU 125等。The multiple ECUs in the vehicle 300 may include, for example: an engine ECU 121, a telematics box (T-box) ECU 122, a transmission ECU 123, a driving recorder ECU 124, an anti-lock brake system (antilock brake system, ABS) ECU 125, etc.
发动机ECU121用于管理发动机,协调发动机的各个功能,例如可用于启动发动机、关闭发动机等等。发动机是为车辆300提供动力的装置。发动机是将某一种形式的能量转换为机械能的机器。车辆300可用于将液体或气体燃烧的化学能,或者将电能转化为机械能并对外输出动力。发动机组成部分可以包括曲柄连杆机构和配气机构两大机构,以及冷却、润滑、点火、能量供给、启动系统等五大系统。发动机的主要部件有气缸体、气缸盖、活塞、活塞销、连杆、曲轴、飞轮等。The engine ECU121 is used to manage the engine and coordinate various functions of the engine. For example, it can be used to start the engine, shut down the engine, etc. The engine is the device that powers vehicle 300 . An engine is a machine that converts some form of energy into mechanical energy. The vehicle 300 may be used to burn chemical energy of liquid or gas, or convert electrical energy into mechanical energy and output power to the outside. The engine components can include two major mechanisms, the crank connecting rod mechanism and the valve mechanism, as well as five major systems including cooling, lubrication, ignition, energy supply, and starting system. The main components of the engine include cylinder block, cylinder head, piston, piston pin, connecting rod, crankshaft, flywheel, etc.
T-box ECU122用于管理T-box14。T-box ECU122 is used to manage T-box14.
T-box14主要负责和互联网通信,为车辆300提供远程通讯接口,提供包括导航、娱乐、 行车数据采集、行驶轨迹记录、车辆故障监控、车辆远程查询和控制(如开闭锁、空调控制、车窗控制、发动机扭矩限制、发动机启停、调整座椅,查询电池电量、油量、车门状态等)、驾驶行为分析、无线热点分享、道路救援、异常提醒等服务。T-box14 is mainly responsible for communicating with the Internet, providing a remote communication interface for the vehicle 300, including navigation, entertainment, Driving data collection, driving trajectory recording, vehicle fault monitoring, vehicle remote query and control (such as opening and closing, air conditioning control, window control, engine torque limit, engine start and stop, seat adjustment, battery power, fuel level, door status query etc.), driving behavior analysis, wireless hotspot sharing, roadside assistance, abnormality reminder and other services.
T-box14可用于和汽车远程服务提供商(telematics service provider,TSP)以及用户(如驾驶员)侧电子设备通信,实现电子设备上的车辆状态显示与控制。当用户通过电子设备上的车辆管理应用发送控制命令后,TSP会发出请求指令到T-box14,T-box14在获取到控制命令后,通过CAN总线发送控制报文并实现对车辆300的控制,最后反馈操作结果到用户侧电子设备上的车辆管理应用上。也就是说,T-box14通过CAN总线11读取到的数据,例如车况报告、行车报告、油耗统计、违章查询、位置轨迹、驾驶行为等数据,可以通过网络将传输到TSP后台系统,由TSP后台系统转发给用户侧的电子设备,以供用户查看。T-box14 can be used to communicate with car telematics service provider (TSP) and user (such as driver) side electronic devices to realize vehicle status display and control on electronic devices. When the user sends a control command through the vehicle management application on the electronic device, the TSP will send a request command to T-box14. After obtaining the control command, T-box14 sends a control message through the CAN bus and controls the vehicle 300. Finally, the operation results are fed back to the vehicle management application on the user-side electronic device. In other words, the data read by T-box14 through CAN bus 11, such as vehicle condition reports, driving reports, fuel consumption statistics, violation inquiries, location tracks, driving behavior and other data, can be transmitted to the TSP backend system through the network, and the TSP The background system forwards it to the electronic device on the user side for viewing by the user.
T-box14具体可包括通信模块和显示屏。T-box14 may specifically include a communication module and a display screen.
其中,通信模块可用于提供无线通信功能,支持车辆300通过无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)、超宽带(ultra-wideband,UWB)等无线通信技术和其他设备通信。通信模块还可用于提供移动通信功能,支持车辆300通过全球移动通讯系统(global system for mobile communications,GSM)、通用移动通信系统(universal Mobile telecommunications system,UMTS)、宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),5G以及未来出现的6G等通信技术和其他设备通信。Among them, the communication module can be used to provide wireless communication functions to support the vehicle 300 through wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation Satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), ultra-wideband (UWB), etc. Wireless communication technology communicates with other devices. The communication module can also be used to provide mobile communication functions to support the vehicle 300 through the global system for mobile communications (GSM), universal mobile telecommunications system (UMTS), wideband code division multiple access (wideband code division) multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), 5G and 6G and other communication technologies that will appear in the future and communicate with other devices.
通信模块可以通过基于蜂窝网络的车辆与万物(vehicle to everything,V2X)通信技术(cellular V2X,C-V2X)和其他设备如服务器、用户侧电子设备等建立连接并通信。C-V2X例如可包括基于长期演进(long term evolution,LTE)的V2X(LTE-V2X)、5G-V2X等。The communication module can establish connections and communicate with other devices such as servers and user-side electronic devices through vehicle to everything (V2X) communication technology (cellular V2X, C-V2X) based on cellular networks. C-V2X may include, for example, V2X based on long term evolution (LTE) (LTE-V2X), 5G-V2X, etc.
在一些实施例中,通信模块可用于实现车辆300和服务器,例如服务器200之间的通信,将车辆300中的资产信息,例如软硬件版本、车辆身份标识、防重放参数等等发送给服务器,以便服务器确定适用于车辆300的升级包,通信模块还可用于获取服务器发送的升级包以及授权文件等等。In some embodiments, the communication module can be used to implement communication between the vehicle 300 and a server, such as the server 200, and send asset information in the vehicle 300, such as software and hardware versions, vehicle identification, anti-replay parameters, etc., to the server. , so that the server can determine the upgrade package applicable to the vehicle 300, and the communication module can also be used to obtain the upgrade package and authorization file sent by the server, etc.
显示屏用于为驾驶员提供可视化的界面。车辆300中可包括一个或多个显示屏,例如可包括设置于驾驶座前方的车载显示屏,设置于座椅上方的用于显示周边情况的显示屏,还可包括将信息投射到风窗玻璃上的抬头数字显示仪(head up display,HUD)等等。The display screen is used to provide a visual interface to the driver. The vehicle 300 may include one or more display screens, for example, it may include a vehicle-mounted display screen disposed in front of the driver's seat, a display screen disposed above the seat for displaying surrounding conditions, and may also include projecting information onto the windshield. Head-up digital display (HUD) on the computer, etc.
T-box14也可以被称为车机系统、远程信息处理器、车辆网关等等,本申请实施例对此不作限制。T-box 14 may also be called a vehicle-machine system, a telematics processor, a vehicle gateway, etc., and the embodiments of this application do not limit this.
变速器ECU123用于管理变速器。The transmission ECU123 is used to manage the transmission.
变速器15可以用来改变发动机的转速和转矩的机构,它能固定或分档改变输出轴和输入轴传动比。变速器15组成部分可以包含变速传动机构、操纵机构以及动力输出机构等。变速传动机构的主要作用是改变转矩和转速的数值和方向;操纵机构的主要作用是控制传动机构,实现变速器传动比的变换,即实现换档,以达到变速变矩。The transmission 15 can be used to change the engine speed and torque. It can fix or change the output shaft and input shaft transmission ratios in stages. The components of the transmission 15 may include a transmission mechanism, a control mechanism, a power output mechanism, etc. The main function of the speed change transmission mechanism is to change the value and direction of torque and rotational speed; the main function of the control mechanism is to control the transmission mechanism to realize the transformation of the transmission ratio, that is, to achieve gear shifting, in order to achieve variable speed and torque.
行车记录仪ECU124用于管理行车记录仪16。The driving recorder ECU 124 is used to manage the driving recorder 16 .
行车记录仪16组成部分可以包括主机、车速传感器、数据分析软件等。行车记录仪16是指记录车辆行驶途中的影像及声音包括行车时间、速度、所在位置等相关资讯的仪器。在 本申请实施例中,当车辆行驶时,车速传感器采集到车轮转速,并将车速信息通过CAN总线发送给行车记录仪16。The driving recorder 16 components may include a host computer, a vehicle speed sensor, data analysis software, etc. The driving recorder 16 refers to an instrument that records the images and sounds of the vehicle during driving, including driving time, speed, location and other related information. exist In the embodiment of the present application, when the vehicle is driving, the vehicle speed sensor collects the wheel speed and sends the vehicle speed information to the driving recorder 16 through the CAN bus.
ABS ECU125用于管理ABS17。ABS ECU125 is used to manage ABS17.
ABS17是在车辆制动时,自动控制制动器制动力的大小,使车轮不被抱死,处于边滚边滑的状态,以保证车轮与地面的附着力为最大值。在制动过程中,电子控制装置根据车轮转速传感器输入的车轮转速信号判定有车轮趋于抱死时,ABS就进入防抱死制动压力调节过程。ABS17 automatically controls the braking force of the brake when the vehicle is braking, so that the wheels are not locked and are in a rolling and sliding state to ensure the maximum adhesion between the wheels and the ground. During the braking process, when the electronic control device determines that a wheel tends to lock based on the wheel speed signal input by the wheel speed sensor, the ABS will enter the anti-lock brake pressure adjustment process.
传感器系统18可包括:加速度传感器、车速传感器、震动传感器、陀螺仪传感器、雷达传感器,信号发射器,信号接收器等等。加速度传感器及车速传感器用于检测车辆300的速度。震动传感器可以设置在座位下方、安全带、椅背、操作面板、气囊或其他位置,用于检测车辆300是否被碰撞以及用户所在位置。陀螺仪传感器可以用于确定车辆300的运动姿态。雷达传感器可包括激光雷达、超声波雷达、毫米波雷达等。雷达传感器用于发射电磁波对目标进行照射并接收其回波,由此获得目标至电磁波发射点的距离、距离变化率(径向速度)、方位、高度等信息,从而识别车辆300附近的其他车辆、行人或路障等。信号发射器和信号接收器用于收发信号,该信号可用于检测用户所在位置,该信号例如可以是超声波、毫米波、激光等。The sensor system 18 may include: an acceleration sensor, a vehicle speed sensor, a vibration sensor, a gyroscope sensor, a radar sensor, a signal transmitter, a signal receiver, etc. The acceleration sensor and the vehicle speed sensor are used to detect the speed of the vehicle 300 . The shock sensor can be disposed under the seat, on the seat belt, on the seat back, on the operating panel, on the airbag or in other locations to detect whether the vehicle 300 is collided and where the user is. A gyro sensor may be used to determine the motion attitude of vehicle 300 . Radar sensors can include lidar, ultrasonic radar, millimeter wave radar, etc. The radar sensor is used to emit electromagnetic waves to illuminate the target and receive its echo, thereby obtaining information such as the distance from the target to the electromagnetic wave emission point, distance change rate (radial velocity), orientation, altitude, etc., thereby identifying other vehicles near the vehicle 300 , pedestrians or roadblocks, etc. The signal transmitter and signal receiver are used to send and receive signals. The signals can be used to detect the location of the user. The signals can be, for example, ultrasonic waves, millimeter waves, lasers, etc.
摄像系统19可包括多个摄像头,摄像头用于捕获静态图像或视频。摄像系统19中的摄像头可以设置在车前、车后、侧边、车内等位置,便于实现辅助驾驶、行车记录、全景环视、车内监控等功能。Camera system 19 may include multiple cameras for capturing still images or video. The cameras in the camera system 19 can be set in front, behind, side, or inside the car to facilitate functions such as assisted driving, driving recording, panoramic view, and in-car monitoring.
传感器系统18、摄像系统19可用于检测周边环境,便于车辆300做出相应的决策来应对环境变化,例如可用于自动驾驶阶段完成对周边环境进行关注的任务。The sensor system 18 and the camera system 19 can be used to detect the surrounding environment to facilitate the vehicle 300 to make corresponding decisions to respond to environmental changes. For example, they can be used to complete the task of paying attention to the surrounding environment during the autonomous driving phase.
麦克风20,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或输出语音指令时,用户可以通过人嘴靠近麦克风20发声,将声音信号输入到麦克风20。车辆300可以设置至少一个麦克风20。在另一些实施例中,车辆300可以设置两个麦克风20,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,车辆300还可以设置三个,四个或更多麦克风20,形成麦克风阵列,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 20, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or outputting a voice command, the user can speak close to the microphone 20 with the human mouth and input the sound signal to the microphone 20 . The vehicle 300 may be provided with at least one microphone 20 . In other embodiments, the vehicle 300 may be provided with two microphones 20, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the vehicle 300 can also be equipped with three, four or more microphones 20 to form a microphone array to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
此外,车辆300还可以包括多个接口,例如USB接口,RS-232接口、RS485接口等等,可外接摄像头、麦克风、耳机以及用户侧电子设备。In addition, the vehicle 300 may also include multiple interfaces, such as a USB interface, an RS-232 interface, an RS485 interface, etc., and may be connected to external cameras, microphones, headphones, and user-side electronic devices.
在本申请实施例中,麦克风20可用于检测用户输入的语音指令。传感器系统18、摄像系统19、T-box14等可用于获取输入该语音指令的用户的角色信息。车辆300中各个部件获取用户的角色信息的方式,可参考后续方法实施例中的相关描述。T-box ECU122可用于根据该角色信息判断当前该用户是否具备该语音指令对应的权限,仅在具备权限的情况下,T-box ECU122才调度车辆300中的相应部件来响应该语音指令。In this embodiment of the present application, the microphone 20 may be used to detect voice instructions input by the user. The sensor system 18, the camera system 19, the T-box 14, etc. can be used to obtain the character information of the user who inputs the voice command. For the manner in which each component in the vehicle 300 obtains the user's role information, please refer to the relevant descriptions in subsequent method embodiments. The T-box ECU 122 can be used to determine whether the current user has the permission corresponding to the voice command based on the role information. Only if the user has the permission, the T-box ECU 122 dispatches the corresponding components in the vehicle 300 to respond to the voice command.
在一些实施例中,车辆300中的存储器可用于存储车辆身份标识、防重放参数,以及公钥和公钥的哈希值等等。具体关于车辆300中存储的内容可以参见后续内容,这里先不展开。In some embodiments, the memory in the vehicle 300 may be used to store the vehicle identity, anti-replay parameters, public keys and hash values of the public keys, and the like. For details about the content stored in the vehicle 300, please refer to the following content, which will not be discussed here.
可以理解的是,本申请实施例示意的结构并不构成对车辆系统的具体限定。本申请实施例对电子控制单元ECU的数量不作限制。车辆300可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the vehicle system. The embodiment of the present application does not limit the number of electronic control units ECU. Vehicle 300 may include more or fewer components than illustrated, some components combined, some components separated, or different component arrangements. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
例如,车辆300还可包括单独的存储器、电池、车灯、雨刷、仪表盘、音响、车载终端(transmission control unit,TCU)、辅助控制单元(auxiliary control unit,ACU)、智能进入及启 动系统(passive entry passive start,PEPS)、车载单元(on board unit,OBU)、车身控制模块(body control module,BCM)、充电接口等等。For example, the vehicle 300 may also include a separate memory, battery, lights, wipers, instrument panel, audio, vehicle terminal (transmission control unit, TCU), auxiliary control unit (auxiliary control unit, ACU), smart entry and start-up. Passive entry passive start (PEPS), on board unit (OBU), body control module (BCM), charging interface, etc.
图2B示例性示出了车辆300的电子电气架构图。FIG. 2B illustrates an electrical and electronic architecture diagram of the vehicle 300 .
从图2A可以看出,车辆300包含多个部件,可以根据车辆300包含的多个部件,对车辆300的软硬件进行划分,得到整车电子电气系统的总布局方案。如图2B所示,可以将车辆300划分为多个功能域,一个功能域可以包含一个域控制器(Domain Controller,DC)及其连接的多个电子控制单元ECU等部件。示例性地,车辆的功能域可以包括:动力域、底盘域、座舱域、车身域、自动驾驶域。It can be seen from FIG. 2A that the vehicle 300 includes multiple components. According to the multiple components included in the vehicle 300, the software and hardware of the vehicle 300 can be divided to obtain the overall layout plan of the vehicle electronic and electrical system. As shown in Figure 2B, the vehicle 300 can be divided into multiple functional domains. One functional domain can include a domain controller (Domain Controller, DC) and multiple connected electronic control units (ECUs) and other components. For example, the functional domains of the vehicle may include: power domain, chassis domain, cockpit domain, body domain, and autonomous driving domain.
应理解,车辆的升级实际是指车辆中搭载的各部件的升级。不同功能域中的部件的升级主要由各自功能域进行管理。It should be understood that the upgrade of a vehicle actually refers to the upgrade of each component installed in the vehicle. Upgrades of components in different functional domains are mainly managed by their respective functional domains.
对于车辆的升级,域控制器DC包含两个逻辑功能模块:域升级控制器(Domain Update Controller,DUC)、域安装器(Domain Installer,DI)。其中:For vehicle upgrades, the domain controller DC contains two logical functional modules: Domain Upgrade Controller (Domain Update Controller, DUC) and Domain Installer (Domain Installer, DI). in:
域升级控制器DUC用于负责本域的所有部件的升级包,以及升级包的授权文件的下载,对升级包的合法性校验,以及对本域部件升级的整体控制。其中,该域升级控制器DUC对升级包的合法性校验可以是指对升级包中的外层签名的校验,该校验用于确定升级包的来源(例如图1所示的服务器200)是否合法,升级包的内容是否被篡改等等。具体关于外层签名的描述可以参见后续内容,这里先不展开。The domain upgrade controller DUC is responsible for the upgrade packages of all components in the domain, downloading the authorization files of the upgrade packages, verifying the legality of the upgrade packages, and overall control of the upgrade of components in the domain. Wherein, the domain upgrade controller DUC's legality verification of the upgrade package may refer to verification of the outer signature in the upgrade package, and this verification is used to determine the source of the upgrade package (for example, the server 200 shown in Figure 1 ) is legal, whether the contents of the upgrade package have been tampered with, etc. The specific description of the outer signature can be found in the following content, and will not be discussed here.
域安装器DI用于负责对授权文件的校验,对本域的升级包的合法性校验,以及安装升级包之前,对车辆升级前的条件检查,包括电压、车速等等的检查,以及升级过程中对本域部件的升级刷写。其中,域安装器DI对升级包的合法性校验可以是指对升级包中的编包签名的校验,该校验用于确定升级包的来源(例如图1所示的服务器100)是否合法,升级包的内容是否被篡改等等。其中,授权文件的校验包括车辆身份标识的校验、防重放参数的校验、完整性信息的校验、授权文件的签名校验等等,具体关于编包签名、授权文件的描述可以参见后续内容,这里先不展开。The domain installer DI is responsible for verifying the authorization file, verifying the legality of the upgrade package of this domain, and checking the conditions of the vehicle before upgrading, including voltage, speed, etc., before installing the upgrade package, and upgrading. During the process, the components of this domain are upgraded and refreshed. The legality verification of the upgrade package by the domain installer DI may refer to the verification of the package signature in the upgrade package. This verification is used to determine whether the source of the upgrade package (for example, the server 100 shown in Figure 1) Legal, whether the contents of the upgrade package have been tampered with, etc. Among them, the verification of authorization files includes verification of vehicle identity, verification of anti-replay parameters, verification of integrity information, signature verification of authorization files, etc. Specific descriptions of packaged signatures and authorization files can be See the subsequent content, which will not be expanded upon here.
另外,车辆300中还包括一个车辆升级控制器(Vehicle Update Controller,VUC),该车辆升级控制器VUC部署在某一个域控制器DC上。In addition, the vehicle 300 also includes a Vehicle Update Controller (VUC), which is deployed on a certain domain controller DC.
其中,在车辆升级过程中,车辆升级控制器VUC可以负责与服务器(例如图1所示的服务器200)交互,向该服务器上传资产信息,例如,软硬件版本,车辆身份标识,防重放参数等等,从服务器获取下载策略(Download Policy,DP)包。其中,该DP包可以包括各功能域的升级包的下载地址,车辆升级控制器VUC可用于解析该DP包,将升级包的下载地址发送给对应的功能域的域控制器DC,并协调升级包的下载和安装,以供各域控制器DC下载得到该功能域中部件的升级包,从而完成车辆各个部件的升级。具体关于DP包,以及通过DP包获取升级包的描述可以参见后续方法实施例,这里先不展开。Among them, during the vehicle upgrade process, the vehicle upgrade controller VUC can be responsible for interacting with the server (such as the server 200 shown in Figure 1) and uploading asset information to the server, such as software and hardware versions, vehicle identification, and anti-replay parameters. Wait, obtain the Download Policy (DP) package from the server. Among them, the DP package can include the download address of the upgrade package of each functional domain. The vehicle upgrade controller VUC can be used to parse the DP package, send the download address of the upgrade package to the domain controller DC of the corresponding functional domain, and coordinate the upgrade. Download and install the package so that each domain controller DC can download the upgrade package for the components in the functional domain, thereby completing the upgrade of each component of the vehicle. Specific descriptions of the DP package and obtaining the upgrade package through the DP package can be found in subsequent method embodiments, which will not be discussed here.
可以理解的是,校验授权文件的模块不限于域安装器DI,例如,通过域升级控制器DUC校验授权文件,本申请实施例对校验授权文件的模块不做限制。It can be understood that the module for verifying the authorization file is not limited to the domain installer DI. For example, the authorization file is verified through the domain upgrade controller DUC. The embodiment of the present application does not limit the module for verifying the authorization file.
另外,域控制器DC一般还支持安全启动功能,该安全启动功能能够利用预置的公钥,例如服务器100生成的密钥对中的公钥,验证车辆上加载的软件,是否受信任。也就是说,只有通过公钥对应的私钥签名过的软件才能够通过验证并在车辆内部正常启动,而未通过验证的软件则无法加载。这样,可以避免攻击者直接拆机干涉车辆部件,恶意读写车辆的软件, 损害车厂和软件制造厂商的商业利益。In addition, the domain controller DC generally supports a secure boot function, which can use a preset public key, such as the public key in the key pair generated by the server 100, to verify whether the software loaded on the vehicle is trusted. In other words, only software signed by the private key corresponding to the public key can pass verification and start normally inside the vehicle, while software that fails verification cannot be loaded. In this way, attackers can be prevented from directly disassembling the vehicle components and maliciously reading and writing the vehicle's software. Harm the commercial interests of car manufacturers and software manufacturers.
在本申请实施例中,在车辆接收到升级包和授权文件,并根据该升级包完成车辆部件的升级后,可以在部件通过安全启动功能进行安全启动时,再触发对授权文件的校验,进一步避免攻击者直接拆机将不适用于本车辆的升级包导入本车辆,更改部件通过升级包升级后的软件程序。由于部件的安全启动过程,具体为软件的逐级启动,即上一级软件启动下一级软件,并在启动下一级软件之前,校验该下一级软件的安全性,其中包括授权文件的校验、编包签名的校验等等,校验通过则说明该下一级软件安全,控制流再移交给下一级软件,继续校验软件的安全性,依次类推,直到该部件中的所有软件都通过校验,则说明部件中的软件安全,即软件来源于软件供应商,且未被经过攻击方篡改,且软件来源不是老版本升级包、其他车辆的升级包、研发阶段使用的升级包等等。进一步地,如果部件使用了车云服务器发送的升级包进行升级,且安全启动阶段对授权文件的校验通过,则说明当前部件运行的程序为经过车云服务器发送的升级包升级后,导入到该部件的软件数据,避免了车辆运行老版本的升级包、其他车辆的升级包、研发阶段使用的升级包等等升级包中的软件数据。In the embodiment of this application, after the vehicle receives the upgrade package and the authorization file, and completes the upgrade of the vehicle components according to the upgrade package, the verification of the authorization file can be triggered again when the components are safely started through the safe start function. This further prevents attackers from directly disassembling the machine, importing upgrade packages that are not applicable to the vehicle, and changing components to software programs that have been upgraded through the upgrade packages. Due to the secure startup process of components, specifically the step-by-step startup of software, that is, the upper-level software starts the lower-level software, and before starting the lower-level software, the security of the lower-level software is verified, including the authorization file. Verification, package signature verification, etc. If the verification passes, it means that the next-level software is safe, and the control flow is handed over to the next-level software, and the security of the software continues to be verified, and so on, until the component If all the software passes the verification, it means that the software in the component is safe, that is, the software comes from the software supplier and has not been tampered with by the attacker, and the source of the software is not an old version upgrade package, an upgrade package for other vehicles, or one used in the research and development stage. upgrade packages, etc. Furthermore, if the component is upgraded using the upgrade package sent by the car cloud server, and the verification of the authorization file passes during the secure startup phase, it means that the program currently running on the component is imported into the program after being upgraded with the upgrade package sent by the car cloud server. The software data of this component avoids the need for vehicles to run old version upgrade packages, upgrade packages for other vehicles, upgrade packages used in the research and development stage, and other software data in upgrade packages.
可以看出,在车辆的安全启动阶段校验授权文件,可以避免车辆运行未经校验的程序,防止攻击者直接拆机将不适用于本车辆的升级包,例如老版本的升级包、其他车辆的升级包、研发阶段使用的升级包中的软件数据导入到本车辆,从而在车辆的启动阶段,严格把控车辆的安全运行,保障了车辆的安全,维护了车厂和软件制造厂商的商业利益。It can be seen that verifying the authorization file during the safe startup phase of the vehicle can prevent the vehicle from running unverified programs and prevent attackers from directly disassembling upgrade packages that are not applicable to the vehicle, such as old version upgrade packages and other upgrade packages. The software data in the vehicle's upgrade package and the upgrade package used in the research and development phase are imported into the vehicle, thereby strictly controlling the safe operation of the vehicle during the startup phase, ensuring the safety of the vehicle and maintaining the business of the car factory and software manufacturer. Benefit.
具体关于安全启动过程中的详细描述可以参见后续内容,这里先不赘述。For a detailed description of the secure boot process, please refer to the following content, so I won’t go into details here.
上述电子电气架构图只是示例性举例,不构成对本申请的限制,应理解,在本申请其他实施例中,车辆的电子电气架构图还可以存在其他结构,并且,本申请实施例对上述电子电气架构图中提及的域控制器DC、域升级控制器DUC、域安装器DI、车辆升级控制器VUC的名称不作限制。The above electronic and electrical architecture diagram is only an illustrative example and does not constitute a limitation of the present application. It should be understood that in other embodiments of the present application, the electronic and electrical architecture diagram of the vehicle may also have other structures, and the embodiment of the present application does not limit the above electronic and electrical architecture. There are no restrictions on the names of domain controller DC, domain upgrade controller DUC, domain installer DI, and vehicle upgrade controller VUC mentioned in the architecture diagram.
图3为本申请实施例提供的电子设备500的硬件结构图。FIG. 3 is a hardware structure diagram of the electronic device 500 provided by the embodiment of the present application.
如图3所示,电子设备500可以包括:一个或多个处理器201、存储器202、通信接口203、发射器205、接收器206、耦合器207和天线208。这些部件可通过总线204或者其他方式连接,图3以通过总线连接为例。其中:As shown in FIG. 3 , electronic device 500 may include: one or more processors 201 , memory 202 , communication interface 203 , transmitter 205 , receiver 206 , coupler 207 and antenna 208 . These components can be connected through the bus 204 or other ways. Figure 3 takes the connection through the bus as an example. in:
通信接口203可用于电子设备500与其他通信设备,例如电子设备400。具体的,通信接口203可以是3G通信接口、长期演进(LTE)(4G)通信接口、5G通信接口、WLAN通信接口、WAN通信接口等等。不限于无线通信接口,电子设备500还可以配置有线的通信接口203来支持有线通信,例如电子设备500与其他服务器之间的回程链接可以是有线通信连接。The communication interface 203 may be used between the electronic device 500 and other communication devices, such as the electronic device 400 . Specifically, the communication interface 203 may be a 3G communication interface, a Long Term Evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to wireless communication interfaces, the electronic device 500 can also be configured with a wired communication interface 203 to support wired communication. For example, the backhaul link between the electronic device 500 and other servers can be a wired communication connection.
在本申请的一些实施例中,发射器205和接收器206可看作一个无线调制解调器。发射器205可用于对处理器201输出的信号进行发射处理。接收器206可用于接收信号。在电子设备500中,发射器205和接收器206的数量均可以是一个或者多个。天线208可用于将传输线中的电磁能转换成自由空间中的电磁波,或者将自由空间中的电磁波转换成传输线中的电磁能。耦合器207可用于将移动通信号分成多路,分配给多个的接收器206。可理解的,电子设备500的天线208可以实现为大规模天线阵列。In some embodiments of the present application, transmitter 205 and receiver 206 may be viewed as a wireless modem. The transmitter 205 can be used to transmit the signal output by the processor 201. Receiver 206 may be used to receive signals. In the electronic device 500, the number of each of the transmitter 205 and the receiver 206 may be one or more. Antenna 208 may be used to convert electromagnetic energy in the transmission line into electromagnetic waves in free space, or to convert electromagnetic waves in free space into electromagnetic energy in the transmission line. The coupler 207 can be used to split the mobile communication signal into multiple channels and distribute them to multiple receivers 206 . It can be understood that the antenna 208 of the electronic device 500 can be implemented as a large-scale antenna array.
存储器202与处理器201耦合,用于存储各种软件程序和/或多组指令。具体的,存储器202可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存 储设备、闪存设备或其他非易失性固态存储设备。Memory 202 is coupled to processor 201 for storing various software programs and/or sets of instructions. Specifically, the memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk memories. storage device, flash memory device or other non-volatile solid-state storage device.
存储器202可以存储操作系统(下述简称系统),例如uCOS、VxWorks、RTLinux等嵌入式操作系统。The memory 202 can store an operating system (hereinafter referred to as the system), such as uCOS, VxWorks, RTLinux and other embedded operating systems.
本申请实施例中,处理器201可用于读取和执行计算机可读指令。In this embodiment of the present application, the processor 201 may be used to read and execute computer-readable instructions.
在本申请实施例中,当电子设备500为供应商服务器时:In this embodiment of the present application, when the electronic device 500 is a supplier server:
发射器205可用于向车云服务器发送安装包。The transmitter 205 can be used to send the installation package to the car cloud server.
处理器201可用于生成用于编包签名的密钥,对一个或多个升级文件进行编包签名。The processor 201 may be configured to generate a key for package signing, and perform package signing on one or more upgrade files.
存储器202可用于存储本地生成的密钥,例如,用于对升级文件进行编包签名的私钥。Memory 202 may be used to store locally generated keys, such as private keys used to package-sign upgrade files.
在本申请实施例中,当电子设备500为车云服务器时:In this embodiment of the present application, when the electronic device 500 is a car cloud server:
发射器205可用于将DP包、升级包和授权文件等等发送给车辆或诊断终端。The transmitter 205 can be used to send DP packages, upgrade packages, authorization files, etc. to the vehicle or diagnostic terminal.
接收器206可用于接收供应商服务器发送的安装包,以及车辆或诊断终端发送的资产信息、下载请求等等。The receiver 206 may be used to receive installation packages sent by the supplier server, as well as asset information, download requests, etc. sent by the vehicle or diagnostic terminal.
处理器201可用于生成密钥对,对安装包进行外层签名,根据资产信息确定升级包并生成授权文件以及DP包等等。The processor 201 can be used to generate a key pair, perform an outer signature on the installation package, determine the upgrade package based on the asset information, and generate authorization files and DP packages, etc.
存储器202可用于存储升级包,以及本地生成的密钥,例如用于对车辆身份标识、防重放参数、完整性信息进行签名的私钥,用于对安装包进行外层签名的私钥。The memory 202 may be used to store the upgrade package and locally generated keys, such as a private key used to sign the vehicle identity, anti-replay parameters, and integrity information, and a private key used to sign the outer layer of the installation package.
需要说明的,图3所示的电子设备500仅仅是本申请实施例的一种实现方式,实际应用中,电子设备500还可以包括更多或更少的部件,这里不作限制。It should be noted that the electronic device 500 shown in FIG. 3 is only an implementation manner of the embodiment of the present application. In actual applications, the electronic device 500 may also include more or fewer components, which is not limited here.
下面结合图4介绍远端升级场景下的车辆校验方法。The following describes the vehicle verification method in the remote upgrade scenario with reference to Figure 4.
图4为本申请实施例提供的远端升级场景下,车辆校验方法的流程示意图。Figure 4 is a schematic flowchart of the vehicle verification method in the remote upgrade scenario provided by the embodiment of the present application.
远端升级场景主要涉及供应商服务器、车云服务器、车辆之间的交互,车辆可以通过无线通信的方式获取升级包,完成车辆的升级。具体关于远端升级的解释,以及远端升级涉及到的通信系统可以参见前述的相关内容,这里不再赘述。The remote upgrade scenario mainly involves the interaction between the supplier server, the vehicle cloud server, and the vehicle. The vehicle can obtain the upgrade package through wireless communication to complete the vehicle upgrade. For specific explanations of remote upgrades and the communication systems involved in remote upgrades, please refer to the relevant content mentioned above and will not be repeated here.
如图4所示,该车辆校验方法可包括:As shown in Figure 4, the vehicle verification method may include:
S101.供应商服务器对一个或多个升级文件进行签名,并生成安装包。S101. The supplier server signs one or more upgrade files and generates an installation package.
供应商服务器可以是指软件供应商维护车辆部件的服务器,在开发人员开发出车辆部件的升级文件后,供应商服务器可以获取到该新开发的升级文件。示例性地,该供应商服务器可以是指图1中所示的服务器100,具体关于服务器100的描述可以参见图1的相关内容,这里不再赘述。The supplier server may refer to a server where the software supplier maintains vehicle components. After the developer develops an upgrade file for the vehicle component, the supplier server can obtain the newly developed upgrade file. For example, the supplier server may refer to the server 100 shown in Figure 1. For a specific description of the server 100, please refer to the relevant content of Figure 1, which will not be described again here.
针对车辆部件的一次升级,供应商服务器可以提供一个或多个升级文件用于升级该部件。该一个或多个升级文件可用于实现车辆部件的操作系统更新、应用软件版本的更新、修复漏洞等等升级效果。具体地,这一个或多个升级文件可用于升级该部件中包含的一个或多个软件。其中,一个升级文件可以包含部件中一个软件的升级数据。For an upgrade of a vehicle component, the supplier server may provide one or more upgrade files for upgrading the component. The one or more upgrade files can be used to achieve upgrade effects such as operating system updates for vehicle components, application software version updates, bug fixes, etc. Specifically, the one or more upgrade files may be used to upgrade one or more software included in the component. Among them, an upgrade file can contain upgrade data of a software in the component.
对一个或多个升级文件进行签名具体是指对这一个或多个升级文件分别进行数字签名,获得该一个或多个升级文件的编包签名。供应商服务器可以对这一个或多个升级文件以及这一个或多个编包签名进行压缩,从而生成一个安装包。Signing one or more upgrade files specifically refers to digitally signing the one or more upgrade files respectively, and obtaining the package signature of the one or more upgrade files. The supplier server may compress the one or more upgrade files and the one or more packaging signatures to generate an installation package.
其中,数字签名,又称公钥数字签名,是只有信息的发送方才能产生的别人无法伪造的一段数字串,这段数字串同时也是对信息的发送者发送信息真实性的一个有效证明。具体地,发送方可以生成一对密钥,利用密钥对中的私钥,通过签名算法对信息进行签名。之后,接收方可以利用该密钥对中的公钥,通过验签算法对签名进行验证,从而确定该信息是否来源 于信息的发送方,且发送过程中是否被篡改。也就是说,数据签名可以保证信息的合法性,该合法性包括信息的来源合法以及未被篡改。Among them, a digital signature, also known as a public key digital signature, is a digital string that can only be generated by the sender of the information and cannot be forged by others. This digital string is also an effective proof of the authenticity of the information sent by the sender of the information. Specifically, the sender can generate a pair of keys and use the private key in the key pair to sign the information through a signature algorithm. Afterwards, the recipient can use the public key in the key pair to verify the signature through the signature verification algorithm to determine whether the information comes from to the sender of the information and whether it has been tampered with during the sending process. In other words, data signatures can ensure the legitimacy of the information, which includes that the source of the information is legitimate and has not been tampered with.
也就是说,供应商服务器使用自己的私钥对升级文件进行编包签名,可以使得升级文件的接收方能够根据该编包签名来确认升级文件的来源,避免他人冒充供应商服务器,向外发送升级文件。In other words, the supplier server uses its own private key to package and sign the upgrade file, so that the recipient of the upgrade file can confirm the source of the upgrade file based on the package signature and prevent others from impersonating the supplier server and sending it out. a.
示例性地,供应商服务器可以生成一对密钥,包括公钥1和私钥1,其中,私钥1留存在本地,用于对升级文件进行签名,公钥1可以发送给车辆,用于车辆在获取到升级包后对该编包签名进行校验。For example, the supplier server can generate a pair of keys, including public key 1 and private key 1, where private key 1 is kept locally and is used to sign the upgrade file, and public key 1 can be sent to the vehicle for After the vehicle obtains the upgrade package, it verifies the package signature.
其中需要注意的是,供应商服务器可以在车辆升级时,将该用于校验编包签名的公钥,例如公钥1,发送给车辆,或者,通过车云服务器的中转发送给车辆,例如,供应商服务器在向车云服务器发送安装包时,将该公钥同时发送给车云服务器,具体关于供应商服务器向车云服务器发送安装包的过程,可以参见后续步骤S102的内容。或者,供应商服务器可在对升级文件进行签名前,提前将用于校验该签名的公钥发送给车云服务器。或者,车辆可以在整车产线阶段,直接将校验该签名的公钥预置到车辆的芯片中。本申请实施例对车辆获取该公钥的方式及时间不作限制。It should be noted that the supplier server can send the public key used to verify the packet signature, such as public key 1, to the vehicle when the vehicle is upgraded, or it can be sent to the vehicle through the vehicle cloud server, such as , when the supplier server sends the installation package to the car cloud server, it also sends the public key to the car cloud server. For details about the process of the supplier server sending the installation package to the car cloud server, please refer to the content of subsequent step S102. Alternatively, the supplier server can send the public key used to verify the signature to the CheCloud server in advance before signing the upgrade file. Alternatively, the vehicle can directly preset the public key for verifying the signature into the vehicle's chip during the vehicle production line stage. The embodiment of this application does not limit the method and time for the vehicle to obtain the public key.
可以理解的是,供应商服务器对升级文件进行的签名还可以被称为内层签名、小包签名、编包签名等等,本申请实施例对该名称不作限制。It can be understood that the signature of the upgrade file performed by the supplier server can also be called an inner signature, a small package signature, a package signature, etc., and the embodiment of this application does not limit this name.
进一步的,供应商服务器可以利用多级密钥来实现对升级文件的编包签名。也就是说,供应商服务器可以生成多对密钥,通过上一级私钥对下一级公钥的逐级签名,来实现对升级文件的编包签名。相应的,在校验编包签名时,需要通过上一级公钥对下一级公钥的签名的逐级校验,来实现对编包签名的校验。Furthermore, the supplier server can use multi-level keys to implement package signatures for upgrade files. In other words, the supplier server can generate multiple pairs of keys, and implement the package signature of the upgrade file through the step-by-step signature of the upper-level private key to the lower-level public key. Correspondingly, when verifying the packaged signature, it is necessary to verify the packaged signature through level-by-level verification of the signature of the lower-level public key by the upper-level public key.
下面以三级密钥为例来介绍供应商服务器对升级文件进行签名的详细过程。The following uses the third-level key as an example to introduce the detailed process of the supplier server signing the upgrade file.
首先供应商服务器生成三对密钥:编包根公钥和编包根私钥、编包二层公钥和编包二层私钥、编包三层公钥和编包三层私钥。First, the supplier server generates three pairs of keys: the packaged root public key and the packaged root private key, the packaged layer 2 public key and the packaged layer 2 private key, the packaged layer 3 public key and the packaged layer 3 private key.
图5为本申请实施例提供的供应商服务器对升级文件进行签名的逻辑结构示意图。Figure 5 is a schematic logical structure diagram of the supplier server signing the upgrade file provided by the embodiment of the present application.
供应商服务器对升级文件进行签名主要包括以下步骤:The supplier server's signing of the upgrade file mainly includes the following steps:
1)供应商服务器利用编包根私钥对编包二层公钥进行签名,得到编包二层公钥的签名。1) The supplier server uses the compilation root private key to sign the compilation layer 2 public key and obtains the signature of the compilation layer 2 public key.
2)供应商服务器利用编包二层私钥对编包三层公钥进行签名,得到编包三层公钥的签名。2) The supplier server uses the second-layer private key to sign the third-layer public key and obtains the signature of the third-layer public key.
3)供应商服务器利用编包三层私钥对升级文件进行签名,得到编包签名。3) The supplier server uses the packaged three-layer private key to sign the upgrade file and obtains the packaged signature.
之后,供应商服务器可以在将安装包包发送给车云服务器时,将上述编包根公钥、编包二层公钥、编包二层公钥的签名、编包三层公钥、编包三层公钥的签名、编包签名发送给车辆,或通过车云服务器转发给车辆,在车辆校验升级包中的编包签名时,可以通过上述编包根公钥、编包二层公钥、编包二层公钥的签名、编包三层公钥、编包三层公钥的签名、编包签名进行校验,具体关于编包签名的校验可以参见后续步骤S115中的相关内容,这里先不展开。After that, when sending the installation package to the Cheyun server, the supplier server can include the above-mentioned packaged root public key, packaged second-level public key, packaged layer-2 public key signature, packaged layer-3 public key, packaged layer-2 public key, and packaged layer-2 public key. The signature and packaged signature containing the third-level public key are sent to the vehicle, or forwarded to the vehicle through the vehicle cloud server. When the vehicle verifies the packaged signature in the upgrade package, it can use the above-mentioned packaged root public key, packaged second-level public key, etc. The public key, the signature of the second-layer public key, the third-layer public key, the signature of the third-layer public key, and the signature are verified. For details about the verification of the signature, please refer to the subsequent step S115. The relevant content will not be expanded upon here.
可以理解的是,本申请实施例对供应商服务器使用的密钥层级数不作限制,例如,供应商服务器可以生成四对密钥来实现对升级文件的编包签名,其原理类似于上述供应商服务器利用三级密钥对升级文件进行签名的过程,这里不再赘述。It can be understood that the embodiment of the present application does not limit the number of key levels used by the supplier server. For example, the supplier server can generate four pairs of keys to implement the package signature of the upgrade file. The principle is similar to the above-mentioned supplier. The process of the server using the third-level key to sign the upgrade file will not be described again here.
S102.供应商服务器将安装包发送给车云服务器。S102. The supplier server sends the installation package to the Cheyun server.
可以理解的,供应商服务器将安装包发送给车云服务器,相应的,车云服务器接收到来 自于供应商服务器的安装包。It is understandable that the supplier server sends the installation package to the car cloud server, and accordingly, the car cloud server receives it. Installation package from vendor server.
车云服务器是指直接与车辆进行交互的服务器,它可以获取并存储多个软件供应商的服务器发送的安装包,并在车辆需要升级时,将升级包发送给车辆。其中,升级包为安装包以及安装包的外层签名打包后的文件,具体关于升级包以及外层签名的描述可以参见后续内容,这里先不展开。The car cloud server refers to a server that directly interacts with the vehicle. It can obtain and store installation packages sent by servers of multiple software vendors, and send the upgrade package to the vehicle when the vehicle needs to be upgraded. Among them, the upgrade package is a packaged file of the installation package and the outer signature of the installation package. The specific description of the upgrade package and the outer signature can be found in the following content, which will not be discussed here.
车辆可以是指车辆所在的终端设备,车辆可用于接收升级包,并根据该升级包实现车辆的升级。The vehicle may refer to the terminal device where the vehicle is located, and the vehicle may be used to receive an upgrade package and implement vehicle upgrades based on the upgrade package.
示例性地,该车云服务器可以是指图1所示的服务器200,该车辆可以是指图1所示的车辆300。具体关于服务器200和车辆300的描述可以参见图1的相关内容,这里不再赘述。For example, the vehicle cloud server may refer to the server 200 shown in FIG. 1 , and the vehicle may refer to the vehicle 300 shown in FIG. 1 . For specific descriptions of the server 200 and the vehicle 300, please refer to the relevant content in Figure 1 and will not be described again here.
可以理解的是,供应商服务器也可以不对升级文件进行编包签名,本申请实施例对此不作限制。也就是说,S101为可选步骤,那么此时步骤S101中供应商服务器向车云服务器发送的安装包中可以包括升级文件,不包括编包签名。另外,供应商服务器也可以不对升级文件以及升级文件的编包签名进行压缩,也就是说,供应商服务器向车云服务器发送的数据不一定是安装包,供应商服务器可以直接将升级文件和编包签名发送给车云服务器,本申请实施例对供应商服务器向车云服务器发送的数据的数据形式不作限制。另外,本申请实施例对供应商服务器向车云服务器发送的安装包的名称不做限制,该安装包还可以被称为软件包、升级包、压缩包等等。It can be understood that the supplier server may not package and sign the upgrade file, and the embodiment of the present application does not limit this. In other words, S101 is an optional step, so the installation package sent by the supplier server to the car cloud server in step S101 may include the upgrade file, but not the package signature. In addition, the supplier server does not need to compress the upgrade file and the package signature of the upgrade file. That is to say, the data sent by the supplier server to the Cheyun server is not necessarily an installation package. The supplier server can directly compress the upgrade file and package signature. The package signature is sent to the car cloud server. The embodiment of this application does not limit the data form of the data sent by the supplier server to the car cloud server. In addition, the embodiment of this application does not limit the name of the installation package sent by the supplier server to the car cloud server. The installation package may also be called a software package, an upgrade package, a compressed package, etc.
S103.车云服务器对安装包进行签名,并生成升级包。S103. The Cheyun server signs the installation package and generates an upgrade package.
具体地,车云服务器可以在接收到供应商服务器发送的安装包之后,可以对安装包进行数据签名,得到该安装包的外层签名。之后,车云服务器可以对该安装包以及外层签名进行打包,从而生成该升级包,实现对供应商服务器发送的安装包的归档。具体关于数字签名的描述可以参见前述的相关内容,这里不再赘述。Specifically, after receiving the installation package sent by the supplier server, the car cloud server can perform data signature on the installation package to obtain the outer signature of the installation package. Afterwards, the Cheyun server can package the installation package and the outer signature to generate the upgrade package and archive the installation package sent by the supplier server. For specific descriptions of digital signatures, please refer to the relevant content mentioned above and will not be repeated here.
其中,升级包可用于增强或增加车辆的功能,例如自动驾驶功能、导航功能等等,在本申请实施例中,该功能还可以被称为第一功能。The upgrade package can be used to enhance or add vehicle functions, such as autonomous driving functions, navigation functions, etc. In the embodiment of the present application, this function can also be called the first function.
车云服务器对安装包进行签名,可以使得安装包的接收方能够根据该签名来确定安装包的来源,避免他人冒充车云服务器,向外发送包含该安装包的升级包。The CheCloud server signs the installation package so that the recipient of the installation package can determine the source of the installation package based on the signature, preventing others from impersonating the CheCloud server and sending out upgrade packages containing the installation package.
示例性地,车云服务器可以生成一对密钥,包括公钥2和私钥2,其中,私钥2留存在本地,用于对安装包进行签名,公钥2可以发送给车辆,用于车辆在获取到升级包后对该签名进行校验。For example, the car cloud server can generate a pair of keys, including public key 2 and private key 2. Private key 2 is retained locally and is used to sign the installation package. Public key 2 can be sent to the vehicle for signing. The vehicle verifies the signature after obtaining the upgrade package.
需要注意的是,车云服务器对安装包进行的签名还可以被称为大包签名、外层签名、车辆厂商(Original Equipment Manufacturer,OEM)签名等等,本申请实施例对该名称不作限制。It should be noted that the signature of the installation package performed by the car cloud server can also be called a large package signature, an outer signature, a vehicle manufacturer (Original Equipment Manufacturer, OEM) signature, etc. The embodiment of this application does not limit this name.
可以理解的是,车云服务器也可以不对安装包进行签名,则这时,步骤S103是可选的。It is understandable that the car cloud server may not sign the installation package, and in this case, step S103 is optional.
另外,本申请实施例对升级包的名称不作限制,在本申请其他实施例中,升级包还可以被称为软件包、安装包、软件升级包、软件安装包、安装文件等等。另外,需要注意的是供应商服务器给车云服务器发送的安装包也可以称为升级包,在本申请实施例中,为了区分供应商服务器给车云服务器发送的用于车辆升级的文件,以及车云服务器给供应商服务器发送的用于车辆升级的文件,供应商服务器发送给的文件称为安装包,车云服务器给车辆发送的文件称为升级包。应理解,该名称并不构成对本申请实施例的限制。 In addition, the embodiment of the present application does not limit the name of the upgrade package. In other embodiments of the present application, the upgrade package may also be called a software package, an installation package, a software upgrade package, a software installation package, an installation file, etc. In addition, it should be noted that the installation package sent by the supplier server to the car cloud server can also be called an upgrade package. In the embodiment of the present application, in order to distinguish the files for vehicle upgrade sent by the supplier server to the car cloud server, and The files sent by the car cloud server to the supplier server for vehicle upgrade are called installation packages, and the files sent by the car cloud server to the vehicle are called upgrade packages. It should be understood that this name does not constitute a limitation on the embodiments of the present application.
S104.车辆将资产信息发送给车云服务器。S104. The vehicle sends asset information to the vehicle cloud server.
可以理解的是,车辆将资产信息发送给车云服务器,相应的,车云服务器则接收来自车辆的资产信息。It can be understood that the vehicle sends asset information to the vehicle cloud server, and accordingly, the vehicle cloud server receives the asset information from the vehicle.
资产信息用于描述车辆升级所需的相关信息,包括但不限于以下一项或多项:软硬件版本信息、车辆身份标识、此次升级的防重放参数等等。其中,软硬件版本信息可用于确定使用该车辆的软硬件升级的升级包的版本,车辆身份标识可用于标识该升级的车辆,防重放参数可以标识此次升级。进一步地,车辆身份标识可用于唯一标识该升级的车辆,防重放参数可以唯一标识此次升级Asset information is used to describe relevant information required for vehicle upgrades, including but not limited to one or more of the following: software and hardware version information, vehicle identification, anti-replay parameters for this upgrade, etc. Among them, the software and hardware version information can be used to determine the version of the upgrade package used for the software and hardware upgrade of the vehicle, the vehicle identity identifier can be used to identify the upgraded vehicle, and the anti-replay parameters can identify the upgrade. Further, the vehicle identity can be used to uniquely identify the upgraded vehicle, and the anti-replay parameters can uniquely identify the upgraded vehicle.
其中,车辆可以通过查询车辆中搭载的软硬件,获得软硬件的版本信息。具体关于车辆身份标识以及防重放参数的描述可以参见后续内容,这里先不展开。具体关于车辆身份标识和防重放参数的描述可以参见后续车辆身份标识和防重放参数的具体实现,这里先不展开。Among them, the vehicle can obtain the version information of the software and hardware by querying the software and hardware installed in the vehicle. The specific description of vehicle identification and anti-replay parameters can be found in the following content, and will not be discussed here. For a detailed description of the vehicle identity and anti-replay parameters, please refer to the subsequent specific implementation of the vehicle identity and anti-replay parameters, which will not be discussed here.
示例性地,车辆可以在需要升级时,将资产信息发送给车云服务器。或者,车辆可以周期性将资产信息发送给车云服务器。这样车辆可以周期性更新车云服务器获取到的资产信息。本申请实施例对车辆发送给资产信息的触发时机不作限制。For example, the vehicle can send asset information to the vehicle cloud server when it needs to be upgraded. Alternatively, the vehicle can periodically send asset information to the vehicle cloud server. In this way, the vehicle can periodically update the asset information obtained by the vehicle cloud server. The embodiment of this application does not limit the triggering timing of asset information sent by the vehicle.
车辆可以在以下两种情况下触发升级:Vehicles can trigger upgrades in the following two situations:
1)车辆检测到用户操作,触发升级1) The vehicle detects user operations and triggers upgrades
在这种情况下,车辆可以在检测到用户的升级操作后,响应于该操作,将资产信息发送给车云服务器,触发车辆的升级。In this case, the vehicle can, after detecting the user's upgrade operation, send asset information to the vehicle cloud server in response to the operation, triggering the upgrade of the vehicle.
这样,用户可以自行决定是否升级车辆,控制车辆升级的时间,提升用户对车辆升级的控制权。In this way, users can decide whether to upgrade their vehicles, control the time of vehicle upgrades, and enhance users' control over vehicle upgrades.
2)车辆接收到车云服务器的升级指令,触发升级2) The vehicle receives the upgrade instruction from the car cloud server and triggers the upgrade.
在这种情况下,车辆可以在接收到车云服务器的升级指令后,将资产信息发送给车云服务器,触发车辆的升级。In this case, after receiving the upgrade instruction from the car cloud server, the vehicle can send the asset information to the car cloud server to trigger the upgrade of the vehicle.
这样,车辆可以在车云服务器的控制下,被动触发车辆的升级。In this way, the vehicle can passively trigger vehicle upgrades under the control of the vehicle cloud server.
可以理解的是,车辆升级的触发时机不限于上述两种情况,车辆可以结合上述多种情况触发升级,例如,车辆可以在检测到车云服务器的升级指令,同时检测到用户的升级操作后,触发将资产信息发送给车云服务器,本申请实施例对车辆升级的触发时机不作限制。It can be understood that the triggering timing of vehicle upgrade is not limited to the above two situations. The vehicle can trigger the upgrade in combination with the above situations. For example, the vehicle can detect the upgrade instruction of the car cloud server and the user's upgrade operation at the same time. The asset information is triggered to be sent to the vehicle cloud server. The embodiment of the present application does not limit the triggering timing of the vehicle upgrade.
具体实现中,车辆可以通过车辆升级控制器VUC向车云服务器发送资产信息,具体关于车辆升级控制器VUC的描述可以参见前述图2B中的相关内容,这里不再赘述。In specific implementation, the vehicle can send asset information to the vehicle cloud server through the vehicle upgrade controller VUC. For a specific description of the vehicle upgrade controller VUC, please refer to the relevant content in Figure 2B, which will not be described again here.
S105.车云服务器根据资产信息确定升级包。S105. The car cloud server determines the upgrade package based on the asset information.
示例性地,车云服务器可以在接收到资产信息后,触发确定升级包,或者,车云服务器可以在车辆存在升级需求时,例如接收到车辆的升级请求时,触发根据资产信息确定升级包。For example, the vehicle cloud server may trigger the determination of the upgrade package after receiving the asset information, or the vehicle cloud server may trigger the determination of the upgrade package based on the asset information when the vehicle has an upgrade requirement, such as when an upgrade request from the vehicle is received.
具体地,车云服务器可以根据资产信息中的软硬件版本信息,以及车云服务器从供应商服务器获取的安装包的升级版本,确定车辆待升级的部件,从而确定出需要向车辆发送的升级包,该升级包即为车辆待升级部件的升级包。例如,假设资产信息中指示了车辆的第一部件的软件版本为V2,当车云服务器存储有第一部件的V3版本的升级包,则车云服务器可以确定该第一部件为需要升级的版本,则确定该第一部件为车辆的待升级部件,该第一部件的V3版本的升级包为需要向车辆发送的升级包。Specifically, the car cloud server can determine the components of the vehicle to be upgraded based on the software and hardware version information in the asset information and the upgrade version of the installation package obtained by the car cloud server from the supplier server, thereby determining the upgrade package that needs to be sent to the vehicle. , this upgrade package is the upgrade package for the vehicle parts to be upgraded. For example, assume that the asset information indicates that the software version of the first component of the vehicle is V2. When the vehicle cloud server stores the V3 version upgrade package of the first component, the vehicle cloud server can determine that the first component is the version that needs to be upgraded. , then it is determined that the first component is a component to be upgraded of the vehicle, and the V3 version upgrade package of the first component is an upgrade package that needs to be sent to the vehicle.
需要注意的是,步骤S103中车云服务器对安装包进行签名,也可以在车云服务器接收到资产信息,根据该资产信息确定符合要求的安装包之后,再触发执行。也就是说,本申请实 施例对车云服务器对安装包进行签名的时机不做限制。It should be noted that in step S103, the CheCloud server signs the installation package, or execution can be triggered after the CheCloud server receives the asset information and determines the installation package that meets the requirements based on the asset information. In other words, this application actually The embodiment does not limit the timing when the CheCloud server signs the installation package.
S106.车云服务器生成授权文件。S106. The car cloud server generates an authorization file.
授权文件中可以包括但不限于以下一项或多项参数:车辆身份标识、防重放参数、完整性信息。The authorization file may include but is not limited to one or more of the following parameters: vehicle identification, anti-replay parameters, and integrity information.
其中,车辆身份标识可用于唯一标识该升级的车辆,示例性地,该车辆身份标识可以为根据车辆发送的资产信息中的车辆身份标识得到。防重放参数可以标识此次升级,示例性地,该防重放参数可以为根据车辆发送的资产信息中的防重放参数得到。完整性信息用于标识此次升级过程中,车云服务器发送的升级包,进一步地,完整性信息用于唯一标识该升级包。示例性地,该完整性信息可以为使用哈希函数,对升级包计算得到的哈希值。该完整性信息可以为车云服务器根据升级包计算得到的参数,也可以为软件供应商提供的服务器根据升级包计算得到,并发送给车云服务器的参数。具体关于车辆身份标识、防重放参数、完整性信息的描述可以参见后续车辆身份标识、防重放参数、完整性信息的具体实现,这里先不展开。The vehicle identity can be used to uniquely identify the upgraded vehicle. For example, the vehicle identity can be obtained based on the vehicle identity in the asset information sent by the vehicle. The anti-replay parameter can identify this upgrade. For example, the anti-replay parameter can be obtained based on the anti-replay parameter in the asset information sent by the vehicle. The integrity information is used to identify the upgrade package sent by the car cloud server during this upgrade process. Furthermore, the integrity information is used to uniquely identify the upgrade package. For example, the integrity information may be a hash value calculated on the upgrade package using a hash function. The integrity information can be parameters calculated by the Che Cloud server based on the upgrade package, or can be parameters calculated by the server provided by the software supplier based on the upgrade package and sent to the Che Cloud server. For a specific description of the vehicle identity, anti-replay parameters, and integrity information, please refer to the subsequent specific implementation of the vehicle identity, anti-replay parameters, and integrity information, which will not be discussed here.
进一步的,授权文件中还可以包括授权文件的签名,该授权文件的签名用于证明授权文件的合法性。该授权文件的签名可以为车云服务器使用私钥(以下称为授权私钥),对授权文件中的参数进行数字签名,得到的签名。Further, the authorization file may also include a signature of the authorization file, and the signature of the authorization file is used to prove the legitimacy of the authorization file. The signature of the authorization file can be obtained by digitally signing the parameters in the authorization file using the private key (hereinafter referred to as the authorization private key) of the car cloud server.
示例性地,该授权文件的签名可以为对授权文件中的车辆身份标识、防重放参数、完整性信息进行数字签名,得到的签名。在这种情况下,授权文件的签名可以示例性实现为,车云服务器可以生成一对密钥,包括公钥3和私钥3,其中,私钥3留存在本地,用于计算授权文件的签名,公钥3可以发送给车辆,用于车辆在获取到授权文件后对该签名进行校验。For example, the signature of the authorization file may be a signature obtained by digitally signing the vehicle identity, anti-replay parameters, and integrity information in the authorization file. In this case, the signature of the authorization file can be implemented as an example. The car cloud server can generate a pair of keys, including public key 3 and private key 3. Private key 3 is retained locally and is used to calculate the authorization file. The signature, public key 3, can be sent to the vehicle for the vehicle to verify the signature after obtaining the authorization file.
应理解,当授权文件仅包含车辆身份标识、防重放参数、完整性信息中的一个或多个参数时,授权文件的签名为根据这一个或多个参数计算得到的签名。It should be understood that when the authorization file only contains one or more parameters among the vehicle identification, anti-replay parameters, and integrity information, the signature of the authorization file is a signature calculated based on this one or more parameters.
进一步的,授权文件中还可以包括用于校验授权文件的签名的公钥(以下称为授权公钥),例如上述提及的公钥3。这样,在车辆获取到授权文件时,可以根据该授权公钥校验该授权文件的签名。进一步地,授权文件中还可以包括用于证明该授权公钥合法的合法性证明,具体关于合法性证明的描述可以参考后续的具体实现,这里先不展开。Furthermore, the authorization file may also include a public key used to verify the signature of the authorization file (hereinafter referred to as the authorization public key), such as the above-mentioned public key 3. In this way, when the vehicle obtains the authorization file, the signature of the authorization file can be verified based on the authorization public key. Furthermore, the authorization file may also include a legality certificate used to prove that the authorized public key is legal. For a specific description of the legality certificate, please refer to the subsequent specific implementation, which will not be discussed here.
示例性地,表1示出了本申请实施例提供的授权文件的一种结构。By way of example, Table 1 shows a structure of the authorization file provided by the embodiment of this application.
表1
Table 1
从表1可以看出,授权文件可以包括三个部分:属性域M、签名域和验证公钥域。其中,属性域M中可包括:车辆身份标识Space_Attr、防重放参数Time_Attr、完整性信息Integrity_Attr。签名域中包括车云服务器用自己的授权私钥sk(例如私钥3)对属性域M计算得到的签名Sig(sk,M)。验证公钥域中包括:与该授权私钥sk对应的授权公钥pk(例如公钥3),该授权公钥pk用于校验签名域中的签名Sig(sk,M),另外,验证公钥域中还可以包括:用于验证该授权公钥pk合法的合法性证明pk_validity_proof。 As can be seen from Table 1, the authorization file can include three parts: attribute field M, signature field and verification public key field. Among them, the attribute domain M may include: vehicle identity identifier Space_Attr, anti-replay parameter Time_Attr, and integrity information Integrity_Attr. The signature field includes the signature Sig(sk,M) calculated by the car cloud server on the attribute field M using its own authorized private key sk (for example, private key 3). The verification public key field includes: the authorized public key pk (for example, public key 3) corresponding to the authorized private key sk. The authorized public key pk is used to verify the signature Sig(sk,M) in the signature field. In addition, verification The public key field may also include: a validity certificate pk_validity_proof used to verify that the authorized public key pk is legitimate.
可以理解的是,表1所示的授权文件的结构只是示例性举例,不构成对授权文件的限制,在本申请其他实施例中,授权文件的属性域可以包含更多或更少的信息,例如,属性域中可以仅包括车辆身份标识Space_Attr、防重放参数Time_Attr,又例如,验证公钥域中可以不包含合法性证明pk_validity_proof。或者,授权文件不限于由上述三个部分组成。本申请实施例对授权文件的结构不作限制。It can be understood that the structure of the authorization file shown in Table 1 is only an illustrative example and does not constitute a limitation on the authorization file. In other embodiments of the present application, the attribute domain of the authorization file may contain more or less information. For example, the attribute field may only include the vehicle identity identifier Space_Attr and the anti-replay parameter Time_Attr. For another example, the verification public key field may not include the validity certificate pk_validity_proof. Alternatively, the authorization document is not limited to consisting of the above three parts. The embodiment of this application does not limit the structure of the authorization file.
另外,需要注意的是,步骤S103中提及的车辆向车云服务器发送的车辆身份标识,与步骤S106中提及的授权文件中的车辆身份标识可以不同,具体可以参见后续关于车辆身份标识的实现部分,另外,车辆向车云服务器发送的资产信息中可以不包括防重放参数,而车云服务器向车辆返回的授权文件中可以包括防重放参数,即步骤S103中提及的资产信息中,可以不包含防重放参数,而在步骤S106中提及的授权文件中可以包含防重放参数,具体可以参见后续关于防重放参数的实现部分,这里先不展开。In addition, it should be noted that the vehicle identity sent by the vehicle to the car cloud server mentioned in step S103 may be different from the vehicle identity in the authorization file mentioned in step S106. For details, please refer to the subsequent article on vehicle identity. In the implementation part, in addition, the asset information sent by the vehicle to the car cloud server may not include anti-replay parameters, and the authorization file returned by the car cloud server to the vehicle may include anti-replay parameters, that is, the asset information mentioned in step S103 , the anti-replay parameter may not be included, and the authorization file mentioned in step S106 may include the anti-replay parameter. For details, please refer to the subsequent implementation section on the anti-replay parameter, which will not be discussed here.
S107.车云服务器确定升级策略。S107. The car cloud server determines the upgrade strategy.
由于车云服务器的数量可以为一个或多个,不同部件的升级包可能存储在不同的车云服务器中,车云服务器在确定车辆的待升级部件后,可以根据这些待升级部件的升级包所在的存储地址,确定升级策略,该升级策略用于指示车辆待升级部件的升级包的下载地址。Since the number of vehicle cloud servers can be one or more, upgrade packages for different components may be stored in different vehicle cloud servers. After determining the vehicle components to be upgraded, the vehicle cloud server can determine the location of the upgrade packages of these components to be upgraded. The storage address determines the upgrade strategy, which is used to indicate the download address of the upgrade package for the vehicle components to be upgraded.
其中,该升级策略可以是指下载策略(Downloadpolicy,DP)包,该DP包可以包括车辆多个待升级部件的升级包的下载地址,该下载地址可用于获取升级包。示例性地,该下载地址可以为统一资源定位符(uniform resource locator,URL)。The upgrade policy may refer to a download policy (DP) package, and the DP package may include download addresses of upgrade packages for multiple components of the vehicle to be upgraded, and the download addresses may be used to obtain the upgrade packages. For example, the download address may be a uniform resource locator (URL).
可选地,该DP包中还可以包括授权文件的下载地址,该下载地址用于获取授权文件。示例性地,该下载地址可以为URL。Optionally, the DP package may also include a download address of the authorization file, and the download address is used to obtain the authorization file. For example, the download address may be a URL.
可选的,DP包中还可以包括升级规则、升级条件、下载规则等等中的一项或多项。其中,升级规则可用于定义升级的次序、是否需要进行回滚等规则,升级条件可以包含是否供电正常、存储空间、网络状态等等,下载规则可用于定义下载的顺序,指示下载升级包的部件等等。本申请实施例对DP包中包含的内容不做限制。Optionally, the DP package may also include one or more of upgrade rules, upgrade conditions, download rules, etc. Among them, upgrade rules can be used to define the order of the upgrade, whether rollback is required, and other rules. Upgrade conditions can include whether the power supply is normal, storage space, network status, etc. Download rules can be used to define the order of downloading and indicate the components of the upgrade package to be downloaded. etc. The embodiment of this application does not limit the content contained in the DP package.
S108.车云服务器将升级策略发送给车辆。S108. The vehicle cloud server sends the upgrade strategy to the vehicle.
车云服务器将升级策略发送给车辆,相应的,车辆获取到车云服务器发送的升级策略。The car cloud server sends the upgrade strategy to the vehicle, and accordingly, the vehicle obtains the upgrade strategy sent by the car cloud server.
具体实现中,车辆可以通过车辆升级控制器VUC获取升级策略。具体关于车辆升级控制器VUC可以参见前述图2B的相关内容,这里不再赘述。In specific implementation, the vehicle can obtain the upgrade strategy through the vehicle upgrade controller VUC. For details about the vehicle upgrade controller VUC, please refer to the relevant content of Figure 2B mentioned above, and will not be described again here.
S109.车辆根据升级策略解析下载地址。S109. The vehicle resolves the download address according to the upgrade strategy.
该下载地址可以包括车辆的一个或多个部件的升级包的存储地址,例如第一地址。The download address may include a storage address, such as a first address, of an upgrade package for one or more components of the vehicle.
可选的,该下载地址还可以包括升级包的授权文件的存储地址。Optionally, the download address may also include the storage address of the authorization file of the upgrade package.
具体地,车辆可以通过车辆升级控制器VUC解析升级策略,得到一个或多个部件的升级包的下载地址,车辆根据该一个或多个部件所在的功能域,将下载地址发送给相应的功能域的域控制器DC。例如,车辆根据升级策略解析得到第一部件的升级包的下载地址1,和第二部件的升级包的下载地址2,假设该第一部件位于第一功能域,第二部件位于第二功能域,则车辆将该下载地址1发送给第一功能域中的域控制器DC,将下载地址2发送给第二功能域中的域控制器DC。Specifically, the vehicle can parse the upgrade strategy through the vehicle upgrade controller VUC to obtain the download address of the upgrade package for one or more components. The vehicle sends the download address to the corresponding functional domain according to the functional domain where the one or more components are located. The domain controller DC. For example, the vehicle obtains the download address 1 of the upgrade package of the first component and the download address 2 of the upgrade package of the second component according to the upgrade strategy. It is assumed that the first component is located in the first functional domain and the second component is located in the second functional domain. , then the vehicle sends the download address 1 to the domain controller DC in the first functional domain, and sends the download address 2 to the domain controller DC in the second functional domain.
S110.车辆根据下载地址向车云服务器发送下载请求。 S110. The vehicle sends a download request to the vehicle cloud server according to the download address.
车辆向车云服务器发送下载请求,相应的,车云服务器则接收到来自车辆的下载请求。The vehicle sends a download request to the car cloud server, and accordingly, the car cloud server receives the download request from the vehicle.
该下载请求可用于获取升级包。这里的车云服务器可以是指存储有该下载请求所请求获取的升级包的服务器。This download request can be used to obtain the upgrade package. The car cloud server here may refer to a server that stores the upgrade package requested by the download request.
可选的,该下载请求还可用于获取授权文件。Optionally, this download request can also be used to obtain the authorization file.
S111.车云服务器将升级包发送给车辆。S111. The car cloud server sends the upgrade package to the vehicle.
车云服务器将升级包发送给车辆,相应的,车辆则接收到来自车云服务器的升级包。具体的,车辆可以通过域升级控制器DUC获取升级包。The car cloud server sends the upgrade package to the vehicle, and accordingly, the vehicle receives the upgrade package from the car cloud server. Specifically, the vehicle can obtain the upgrade package through the domain upgrade controller DUC.
另外,类似于步骤S102中供应商服务器将公钥发送给车云服务器,在车云服务器将升级包发送给车辆的同时,车云服务器还可以将用于校验该编包签名的公钥(例如公钥1)和校验该外层签名的公钥(例如公钥2)一起发送给车辆。或者,车云服务器在对安装包进行外层签名之前,提前校验该外层签名的公钥发送给车辆。或者,车辆可以在整车产线阶段,直接将该公钥存储在车辆的芯片内部。本申请实施例对车辆获取该校验外层签名的公钥的方式及时间不作限制。In addition, similar to the supplier server sending the public key to the car cloud server in step S102, when the car cloud server sends the upgrade package to the vehicle, the car cloud server can also send the public key ( For example, public key 1) and the public key for verifying the outer signature (for example, public key 2) are sent to the vehicle. Or, before the car cloud server performs an outer signature on the installation package, it verifies the public key of the outer signature in advance and sends it to the vehicle. Alternatively, the vehicle can directly store the public key inside the vehicle's chip during the vehicle production line stage. The embodiment of the present application does not limit the method and time for the vehicle to obtain the public key for verifying the outer signature.
可以理解的是,车云服务器也可以不对安装包进行签名,直接将安装包发送给车辆,本申请实施例对此不做限制。It can be understood that the car cloud server may also directly send the installation package to the vehicle without signing the installation package, and the embodiments of this application do not limit this.
S112.车云服务器将授权文件发送给车辆。S112. The car cloud server sends the authorization file to the vehicle.
车云服务器将授权文件发送给车辆,相应的,车辆接收到来自车云服务器的授权文件。具体的,车辆可以通过域升级控制器DUC获取授权文件。The car cloud server sends the authorization file to the vehicle, and accordingly, the vehicle receives the authorization file from the car cloud server. Specifically, the vehicle can obtain the authorization file through the domain upgrade controller DUC.
车辆获取授权文件可以包括以下两种情况:Vehicle acquisition authorization documents can include the following two situations:
1)车辆通过升级策略获取到授权文件1) The vehicle obtains the authorization file through the upgrade policy
也就是说,车云服务器在生成授权文件之后,可以将该授权文件的下载地址随升级策略,发送给车辆,这样,车辆可以在获取到升级策略之后,根据该授权文件的下载地址,向授权文件所在的设备发送下载请求。That is to say, after the car cloud server generates the authorization file, it can send the download address of the authorization file to the vehicle along with the upgrade policy. In this way, the vehicle can, after obtaining the upgrade policy, send the authorization file to the authorization file based on the download address of the authorization file. The device where the file resides sends a download request.
这种情况下,步骤S108中,车云服务器向车辆发送的升级策略中,可以包括授权文件的下载地址,步骤S109中,车辆解析的下载地址中,可以包括授权文件的下载地址,同理,步骤S110中,车辆向车云服务器发送的下载请求还用于请求获取授权文件。In this case, in step S108, the upgrade policy sent by the car cloud server to the vehicle may include the download address of the authorized file. In step S109, the download address parsed by the vehicle may include the download address of the authorized file. Similarly, In step S110, the download request sent by the vehicle to the vehicle cloud server is also used to request the authorization file.
2)车辆直接获取到车云服务器发送的授权文件2) The vehicle directly obtains the authorization file sent by the car cloud server
也就是说,车云服务器在生成授权文件后,直接将该授权文件发送给车辆,无需经过先发送地址,再发送给授权文件的过程。That is to say, after the car cloud server generates the authorization file, it directly sends the authorization file to the vehicle without going through the process of sending the address first and then the authorization file.
这种情况下,步骤S108中,车云服务器向车辆发送的升级策略中,可以不包括授权文件的下载地址,步骤S109中,车辆解析的下载地址中,可以不包括授权文件的下载地址,同理,步骤S110中,车辆向车云服务器发送的下载请求可以仅用于请求获取升级包。In this case, in step S108, the upgrade policy sent by the car cloud server to the vehicle may not include the download address of the authorized file. In step S109, the download address parsed by the vehicle may not include the download address of the authorized file. At the same time, Processing, in step S110, the download request sent by the vehicle to the vehicle cloud server may only be used to request to obtain the upgrade package.
另外,本申请实施例对步骤S111和步骤S112的先后执行顺序不作限制。例如,步骤S111可以在步骤S112之后执行,或者,步骤S111和步骤S112可以同时执行。In addition, the embodiment of the present application does not limit the execution order of step S111 and step S112. For example, step S111 may be performed after step S112, or step S111 and step S112 may be performed simultaneously.
S113.车辆校验授权文件。S113. Vehicle verification authorization document.
车辆对授权文件的校验可以包括以下一项或多项:Vehicle verification of authorization documents may include one or more of the following:
1)校验授权文件的签名1) Verify the signature of the authorization file
车辆校验授权文件的签名是为了校验授权文件的合法性,包括确认授权文件的来源是否 合法,以及授权文件是否被篡改。这样,可以避免攻击者获取到授权文件后,恶意篡改授权文件中的参数,包括:车辆身份标识、防重放参数、完整性信息等等。The vehicle verifies the signature of the authorization file to verify the legality of the authorization file, including confirming the source of the authorization file. legal, and whether the authorization file has been tampered with. In this way, attackers can be prevented from maliciously tampering with the parameters in the authorization file after obtaining the authorization file, including: vehicle identification, anti-replay parameters, integrity information, etc.
具体实现中,车辆可以利用校验该签名的授权公钥(例如公钥3)对签名进行解密,获得授权文件的参数的消息摘要,并利用哈希算法对车辆接收到的授权文件中的参数进行运算,得到本地计算得到的消息摘要。车辆校验授权文件的签名,即为判断解密得到的消息摘要与本地计算得到的消息摘要是否一致。示例性地,授权文件的参数包括车辆身份标识、防重放参数、完整性信息。In the specific implementation, the vehicle can use the authorized public key (for example, public key 3) to verify the signature to decrypt the signature, obtain the message digest of the parameters of the authorization file, and use the hash algorithm to decrypt the parameters in the authorization file received by the vehicle. Perform operations to obtain the locally calculated message digest. The vehicle verifies the signature of the authorization file to determine whether the decrypted message digest is consistent with the locally calculated message digest. For example, the parameters of the authorization file include vehicle identification, anti-replay parameters, and integrity information.
另外,需要注意的是,车辆对授权文件使用的哈希算法,与车云服务器对授权文件进行签名时,使用的哈希算法相同。In addition, it should be noted that the hash algorithm used by the vehicle for the authorization file is the same as the hash algorithm used by the car cloud server to sign the authorization file.
2)校验授权文件中的车辆身份标识2) Verify the vehicle identification in the authorization document
车辆校验授权文件中的车辆身份标识,是为了确定车云服务器发送的升级包是否为车云服务器发送的适用于该车辆的升级包。这样,可以避免攻击者将服务器发送给其他车辆的升级包或者未经授权的升级用于升级本车辆。The vehicle identification in the vehicle verification authorization file is to determine whether the upgrade package sent by the car cloud server is an upgrade package suitable for the vehicle sent by the car cloud server. In this way, attackers can be prevented from sending upgrade packages from the server to other vehicles or using unauthorized upgrades to upgrade their own vehicles.
具体实现中,车辆可以通过判断授权文件中的车辆身份标识,与本地的车辆身份标识是否一致,来完成车辆身份标识的校验。具体关于车辆身份标识的校验可以参见后续的具体实现,这里先不赘述。In specific implementation, the vehicle can complete the verification of the vehicle identity by determining whether the vehicle identity in the authorization file is consistent with the local vehicle identity. For details about the verification of the vehicle identity, please refer to the subsequent specific implementation, and will not be described in detail here.
3)校验授权文件中的防重放参数3) Verify the anti-replay parameters in the authorization file
车辆校验授权文件中的防重放参数,是为了确定车云服务器发送的升级包是否为适用于本次升级的升级包。这样,可以避免攻击者将不适用于车辆本次升级的版本的升级包用于升级本车辆。The anti-replay parameter in the vehicle verification authorization file is to determine whether the upgrade package sent by the vehicle cloud server is an upgrade package suitable for this upgrade. In this way, attackers can be prevented from using a version of the upgrade package that is not suitable for the current upgrade of the vehicle to upgrade the vehicle.
具体实现中,车辆可以通过判断授权文件中的防重放参数,与本地的防重放参数是否一致,来完成防重放参数的校验。具体关于防重放参数的校验可以参见后续的具体实现,这里先不赘述。In specific implementation, the vehicle can complete the verification of the anti-replay parameters by determining whether the anti-replay parameters in the authorization file are consistent with the local anti-replay parameters. For details about the verification of anti-replay parameters, please refer to the subsequent specific implementation, and will not be described in detail here.
4)校验授权文件中的完整性信息4) Verify the integrity information in the authorization file
车辆校验授权文件中的完整性信息,是为了确定当前校验的授权文件是否为该升级包的授权文件。这样可以避免攻击者仿冒升级包的授权文件,为车辆提供虚假的车辆身份标识、防重放参数等信息,或者,避免攻击者仅截取升级包的授权文件,将该授权文件绑定在其他升级包中发送给本车辆,影响车辆的安全。The vehicle verifies the integrity information in the authorization file to determine whether the currently verified authorization file is the authorization file for the upgrade package. This can prevent attackers from counterfeiting the authorization file of the upgrade package and provide false vehicle identification, anti-replay parameters and other information for the vehicle, or prevent attackers from only intercepting the authorization file of the upgrade package and binding the authorization file to other upgrades. The package is sent to this vehicle, affecting the safety of the vehicle.
示例性地,车辆可以使用哈希函数,计算车辆接收到的升级包的哈希值,该哈希值为车辆在本地计算得到的升级包的完整性信息,车辆再通过判断本地计算得到的完整性信息,与授权文件中的完整性信息是否一致,来完成完整性信息的校验。For example, the vehicle can use a hash function to calculate the hash value of the upgrade package received by the vehicle. The hash value is the integrity information of the upgrade package calculated locally by the vehicle. The vehicle then determines the completeness information obtained by the local calculation. The integrity information is consistent with the integrity information in the authorization file to complete the verification of the integrity information.
另外,需要注意的是,车辆对升级包使用的哈希函数,与车云服务器计算升级包的完整性信息时,使用的哈希函数相同。In addition, it should be noted that the hash function used by the vehicle for the upgrade package is the same as the hash function used by the vehicle cloud server when calculating the integrity information of the upgrade package.
另外,由于完整性信息是为了实现升级包和授权文件的绑定,避免攻击者恶意截取授权文件,将该授权文件随其他存在漏洞的升级包来实现车辆的升级,进而危害车辆的安全,如果本身授权文件和升级包的传输过程是绝对安全的,或者传输过程中对授权文件和升级包进行了加密,使得攻击者无法获取到授权文件和升级包的内容,或者升级包和授权文件是不可分割的,使得攻击者无法单独截取到授权文件,则该授权文件中可以不包括该完整性信息。 或者,车云服务器可以在发送授权文件和升级包时,对该授权文件和升级包进行签名,避免了攻击者恶意拆分授权文件和升级包。In addition, since the integrity information is used to bind the upgrade package and the authorization file, it prevents attackers from maliciously intercepting the authorization file and using the authorization file with other vulnerable upgrade packages to upgrade the vehicle, thus endangering the safety of the vehicle. The transmission process of the authorization file and upgrade package itself is absolutely safe, or the authorization file and upgrade package are encrypted during the transmission process, making it impossible for attackers to obtain the contents of the authorization file and upgrade package, or the upgrade package and authorization file are inaccessible segmented so that an attacker cannot intercept the authorization file alone, the integrity information does not need to be included in the authorization file. Alternatively, the Cheyun server can sign the authorization file and upgrade package when sending it, preventing attackers from maliciously splitting the authorization file and upgrade package.
可以理解的是,授权文件的校验具体根据授权文件中包含的内容来决定需要校验的内容,例如,当授权文件中仅包含车辆身份标识时,授权文件的校验可以仅包括对车辆身份标识的校验,当授权文件中包含车辆身份标识以及防重放参数,则授权文件的校验可以包括车辆身份标识的校验以及防重放参数的校验。It can be understood that the verification of the authorization file determines what needs to be verified based on the content contained in the authorization file. For example, when the authorization file only contains the vehicle identification, the verification of the authorization file may only include the vehicle identity. Verification of the identity. When the authorization file contains the vehicle identity and anti-replay parameters, the verification of the authorization file may include verification of the vehicle identity and verification of the anti-replay parameters.
由于车辆的升级具体为车辆中各个部件的升级,车辆在获取到升级包的授权文件时,可以具体通过待升级部件所在功能域的域控制器DC完成授权文件的校验。具体地,车辆可以通过域控制器DC中的域安装器DI校验授权文件。或者,进一步的,车辆还可以具体通过其他功能域的域控制器DC协助完成授权文件的校验。也就是说,一个授权文件的校验,可以具体由一个或多个域控制器DC完成。本申请实施例对校验授权文件的域控制器DC的数量不作限制。具体关于域安装器DI的描述可以参见前述图3的相关内容,这里不再赘述。Since the vehicle upgrade is specifically an upgrade of each component in the vehicle, when the vehicle obtains the authorization file of the upgrade package, it can complete the verification of the authorization file through the domain controller DC of the functional domain where the component to be upgraded is located. Specifically, the vehicle can verify the authorization file through the domain installer DI in the domain controller DC. Or, further, the vehicle can also assist in completing the verification of the authorization file through the domain controller DC of other functional domains. In other words, the verification of an authorization file can be completed by one or more domain controllers DC. The embodiment of this application does not limit the number of domain controller DCs that verify authorization files. For a specific description of the domain installer DI, please refer to the relevant content of Figure 3 mentioned above, and will not be repeated here.
S114.车辆判断授权文件的校验是否通过。S114. The vehicle determines whether the verification of the authorization file has passed.
当车辆检验的全部内容都一致时,则授权文件的校验通过,否则,当车辆的校验中存在一项不一致时,则授权文件的校验不通过。When all the contents of the vehicle inspection are consistent, the verification of the authorization document passes. Otherwise, when there is an inconsistency in the verification of the vehicle, the verification of the authorization document fails.
例如,当授权文件的检验包括对授权文件的签名的校验、车辆身份标识的校验、防重放参数的校验、完整性信息的校验时,只有在授权文件的签名解密得到的消息摘要,与本地计算得到的消息摘要一致,且,授权文件中的车辆身份标识,与本地的车辆身份标识一致,且,授权文件中的防重放参数与本地的防重放参数一致,授权文件中的完整性信息与本地计算得到的完整性信息一致的情况下,车辆才判断授权文件的校验通过,否则,当签名的校验、车辆身份标识的校验、防重放参数的校验、完整性信息的校验中,存在一个或多个校验不一致时,则授权文件的校验不通过。For example, when the verification of the authorization file includes verification of the signature of the authorization file, verification of vehicle identification, verification of anti-replay parameters, and verification of integrity information, only the message obtained by decrypting the signature of the authorization file The digest is consistent with the locally calculated message digest, and the vehicle identity in the authorization file is consistent with the local vehicle identity, and the anti-replay parameters in the authorization file are consistent with the local anti-replay parameters. The authorization file Only when the integrity information in the vehicle is consistent with the integrity information calculated locally, the vehicle determines that the verification of the authorization file has passed. Otherwise, when the signature verification, vehicle identity verification, and anti-replay parameter verification . During the verification of integrity information, if one or more verifications are inconsistent, the verification of the authorization file will fail.
可以理解的是,车辆可以同时执行授权文件中的多项校验,也可以逐个执行单项校验,本申请实施例对此不做限制。It can be understood that the vehicle can perform multiple verifications in the authorization file at the same time, or can perform individual verifications one by one, and the embodiment of the present application does not limit this.
示例性地,当签名的授权文件中包括:车辆身份标识、防重放参数、完整性信息、授权文件的签名时,车辆可以先验证授权文件的签名,在签名校验通过后,再校验授权文件中的车辆身份标识,在车辆身份标识校验通过后,再校验授权文件中的完整性信息,在完整信信息校验通过后,再校验授权文件中的防重放参数,如果防重放参数的校验通过,则说明授权文件的校验通过,当授权文件中的任意一个校验不通过,则车辆停止校验,并确定授权文件的校验不通过。For example, when the signed authorization file includes: vehicle identity, anti-replay parameters, integrity information, and signature of the authorization file, the vehicle can first verify the signature of the authorization file, and then verify it after the signature verification passes. For the vehicle identity in the authorization file, after the vehicle identity is verified, the integrity information in the authorization file is verified. After the integrity information is verified, the anti-replay parameters in the authorization file are verified. If If the verification of the anti-replay parameters passes, it means that the verification of the authorization file passes. When any verification of the authorization file fails, the vehicle stops verification and determines that the verification of the authorization file fails.
当车辆判断授权文件的校验通过时,则车辆执行步骤S115,否则,车辆执行步骤S118。When the vehicle determines that the verification of the authorization file passes, the vehicle executes step S115; otherwise, the vehicle executes step S118.
S115.车辆校验升级包。S115. Vehicle verification upgrade package.
在授权文件的校验通过后,车辆可以校验升级包。升级包中包括安装包和安装包的外层签名,安装包中包括一个或多个升级文件和与这一个或多个升级文件一一对应的编包签名。After the verification of the authorization file passes, the vehicle can verify the upgrade package. The upgrade package includes an installation package and an outer signature of the installation package. The installation package includes one or more upgrade files and a package signature corresponding to the one or more upgrade files.
升级包的校验可以包括以下一项或多项:Verification of the upgrade package may include one or more of the following:
1)外层签名的校验1) Verification of outer signature
车辆校验外层签名,是为了确认升级包由车云服务器发送到车辆时,该升级包的来源是否合法,以及升级包是否被篡改。The vehicle verifies the outer signature to confirm whether the source of the upgrade package is legal when it is sent to the vehicle by the car cloud server, and whether the upgrade package has been tampered with.
外层签名是指车云服务器对安装包的签名,具体关于外层签名的描述可以参见前述步骤 S103的相关内容,这里不再赘述。The outer signature refers to the signature of the installation package by the CheCloud server. For a detailed description of the outer signature, please refer to the previous steps. The relevant content of S103 will not be repeated here.
示例性地,当升级包中包含车云服务器对安装包的签名时,车辆可以先对升级包进行解包,获得安装包和对安装包的外层签名。然后,车辆可以利用校验该签名的公钥(例如公钥2)来实现对签名的校验。For example, when the upgrade package contains the signature of the installation package by the vehicle cloud server, the vehicle can first unpack the upgrade package to obtain the installation package and the outer signature of the installation package. The vehicle can then use the public key that verifies the signature (for example, public key 2) to verify the signature.
具体地,车辆可以通过域升级控制器DUC,用车云服务器的生成的用于签名-验签外层签名密钥对中的公钥校验升级包的外层签名。具体关于域升级控制器DUC的描述可以参见前述图3的相关内容,这里不再赘述。Specifically, the vehicle can use the domain upgrade controller DUC to verify the outer signature of the upgrade package using the public key in the signature-verification outer signature key pair generated by the vehicle cloud server. For a specific description of the domain upgrade controller DUC, please refer to the relevant content in Figure 3 mentioned above, and will not be repeated here.
2)编包签名的校验2) Verification of package signature
车辆校验编包签名,是为了确认安装包由供应商服务器发送到车云服务器时,该安装包的来源是否合法,以及安装包是否被篡改。The vehicle verifies the package signature to confirm whether the source of the installation package is legal when it is sent from the supplier server to the vehicle cloud server, and whether the installation package has been tampered with.
编包签名是指供应商服务器对升级文件的签名,具体关于编包签名的描述可以参见前述步骤S101的相关内容,这里不再赘述。The package signature refers to the signature of the upgrade file by the supplier server. For a specific description of the package signature, please refer to the relevant content of the aforementioned step S101, which will not be described again here.
示例性地,当升级包包含供应商服务器对升级文件的签名时,车辆可以先对安装包进行解包,获得一个或多个升级文件和一个或多个编包签名,之后,车辆可以利用校验该签名的公钥(例如公钥1)来实现对编包签名的校验。For example, when the upgrade package contains the signature of the upgrade file by the supplier server, the vehicle can first unpack the installation package to obtain one or more upgrade files and one or more package signatures. Afterwards, the vehicle can use the calibration Verify the public key of the signature (for example, public key 1) to verify the packaged signature.
具体地,车辆可以通过域安装器DI,用供应商服务器生成的用于签名-验签编包签名密钥对中的公钥校验升级包的编包签名。具体关于域安装器DI的描述可以参见前述图3的相关内容,这里不再赘述。Specifically, the vehicle can verify the package signature of the upgrade package through the domain installer DI using the public key in the signature-verification package signature key pair generated by the supplier server. For a specific description of the domain installer DI, please refer to the relevant content of Figure 3 mentioned above, and will not be repeated here.
可以理解的是,升级包的校验具体根据升级包中包含的签名来决定需要校验的内容,例如当升级包中仅包含外层签名时,则升级包的校验可以仅包括对外层签名的校验,当升级包中仅包含编包签名时,则升级包的校验可以仅包括对编包签名的校验,当升级包中包括外层签名和编包签名时,升级包的校验可以包括外层签名的校验和编包签名的校验。另外,当车辆接收的升级包不存在签名时,则车辆不存在升级包的签名校验。示例性地,针对电子控制单元ECU的升级包,该升级包中可以仅包含外层签名,不包含编包签名。需要注意的是,即使升级包中包含编包签名,车辆在升级阶段也可以不校验该编包签名,而在安全启动阶段校验编包签名,具体关于安全启动阶段的描述可以参见后续内容,这里先不展开。It can be understood that the verification of the upgrade package determines what needs to be verified based on the signature contained in the upgrade package. For example, when the upgrade package only contains the outer signature, the verification of the upgrade package can only include the outer signature. When the upgrade package only contains the package signature, the verification of the upgrade package can only include the verification of the package signature. When the upgrade package includes the outer signature and the package signature, the verification of the upgrade package can only include the verification of the package signature. Verification can include verification of outer signatures and verification of packaged signatures. In addition, when the upgrade package received by the vehicle does not have a signature, the vehicle does not have signature verification of the upgrade package. For example, for the upgrade package of the electronic control unit ECU, the upgrade package may only contain the outer signature and not the packaged signature. It should be noted that even if the upgrade package contains a compilation signature, the vehicle does not need to verify the compilation signature during the upgrade phase, but verifies the compilation signature during the safe start phase. For a detailed description of the safe start phase, please refer to the following content. , will not be expanded upon here.
另外,当升级包的校验同时包括编包签名的校验和外层签名的校验时,具体实现中,车辆可以先通过域升级控制器DUC校验外层签名,在外层签名的校验通过后,再通过域安装器DI校验编包签名。In addition, when the verification of the upgrade package includes both the verification of the package signature and the verification of the outer signature, in the specific implementation, the vehicle can first verify the outer signature through the domain upgrade controller DUC, and then verify the outer signature. After passing, verify the package signature through the domain installer DI.
进一步的,当供应厂服务器是利用的多级密钥来进行升级包的编包签名时,车辆在对编包签名的校验时涉及到多个公钥的校验过程。Furthermore, when the supplier server uses multi-level keys to compile and sign the upgrade package, the vehicle's verification of the package signature involves the verification process of multiple public keys.
下面以三级密钥为例来介绍车辆对编包签名的校验的详细过程。The following uses the third-level key as an example to introduce the detailed process of the vehicle's verification of the package signature.
当供应商服务器利用三级密钥来进行升级文件的编包签名时,例如,供应商服务器生成的三对密钥:编包根公钥和编包根私钥、编包二层公钥和编包二层私钥、编包三层公钥和编包三层私钥。车辆可以获取到编包根公钥、编包二层公钥、编包二层公钥的签名、编包三层公钥、编包三层公钥的签名、编包签名。具体关于供应商服务器利用三级密钥来进行升级包的编包签名的描述,可以参见前述图5的相关内容,这里不再赘述。When the supplier server uses the third-level key to package and sign the upgrade file, for example, the supplier server generates three pairs of keys: the package root public key and the package root private key, the package second-level public key and the package root private key. The packaged layer 2 private key, the packaged layer 3 public key, and the packaged layer 3 private key. The vehicle can obtain the packaged root public key, packaged layer 2 public key, packaged layer 2 public key signature, packaged layer 3 public key, packaged layer 3 public key signature, and packaged signature. For a specific description of the supplier server using the third-level key to compile and sign the upgrade package, please refer to the relevant content of Figure 5 mentioned above, and will not be repeated here.
图6为本申请实施例提供的车辆验证升级包的编包签名的逻辑结构示意图。Figure 6 is a schematic diagram of the logical structure of the package signature of the vehicle verification upgrade package provided by the embodiment of the present application.
如图6所示,车辆验证编包签名主要包括以下步骤:As shown in Figure 6, vehicle verification package signature mainly includes the following steps:
步骤1:车辆验证编包根公钥的可信度 Step 1: Vehicle verifies the credibility of the packaged root public key
为了避免车辆接收到的编包根公钥是攻击者伪造的,首先车辆需要验证该编包根公钥的可信度。In order to prevent the packaged root public key received by the vehicle from being forged by an attacker, the vehicle first needs to verify the credibility of the packaged root public key.
其中,车辆可以在本地存储有该编包根公钥的哈希值,在验证编包根公钥的可信度时,可以计算该编包根公钥的哈希值,再与本地存储的编包根公钥的哈希值进行比较。如果两者一致,则说明该编包根公钥是可信的,不是伪造的数据,否则,则说明该编包根公钥是不可信的。Among them, the vehicle can store the hash value of the packaged root public key locally. When verifying the credibility of the packaged root public key, the hash value of the packaged root public key can be calculated, and then compared with the locally stored hash value. Compare the hash value of the wrapped root public key. If the two are consistent, it means that the wrapped root public key is trustworthy and not forged data. Otherwise, it means that the wrapped root public key is not trustworthy.
优选的,该编包根公钥的哈希值可以存储在芯片的一次性可编程(One Time Programmable,OTP)存储区域中,由于该OTP的内容不可篡改,且该不可篡改特性由硬件机制保障。这样,可以防止攻击者篡改车辆存储的编包根公钥的哈希值,保证编包根公钥的验证过程的可行度。Preferably, the hash value of the packaged root public key can be stored in the One Time Programmable (OTP) storage area of the chip, because the content of the OTP cannot be tampered with, and the non-tampering feature is guaranteed by the hardware mechanism. . In this way, attackers can be prevented from tampering with the hash value of the packaged root public key stored in the vehicle, and the feasibility of the verification process of the packaged root public key is ensured.
在编包根公钥可信的情况下,车辆可以执行步骤2。If the packaged root public key is trustworthy, the vehicle can perform step 2.
步骤2:车辆利用编包根公钥校验编包二层公钥的签名Step 2: The vehicle uses the packaged root public key to verify the signature of the packaged second-level public key.
由于编包二层公钥的签名是供应商服务器利用编包根私钥,对编包二层公钥签名得到的。因此,在校验编包二层公钥的签名时,可以利用与编包根公钥来校验该签名。Because the signature of the packaged layer 2 public key is obtained by the supplier server using the packaged root private key to sign the packaged layer 2 public key. Therefore, when verifying the signature of the packaged layer-2 public key, the packaged root public key can be used to verify the signature.
当编包二层公钥的签名的校验通过时,则说明编包二层公钥是可信的。在编包二层公钥可信的情况下,车辆可以执行步骤3。When the verification of the signature of the packaged Layer 2 public key passes, it means that the packaged Layer 2 public key is trustworthy. If the packaged Layer 2 public key is trustworthy, the vehicle can perform step 3.
步骤3:车辆利用编包二层公钥校验编包三层公钥的签名Step 3: The vehicle uses the packaged layer 2 public key to verify the signature of the packaged layer 3 public key.
由于编包三层公钥的签名是供应商服务器利用编包二层私钥,对编包三层公钥签名得到的。因此,在校验编包三层公钥的签名时,可以利用与编包二层公钥来校验该签名。Because the signature of the packaged layer 3 public key is obtained by the supplier server using the packaged layer 2 private key to sign the packaged layer 3 public key. Therefore, when verifying the signature of the packaged layer 3 public key, the packaged layer 2 public key can be used to verify the signature.
当编包三层公钥的签名的校验通过时,则说明编包三层公钥是可信的。在编包三层公钥可信的情况下,车辆可以执行步骤4。When the verification of the signature of the packaged three-layer public key passes, it means that the packaged three-layer public key is trustworthy. If the compiled three-layer public key is trustworthy, the vehicle can perform step 4.
步骤4:车辆利用编包三层公钥校验编包签名Step 4: The vehicle uses the three-layer public key of the package to verify the package signature.
由于编包签名是供应商服务器利用编包三层私钥,对升级包中的升级文件签名得到的。因此,在校验编包签名时,可以利用与编包三层公钥来校验该编包签名。Because the package signature is obtained by the supplier server using the package three-layer private key to sign the upgrade file in the upgrade package. Therefore, when verifying the packaged signature, the packaged three-layer public key can be used to verify the packaged signature.
当编包签名的校验通过时,则说明该升级包中的升级文件是可信的。When the verification of the package signature passes, it means that the upgrade file in the upgrade package is trustworthy.
可以理解的是,本申请实施例对供应商服务器使用的密钥层级数不作限制,例如,当供应商服务器使用四对密钥来实现编包签名时,该编包签名的校验过程中可以涉及对更多公钥的签名的校验,其原理类似于上述车辆对编包签名的校验过程,这里不再赘述。It can be understood that the embodiment of the present application does not limit the number of key levels used by the supplier server. For example, when the supplier server uses four pairs of keys to implement the package signature, the verification process of the package signature can be The principle involved in verifying the signatures of more public keys is similar to the vehicle's verification process of package signatures mentioned above, and will not be described again here.
S116.车辆判断升级包的校验是否通过。S116. The vehicle determines whether the verification of the upgrade package has passed.
如果车辆对升级包的所有签名的校验都通过,则升级包的校验通过,否则,升级包的校验不通过。If the vehicle passes the verification of all signatures of the upgrade package, the verification of the upgrade package passes; otherwise, the verification of the upgrade package fails.
车辆判断升级包的校验通过时,则执行步骤S117,否则,执行步骤S118。When the vehicle determines that the verification of the upgrade package passes, step S117 is executed; otherwise, step S118 is executed.
S117.车辆安装升级包。S117. Vehicle installation upgrade package.
车辆安装升级包是指车辆执行升级包的刷写,将升级包中的升级文件写入车辆的存储分区中,具体地,将车辆待升级部件的升级包中的升级文件写入该待升级的部件的存储分区中。Installing the upgrade package on the vehicle means that the vehicle executes the flashing of the upgrade package and writes the upgrade file in the upgrade package into the storage partition of the vehicle. Specifically, the upgrade file in the upgrade package of the vehicle component to be upgraded is written into the to-be-upgraded in the component's storage partition.
具体地,车辆可以通过域安装器DI安装升级包,完成车辆的部件的升级。Specifically, the vehicle can install the upgrade package through the domain installer DI to complete the upgrade of vehicle components.
这样,车辆只有在确定升级包为适用于本车辆的升级包,升级包来源合法且未被篡改的 前提下,才会触发安装升级,从车辆升级阶段严格把控车辆的安全运行,为车辆的升级提供安全保障。In this way, the vehicle can only confirm that the upgrade package is suitable for the vehicle and that the source of the upgrade package is legal and has not been tampered with. Under the premise, the installation upgrade will be triggered, and the safe operation of the vehicle will be strictly controlled from the vehicle upgrade stage to provide safety guarantee for the vehicle upgrade.
S118.车辆取消升级。S118. Vehicle upgrade canceled.
如果授权文件的校验不通过,则车辆取消升级,车辆的升级失败。这样,可以避免车辆将不适用于本车辆的升级包,例如老版本的升级包、其他车辆的升级包、研发阶段使用的升级包等等导入该车辆,尽可能地维护车主、软件供应商、车厂的商业利益,提高车辆的安全性。If the verification of the authorization file fails, the vehicle upgrade will be canceled and the vehicle upgrade will fail. In this way, the vehicle can be prevented from importing upgrade packages that are not applicable to the vehicle, such as upgrade packages of old versions, upgrade packages of other vehicles, upgrade packages used in the research and development stage, etc., so as to protect car owners, software suppliers, The commercial interests of car manufacturers are to improve vehicle safety.
同样地,如果升级包的校验不通过,则车辆取消升级,车辆的升级失败。这样,可以避免车辆将恶意篡改或来源不合法的升级包导入该车辆,尽可能地提高车辆升级的安全性。Similarly, if the verification of the upgrade package fails, the vehicle upgrade will be canceled and the vehicle upgrade will fail. In this way, the vehicle can be prevented from being maliciously tampered with or upgrade packages from illegal sources imported into the vehicle, and the security of vehicle upgrades can be improved as much as possible.
应理解,在本申请实施例中,车云服务器还可以被称为第一服务器,供应商服务器还可以被称为第二服务器,车辆本地的车辆身份标识还可以被称为车辆标识,车辆接收到的授权文件还可以被称为第一文件,接收到的升级包还可以被称为第一升级包,授权文件中的车辆身份标识还可以被称为第一车辆标识,授权文件中防重放参数还可以被称为第一防重放参数,授权文件中的完整性信息还可以被称为第一完整性信息,授权文件中的签名还可以被称为第一签名,授权文件中的授权公钥还可以被称为第一公钥,升级包中的外层签名还可以被称为第三签名,升级包中的编包签名还可以被称为第四签名。It should be understood that in the embodiment of this application, the vehicle cloud server may also be called the first server, the supplier server may also be called the second server, and the vehicle's local vehicle identity may also be called the vehicle identification. The vehicle receives The received authorization file may also be called the first file, the received upgrade package may also be called the first upgrade package, and the vehicle identity in the authorization file may also be called the first vehicle identification. The replay parameter may also be called the first anti-replay parameter, the integrity information in the authorization file may also be called the first integrity information, the signature in the authorization file may also be called the first signature, and the integrity information in the authorization file may also be called the first signature. The authorized public key may also be called the first public key, the outer signature in the upgrade package may also be called the third signature, and the packaged signature in the upgrade package may also be called the fourth signature.
下面结合图7介绍近端升级场景下的车辆校验方法。The following describes the vehicle verification method in the near-end upgrade scenario with reference to Figure 7.
图7为本申请实施例提供的近端升级场景下,车辆校验方法的流程示意图。Figure 7 is a schematic flowchart of the vehicle verification method in the near-end upgrade scenario provided by the embodiment of the present application.
近端升级场景主要涉及供应商服务器、车云服务器、车辆、诊断终端之间的交互,车辆可以通过有线通信的方式获取升级包,完成车辆的升级。The near-end upgrade scenario mainly involves the interaction between the supplier server, vehicle cloud server, vehicle, and diagnostic terminal. The vehicle can obtain the upgrade package through wired communication to complete the vehicle upgrade.
如图7所示,该车辆校验方法可包括:As shown in Figure 7, the vehicle verification method may include:
S201.供应商服务器对一个或多个升级文件进行签名,并生成安装包。S201. The supplier server signs one or more upgrade files and generates an installation package.
S202.供应商服务器将安装包发送给车云服务器。S202. The supplier server sends the installation package to the Cheyun server.
S203.车云服务器对安装包进行签名,并生成升级包。S203. The Cheyun server signs the installation package and generates an upgrade package.
其中,步骤S201-S203和图4中的步骤S101-S103相同,可参考相关描述。Among them, steps S201-S203 are the same as steps S101-S103 in Figure 4. Please refer to the relevant description.
S204.诊断终端获取车辆的资产信息。S204. The diagnostic terminal obtains the asset information of the vehicle.
S205.诊断终端将资产信息发送给车云服务器。S205. The diagnostic terminal sends the asset information to the car cloud server.
其中,步骤S204-S205和图4中的步骤S104类似,不同之处在于图7中的车辆的资产信息是通过诊断终端与车辆建立有线连接,从车辆中读取到的,之后,诊断终端再将资产信息发送给车云服务器。而图4中是车辆直接将资产信息发送给车云服务器。Among them, steps S204-S205 are similar to step S104 in Figure 4. The difference is that the asset information of the vehicle in Figure 7 is read from the vehicle by establishing a wired connection with the vehicle through the diagnostic terminal. After that, the diagnostic terminal then Send asset information to the car cloud server. In Figure 4, the vehicle directly sends asset information to the vehicle cloud server.
其中,诊断终端用于获取车辆的资产信息,并从车云服务器获取升级包,通过有线传输的方式将升级包导入车辆。示例性地,该诊断终端可以是指图1所示的电子设备400。具体关于电子设备400的描述可以参见图1的相关内容,这里不再赘述。Among them, the diagnostic terminal is used to obtain the asset information of the vehicle, obtain the upgrade package from the vehicle cloud server, and import the upgrade package into the vehicle through wired transmission. For example, the diagnostic terminal may refer to the electronic device 400 shown in FIG. 1 . For a specific description of the electronic device 400, please refer to the relevant content of FIG. 1 and will not be described again here.
另外,在车辆将资产信息发送给诊断终端之前,需要用户手动将诊断终端连接到车辆的端口,例如OBD端口,诊断终端可通过该OBD端口获取车辆的资产信息,以及,将升级包导入车辆。In addition, before the vehicle sends asset information to the diagnostic terminal, the user needs to manually connect the diagnostic terminal to the vehicle's port, such as the OBD port. The diagnostic terminal can obtain the vehicle's asset information through the OBD port and import the upgrade package into the vehicle.
S206.车云服务器根据资产信息确定升级包。S206. The car cloud server determines the upgrade package based on the asset information.
S207.车云服务器生成授权文件。S207. The car cloud server generates an authorization file.
S208.车云服务器确定升级策略。 S208. The car cloud server determines the upgrade strategy.
其中,步骤S206-S208和图4中的步骤S105-S107相同,可参考相关描述。Among them, steps S206-S208 are the same as steps S105-S107 in Figure 4. Please refer to the relevant description.
S209.车云服务器将升级策略发送给诊断终端。S209. The car cloud server sends the upgrade strategy to the diagnostic terminal.
S210.诊断终端根据升级策略解析下载地址。S210. The diagnostic terminal parses the download address according to the upgrade policy.
S211.诊断终端根据下载地址向车云服务器发送下载请求。S211. The diagnostic terminal sends a download request to the car cloud server according to the download address.
S212.车云服务器将升级包发送给诊断终端。S212. The car cloud server sends the upgrade package to the diagnostic terminal.
S213.车云服务器将授权文件发送给诊断终端。S213. The car cloud server sends the authorization file to the diagnostic terminal.
S214.诊断终端将升级包发送给车辆。S214. The diagnostic terminal sends the upgrade package to the vehicle.
S215.诊断终端将授权文件发送给车辆。S215. The diagnostic terminal sends the authorization file to the vehicle.
其中,步骤S209-S215和图4中的步骤S108-S112类似,不同之处在于图7中的车云服务器是将升级策略发送给诊断终端,由诊断终端解析出下载地址,之后,再由诊断终端向车云服务器发送下载请求,并且,车云服务器是将升级包和授权文件发送给诊断终端,诊断终端再将该升级包和授权文件转发给车辆。而图4中的车云服务器直接将升级策略发送给车辆,由车辆解析出下载地址,之后,再由车辆向车云服务器发送下载请求,并且,车云服务器是将升级包和授权文件直接发送给车辆。Among them, steps S209-S215 are similar to steps S108-S112 in Figure 4. The difference is that the car cloud server in Figure 7 sends the upgrade policy to the diagnostic terminal, and the diagnostic terminal parses the download address. After that, the diagnostic terminal The terminal sends a download request to the car cloud server, and the car cloud server sends the upgrade package and authorization file to the diagnostic terminal, and the diagnosis terminal forwards the upgrade package and authorization file to the vehicle. The car cloud server in Figure 4 directly sends the upgrade policy to the vehicle, and the vehicle parses the download address. After that, the vehicle sends a download request to the car cloud server, and the car cloud server directly sends the upgrade package and authorization file. to vehicles.
需要注意的是,在步骤S214和步骤S215中,诊断终端是通过有线连接的方式将升级包和授权文件发送给车辆,例如,诊断终端连接车辆的OBD端口,通过该OBD端口将升级包传输给车辆。It should be noted that in steps S214 and S215, the diagnostic terminal sends the upgrade package and authorization file to the vehicle through a wired connection. For example, the diagnostic terminal is connected to the OBD port of the vehicle, and the upgrade package is transmitted to the vehicle through the OBD port. vehicle.
另外,本申请实施例不限制步骤S212-S215的先后执行顺序,例如,步骤S214可以在步骤S213之前执行,也可以在步骤S215之后执行。可以看出,只需要步骤S214在步骤S212之后执行,步骤S215在步骤S213之后执行即可。In addition, the embodiment of the present application does not limit the execution order of steps S212-S215. For example, step S214 may be executed before step S213 or after step S215. It can be seen that step S214 only needs to be executed after step S212, and step S215 only needs to be executed after step S213.
S216.车辆校验授权文件。S216. Vehicle verification authorization document.
S217.车辆判断授权文件的校验是否通过。S217. The vehicle determines whether the verification of the authorization file has passed.
如果车辆判断授权文件的校验通过,则执行步骤S218,否则,执行步骤S221。If the vehicle determines that the verification of the authorization file passes, step S218 is executed; otherwise, step S221 is executed.
S218.车辆校验升级包。S218. Vehicle verification upgrade package.
S219.车辆判断升级包的校验是否通过。S219. The vehicle determines whether the verification of the upgrade package has passed.
如果车辆判断升级包的校验通过,则执行步骤S220,否则,执行步骤S221。If the vehicle determines that the verification of the upgrade package passes, step S220 is executed; otherwise, step S221 is executed.
S220.车辆安装升级包。S221.车辆取消升级。S220. Vehicle installation upgrade package. S221. Vehicle upgrade canceled.
其中,步骤S216-S221和图4中的步骤S113-S118类似。不同之处在于,步骤S216中车辆校验授权文件可以由车辆自动触发对授权文件的校验,也可以由诊断终端触发车辆对授权文件的校验,类似的,步骤S218中车辆校验升级包可以由车辆自动触发对升级包的校验,也可以由诊断终端触发车辆对升级包的校验。Among them, steps S216-S221 are similar to steps S113-S118 in Figure 4. The difference is that the vehicle verification authorization file in step S216 can be automatically triggered by the vehicle to verify the authorization file, or the diagnosis terminal can trigger the verification of the authorization file by the vehicle. Similarly, the vehicle verification upgrade package in step S218 The vehicle can automatically trigger the verification of the upgrade package, or the diagnostic terminal can trigger the vehicle's verification of the upgrade package.
另外,在步骤S220中,车辆在近端升级场景下的安装升级包可以包括以下三个阶段:In addition, in step S220, the vehicle's installation of the upgrade package in the local upgrade scenario may include the following three stages:
1)预编程阶段1) Preprogramming stage
预编程阶段也可以被称为刷写准备阶段,该阶段主要用于搭建升级前的升级环境。具体地,车辆可以将待升级部件的运行模式切换到会话模式,在该会话模式下,待升级部件存在更高的诊断权限,待升级部件可以在该模式下进行升级刷写。The pre-programming stage can also be called the flash preparation stage. This stage is mainly used to build an upgrade environment before upgrading. Specifically, the vehicle can switch the operating mode of the component to be upgraded to the session mode. In the session mode, the component to be upgraded has higher diagnostic authority, and the component to be upgraded can be upgraded and refreshed in this mode.
2)安装阶段2) Installation stage
安装阶段主要是车辆将升级包的数据刷写到待升级部件的存储中。The installation phase is mainly for the vehicle to flash the data of the upgrade package into the storage of the components to be upgraded.
3)后编程阶段3) Post-programming stage
在刷写结束后,车辆可以将待升级部件的运行模式切换回默认会话模式,从而结束车辆的升级。 After the flashing is completed, the vehicle can switch the operating mode of the component to be upgraded back to the default session mode, thus ending the vehicle upgrade.
可以看出,在近端升级场景下,车辆无需联网,直接通过有线连接诊断终端,由诊断终端主导,完成车辆的升级,并且车辆会在升级之前,检验升级包是否为适用于本车辆的升级包,来源是否合法,以及是否被篡改,从车辆升级阶段严格把控车辆的安全运行,保证车主、软件供应商和车厂的商业利益。It can be seen that in the near-end upgrade scenario, the vehicle does not need to be connected to the Internet, and is directly connected to the diagnostic terminal through a wire. The diagnostic terminal takes the lead to complete the vehicle upgrade, and the vehicle will check whether the upgrade package is suitable for the vehicle before upgrading. Check whether the source of the package is legal and whether it has been tampered with. Strictly control the safe operation of the vehicle from the vehicle upgrade stage to ensure the commercial interests of car owners, software suppliers and car manufacturers.
另外,对于车辆中支持安全启动功能的部件,例如车辆中的域控制器DC,在车辆完成升级之后,启动车辆的过程中,车辆的部件同样也存在验证授权文件的过程。这样,可以防止车辆升级后,任何未经授权或恶意修改的软件在车辆内部运行,尽可能地保证车辆运行时的系统安全。In addition, for components in the vehicle that support the secure boot function, such as the domain controller DC in the vehicle, after the vehicle is upgraded and the vehicle is started, the vehicle components also have a process of verifying the authorization file. In this way, any unauthorized or maliciously modified software can be prevented from running inside the vehicle after the vehicle is upgraded, ensuring system security when the vehicle is running as much as possible.
在车辆部件进行安全启动的过程中,部件中的软件依次启动,且前一个软件校验后一个软件的安全性,验证通过后,前一个软件将控制权移交给后一个软件,以此类推,从而完成车辆部件的安全启动。During the safe startup of vehicle components, the software in the component starts in sequence, and the previous software verifies the safety of the next software. After the verification is passed, the previous software hands over control to the next software, and so on. This completes the safe start of vehicle components.
车辆的安全启动可以是指启动车辆的功能,例如第一功能。示例性地,车辆可以在检测到启动第一功能的指令后,触发对授权文件的校验,并在校验通过后,触发启动第一功能。Safe starting of the vehicle may refer to starting a function of the vehicle, such as a first function. For example, after detecting an instruction to start the first function, the vehicle can trigger verification of the authorization file, and after passing the verification, trigger starting of the first function.
下面以车辆部件安全启动过程中,第一软件校验第二软件为例,来详细介绍安全启动场景下,该车辆校验方法还包括的内容。其中,该第二软件可以为使用升级包升级后的程序。The following takes the first software to verify the second software during the safe startup of vehicle components as an example to introduce in detail the contents of the vehicle verification method in the safe startup scenario. The second software may be a program upgraded using an upgrade package.
步骤1:车辆安全启动第一软件。Step 1: Start the first software of the vehicle safely.
该第一软件可以是已校验过安全性的软件,也可以是开始安全启动时,存在绝对安全性的软件。其绝对安全性由硬件机制保障,这时,第一软件的代码位于不可篡改的存储区域中,例如OCR中。The first software may be software whose security has been verified, or it may be software that has absolute security when secure startup is started. Its absolute security is guaranteed by the hardware mechanism. At this time, the code of the first software is located in a storage area that cannot be tampered with, such as OCR.
步骤2:车辆通过第一软件校验授权文件。Step 2: The vehicle verifies the authorization file through the first software.
该授权文件为第二软件通过升级包升级时,该升级包的授权文件。具体关于授权文件的描述以及授权文件的获取可以参见前述图4的相关内容,这里不再赘述。示例性地,该第二软件可以为xloader。The authorization file is the authorization file of the upgrade package when the second software is upgraded through the upgrade package. For the specific description of the authorization file and the acquisition of the authorization file, please refer to the relevant content in Figure 4, and will not be repeated here. For example, the second software may be xloader.
其中,授权文件的校验包括以下一项或多项:校验授权文件的签名、校验车辆身份标识、校验完整性信息、校验防重放参数。Among them, the verification of the authorization file includes one or more of the following: verification of the signature of the authorization file, verification of vehicle identity, verification of integrity information, and verification of anti-replay parameters.
其中,车辆在安全启动阶段对授权文件的校验类似于升级阶段对授权文件的校验,不同的是,在安全启动阶段和升级阶段校验的完整性信息不同。Among them, the verification of the authorization file by the vehicle in the safe start stage is similar to the verification of the authorization file in the upgrade stage. The difference is that the integrity information verified in the safe start stage and the upgrade stage are different.
在车辆升级阶段,车辆是通过计算接收到的升级包的完整性信息,将该完整性信息与授权文件中的完整性信息进行比较,来实现完整性信息的校验。During the vehicle upgrade phase, the vehicle verifies the integrity information by calculating the integrity information of the received upgrade package and comparing the integrity information with the integrity information in the authorization file.
而在安全启动阶段,由于升级包的数据已经导入到第二软件内部,车辆校验的是第二软件的镜像文件的完整性信息。具体的,车辆可以使用哈希算法,计算第二软件的镜像文件的完整性信息,将该完整性信息与授权文件中的完整性信息比较,如果一致,则完整性信息的校验通过,否则,完整性信息的校验不通过。其中,镜像是一种文件存储形式,是冗余的一种类型,一个磁盘上的数据在另一个磁盘上存在一个完全相同的副本即为镜像。所谓镜像文件其实和安装包类似,它将特定的一系列文件按照一定的格式制作成单一的文件,以方便用户下载和使用,例如一个测试版的操作系统、游戏等。In the safe startup phase, since the data of the upgrade package has been imported into the second software, the vehicle verifies the integrity information of the image file of the second software. Specifically, the vehicle can use a hash algorithm to calculate the integrity information of the image file of the second software, and compare the integrity information with the integrity information in the authorization file. If they are consistent, the verification of the integrity information passes, otherwise , the integrity information verification failed. Among them, mirroring is a form of file storage and a type of redundancy. The data on one disk has an identical copy on another disk, which is a mirror. The so-called image file is actually similar to an installation package. It produces a specific series of files into a single file in a certain format to facilitate users to download and use, such as a test version of an operating system, a game, etc.
在授权文件的校验通过后,车辆可以执行步骤3,否则,车辆终止安全启动。After the verification of the authorization file passes, the vehicle can perform step 3, otherwise, the vehicle terminates the safe start.
步骤3:车辆校验第二软件的编包签名。 Step 3: The vehicle verifies the package signature of the second software.
一个升级包可以实现部件中一个或多个软件的升级,第二软件的编包签名可以为升级包中的其中一个升级文件的编包签名。An upgrade package can upgrade one or more software in the component, and the package signature of the second software can be the package signature of one of the upgrade files in the upgrade package.
由于该第二软件为车辆使用升级包升级后的软件,在车辆升级完成后,升级包的编包签名存储在第二软件的存储分区中,车辆校验第二软件的编包签名即为校验第二软件的编包签名。Since the second software is the software upgraded by using the upgrade package for the vehicle, after the vehicle upgrade is completed, the package signature of the upgrade package is stored in the storage partition of the second software, and the vehicle verifies the package signature of the second software. Verify the package signature of the second software.
也就是说,车辆校验第二软件的编包签名,与车辆升级阶段,校验升级包的编包签名的过程类似。不同的是,在安全启动阶段,车辆是从第二软件的存储分区中,获取第二软件的编包签名和用于校验该编包签名的公钥,来完成对编包签名的校验。That is to say, the process of the vehicle verifying the package signature of the second software is similar to the process of verifying the package signature of the upgrade package during the vehicle upgrade phase. The difference is that during the secure startup phase, the vehicle obtains the package signature of the second software and the public key used to verify the package signature from the storage partition of the second software to complete the verification of the package signature. .
可以理解的是,当编包签名是利用多级密钥实现的,该第二软件的存储分区中还包括其他公钥和其他公钥的签名。具体关于编包签名的校验可以参见前述步骤S115中的相关内容,这里不再赘述。It can be understood that when the package signature is implemented using multi-level keys, the storage partition of the second software also includes other public keys and signatures of other public keys. For details about the verification of the packet signature, please refer to the relevant content in the aforementioned step S115, which will not be described again here.
这样,可以防止在车辆升级完成后,任何未经授权或恶意修改的软件在车辆内部运行。This prevents any unauthorized or maliciously modified software from running inside the vehicle after the vehicle upgrade is completed.
在编包签名的校验通过后,车辆可以执行步骤4;否则,车辆终止安全启动。After the verification of the package signature passes, the vehicle can perform step 4; otherwise, the vehicle terminates the safe start.
可以理解的是,车辆也可以先校验升级包的编包签名,再校验授权文件,也就是说步骤3可以在步骤2之前执行,本申请实施例对该执行顺序不作限制。It can be understood that the vehicle can also verify the package signature of the upgrade package first, and then verify the authorization file. That is to say, step 3 can be executed before step 2. The embodiment of the present application does not limit the execution order.
步骤4:车辆安全启动第二软件。Step 4: The vehicle safely starts the second software.
车辆在安全启动第二软件之后,可以将控制权移交给第二软件,车辆继续通过第二软件校验第二软件的下一级软件(例如第三软件)的安全性,包括校验授权文件和编包签名,依次类推,直到车辆校验完当前车辆部件的所有软件,则车辆安全启动该车辆部件。After the vehicle safely starts the second software, the vehicle can transfer control to the second software, and the vehicle continues to verify the security of the next-level software of the second software (such as third software) through the second software, including verifying the authorization file. and package signature, and so on, until the vehicle has verified all the software of the current vehicle component, and the vehicle safely starts the vehicle component.
可以看出,车辆在升级阶段可以接收到授权文件和升级包,并通过校验授权文件来确定是否使用该升级包升级,之后,在车辆的安全启动阶段,车辆可以再次校验该授权文件,来防止攻击方恶意拆件更改车辆升级后的数据。It can be seen that the vehicle can receive the authorization file and upgrade package during the upgrade phase, and determine whether to use the upgrade package by verifying the authorization file. After that, during the safe start stage of the vehicle, the vehicle can verify the authorization file again. To prevent attackers from maliciously dismantling components and changing the vehicle’s upgraded data.
需要注意的是,车辆在升级阶段接收到授权文件和升级包后,可以既在升级阶段校验授权文件,又在安全启动阶段校验授权文件,或者,车辆可以仅在升级阶段校验授权文件,或者,车辆可以仅在安全启动阶段校验授权文件,本申请实施例对此不作限制。示例性地,当车辆仅在安全启动阶段校验授权文件时,车辆可以直接根据该升级包进行升级,不进行授权文件的校验,而在车辆的安全启动阶段,车辆再进行授权文件的校验,校验车辆的数据是否是根据升级包升级后的数据,只有校验通过后,才能启动车辆,保证车辆的安全运行。It should be noted that after the vehicle receives the authorization file and upgrade package during the upgrade stage, it can verify the authorization file both during the upgrade stage and during the secure startup stage, or the vehicle can verify the authorization file only during the upgrade stage. , or the vehicle can only verify the authorization file during the safe startup phase, which is not limited in the embodiment of the present application. For example, when the vehicle only verifies the authorization file during the safe startup phase, the vehicle can be directly upgraded according to the upgrade package without verifying the authorization file. During the safe startup phase of the vehicle, the vehicle then verifies the authorization file. Verification, verify whether the vehicle data is the data upgraded according to the upgrade package. Only after the verification passes, the vehicle can be started to ensure the safe operation of the vehicle.
应理解,安全启动阶段提及的升级包和授权文件为车辆在升级阶段获取到的升级包和授权文件,具体关于授权文件的获取,可以参考前述图4和图7的相关内容,这里不再赘述。It should be understood that the upgrade package and authorization file mentioned in the safe start stage are the upgrade packages and authorization files obtained by the vehicle during the upgrade stage. For specific information on obtaining the authorization file, please refer to the relevant content of Figure 4 and Figure 7 mentioned above, which will not be discussed here. Repeat.
下面详细介绍车辆身份标识的具体实现过程。The specific implementation process of vehicle identification is introduced in detail below.
车辆身份标识用于唯一标识当前升级的车辆,进一步的,唯一表示当前升级的部件。车辆在升级时,可以通过校验该车辆身份标识,来防止攻击者利用其他车辆的升级包或研发阶段使用的升级包等等不适用于本车辆的升级包来升级本车辆。The vehicle identity is used to uniquely identify the currently upgraded vehicle, and further, uniquely represents the currently upgraded components. When a vehicle is being upgraded, the identity of the vehicle can be verified to prevent attackers from upgrading the vehicle using upgrade packages from other vehicles or upgrade packages used in the research and development phase that are not applicable to the vehicle.
由于授权文件的校验可以由下载该授权文件的域控制器DC校验,或者,由下载该授权文件的域控制器DC以及其他域控制器DC共同校验。根据授权文件校验时涉及到的域控制器DC的数量,车辆身份标识的实现主要涉及以下两个方案:The authorization file can be verified by the domain controller DC that downloaded the authorization file, or by the domain controller DC that downloaded the authorization file and other domain controller DCs. Depending on the number of domain controller DCs involved in authorization file verification, the implementation of vehicle identity mainly involves the following two solutions:
方案一:授权文件的校验由单个域控制器DC完成Solution 1: Verification of the authorization file is completed by a single domain controller DC
当授权文件的校验仅由单个域控制器DC完成时,该车辆身份标识Space_Attr可以为该 域控制器DC的芯片ID。When the verification of the authorization file is only completed by a single domain controller DC, the vehicle identity Space_Attr can be The chip ID of the domain controller DC.
可以看出,授权文件的校验由单个域控制器DC完成,可以使得车辆能够快速完成车辆身份标识的校验。It can be seen that the verification of the authorization file is completed by a single domain controller DC, which allows the vehicle to quickly complete the verification of the vehicle identity.
进一步地,该车辆身份标识Space_Attr可以预存在车辆的不可篡改的存储区域中。这样,可以避免其他人恶意篡改该车辆身份标识,保证车辆身份标识在校验过程中的可信度。Further, the vehicle identity Space_Attr can be pre-stored in a non-tamperable storage area of the vehicle. In this way, other people can be prevented from maliciously tampering with the vehicle identity, and the credibility of the vehicle identity during the verification process can be ensured.
示例性地,该车辆身份标识Space_Attr可以熔丝在域控制器DC的芯片的一次性可编程(One Time Programmable,OTP)存储区域中。For example, the vehicle identity Space_Attr can be fused in a one-time programmable (One Time Programmable, OTP) storage area of a chip of the domain controller DC.
这样,在车辆需要将资产信息发送给车云服务器时,可以从域控制器DC的OTP存储区域中读取车辆身份标识Space_Attr,在车辆通过域控制器DC校验授权文件中的车辆身份标识Space_Attr时,可以通过比较域控制器DC的OTP存储区域中存储的车辆身份标识,和授权文件中的车辆身份标识是否一致,来确定车辆身份标识的校验是否通过。In this way, when the vehicle needs to send asset information to the car cloud server, it can read the vehicle identity identifier Space_Attr from the OTP storage area of the domain controller DC, and then the vehicle verifies the vehicle identity identifier Space_Attr in the authorization file through the domain controller DC. At this time, you can determine whether the verification of the vehicle identity has passed by comparing whether the vehicle identity stored in the OTP storage area of the domain controller DC is consistent with the vehicle identity in the authorization file.
需要注意的是,当升级的部件为电子控制单元ECU时,如果该电子控制单元ECU的安全能力较弱,车辆可以通过该电子控制单元ECU连接的域控制器DC来校验该电子控制单元ECU的升级包对应的授权文件。那么,此时授权文件中的车辆身份标识为该域控制器DC的芯片ID。可以理解的是,如果电子控制单元ECU安全能力较强,电子控制单元ECU的升级包对应的授权文件的校验也可以由其本身完成。本申请实施例对电子控制单元ECU的授权文件的校验部件不做限制。也就是说,车辆身份标识可以用于标识第一部件,该第一部件可以是指升级的部件,也可以是指管理升级部件(例如第二部件)的部件。It should be noted that when the upgraded component is an electronic control unit ECU, if the security capability of the electronic control unit ECU is weak, the vehicle can verify the electronic control unit ECU through the domain controller DC connected to the electronic control unit ECU. The authorization file corresponding to the upgrade package. Then, at this time, the vehicle identity in the authorization file is the chip ID of the domain controller DC. It can be understood that if the electronic control unit ECU has strong security capabilities, the verification of the authorization file corresponding to the upgrade package of the electronic control unit ECU can also be completed by itself. The embodiment of the present application does not limit the verification components of the authorization file of the electronic control unit ECU. That is to say, the vehicle identification may be used to identify the first component, and the first component may refer to an upgraded component or a component that manages the upgraded component (eg, a second component).
方案二:授权文件的校验由多个域控制器DC完成Solution 2: Verification of authorization files is completed by multiple domain controllers DC
当授权文件的校验由多个域控制器DC完成时,授权文件中的车辆身份标识Space_Attr可以包括:这多个域控制器DC的芯片ID。When the verification of the authorization file is completed by multiple domain controllers DC, the vehicle identity identifier Space_Attr in the authorization file may include: the chip IDs of the multiple domain controllers DC.
可以看出,当授权文件的校验由多个域控制器DC完成时,只有在确定授权文件中的多个域控制器DC的芯片ID,都与本地这多个域控制器DC的芯片ID一致的情况下,车辆身份标识的校验才算通过,这样可以防止出现对车辆进行恶意换件的攻击场景。It can be seen that when the verification of the authorization file is completed by multiple domain controller DCs, only after it is determined that the chip IDs of the multiple domain controller DCs in the authorization file are consistent with the local chip IDs of the multiple domain controller DCs. Only when they are consistent, the verification of the vehicle identity will be considered passed, which can prevent the occurrence of malicious replacement attack scenarios on the vehicle.
以升级的部件为电子控制单元ECU,校验授权文件的部件为域控制器DC为例,假设车辆A存在待升级的部件ECU1,该部件ECU1的升级包的授权文件,由与其连接的部件DC1进行校验。那么,部件DC1拥有ECU1的升级包和授权文件,车辆B存在部件ECU2以及其连接的部件DC2。其中,部件ECU1和部件ECU2为同一类型的部件,部件DC1和部件DC2为同一类型的部件。在对部件ECU1进行升级前,对部件DC2与部件DC1进行替换,并在车辆B上触发对替换后的部件DC1的授权文件中的车辆身份标识的验证,如果车辆身份标识仅为部件DC1的芯片ID,那么该校验可以通过,车辆B可以在未合法获取升级包的情况下触发对车辆B中的部件ECU2的升级。这就使得攻击者可以利用该漏洞,不按照正规升级方式进行车辆升级,进而影响到车主、软件供应商和车厂的商业利益。Take the upgraded component as the electronic control unit ECU and the component that verifies the authorization file as the domain controller DC. Assume that vehicle A has a component ECU1 to be upgraded. The authorization file of the upgrade package of this component ECU1 is determined by the component DC1 connected to it. Perform verification. Then, component DC1 has the upgrade package and authorization file of ECU1, and vehicle B has component ECU2 and its connected component DC2. Among them, component ECU1 and component ECU2 are components of the same type, and component DC1 and component DC2 are components of the same type. Before upgrading component ECU1, replace component DC2 with component DC1, and trigger the verification of the vehicle identity in the authorization file of the replaced component DC1 on vehicle B. If the vehicle identity is only the chip of component DC1 ID, then the verification can pass, and vehicle B can trigger the upgrade of component ECU2 in vehicle B without legally obtaining the upgrade package. This allows attackers to exploit this vulnerability and upgrade vehicles without following formal upgrade methods, thereby affecting the commercial interests of car owners, software suppliers and car manufacturers.
也就是说,使用多个域控制器DC的芯片ID来实现车辆身份标识,可以通过多个域控制器DC的绑定,来避免攻击者对车辆的部件进行替换。例如,车辆身份标识可以用于标识第一部件和第三部件。其中,第一部件可以为升级部件,也可以为管理升级部件(例如第二部件)的部件。In other words, using the chip IDs of multiple domain controller DCs to implement vehicle identification can prevent attackers from replacing vehicle components through the binding of multiple domain controller DCs. For example, a vehicle identification tag may be used to identify the first component and the third component. The first component may be an upgrade component, or may be a component that manages the upgrade component (for example, the second component).
可选的,授权文件中的车辆身份标识Space_Attr可以包括:这多个域控制器DC的芯片ID,以及,这一个或多个域控制器DC生成的验签公钥。Optionally, the vehicle identity identifier Space_Attr in the authorization file may include: the chip IDs of the multiple domain controller DCs, and the signature verification public keys generated by the one or more domain controller DCs.
优选的,该授权文件中的车辆身份标识Space_Attr可以包括:这多个域控制器DC的芯 片ID,以及,这多个域控制器DC生成的验签公钥。Preferably, the vehicle identity identifier Space_Attr in the authorization file may include: cores of the multiple domain controllers DC. Slice ID, and signature verification public keys generated by these multiple domain controller DCs.
另外,需要注意的是,在该方案二中,车辆发送给车云服务器的资产信息中的车辆身份标识,与车云服务器返回的授权文件中的车辆身份标识可以不同。具体可参见下面例子中对车辆发送的车辆身份标识和车云服务器返回的车辆身份标识的描述。In addition, it should be noted that in the second solution, the vehicle identity in the asset information sent by the vehicle to the car cloud server can be different from the vehicle identity in the authorization file returned by the car cloud server. For details, please refer to the description of the vehicle identity sent by the vehicle and the vehicle identity returned by the car cloud server in the following example.
下面以授权文件的校验由车辆中的第一域控制器和第二域控制器完成为例,来详细介绍车辆身份标识Space_Attr的实现过程。其中,车辆身份标识Space_Attr主要涉及到车辆的两个相关阶段:整车产线阶段和车辆升级阶段。The following takes the verification of the authorization file completed by the first domain controller and the second domain controller in the vehicle as an example to introduce in detail the implementation process of the vehicle identity identifier Space_Attr. Among them, the vehicle identity mark Space_Attr mainly involves two related stages of the vehicle: the vehicle production line stage and the vehicle upgrade stage.
在整车产线阶段,主要包括以下步骤:In the vehicle production line stage, it mainly includes the following steps:
1)首先通过产线装备工具读取第一域控制器和第二域控制器的芯片ID:socid_one和socid_two。1) First, read the chip IDs of the first domain controller and the second domain controller through the production line equipment tool: socid_one and socid_two.
2)触发第一域控制器和第二域控制器在各自的安全系统环境,例如可信执行环境(Trusted Execution Environment,TEE)中生成一对签名-验签密钥对(pk_one,sk_one),(pk_two,sk_two)。其中,pk_one和sk_one分别为第一域控制器生成的签名-验签密钥对中的验签公钥和签名私钥,pk_two和sk_two分别为第二域控制器生成的签名-验签密钥对中的验签公钥和签名私钥。2) Trigger the first domain controller and the second domain controller to generate a pair of signature-verification key pairs (pk_one, sk_one) in their respective security system environments, such as Trusted Execution Environment (TEE), (pk_two,sk_two). Among them, pk_one and sk_one are respectively the signature verification public key and signature private key in the signature-verification key pair generated by the first domain controller, and pk_two and sk_two are respectively the signature-signature verification key generated by the second domain controller. The signature verification public key and signature private key in the pair.
3)产线装备工具将第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的验签公钥绑定在一起上传到车云服务器。示例性地,产线装备工具上传的数据包括:socid_one:socid_two,pk_one:pk_two。其中,该数据不仅指示了第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的验签公钥这四个参数,还指示了这四个参数的绑定关系。当车云服务器获取到这四个参数中的一个或多个参数时,可以根据该绑定关系,查找到与这一个或多个参数相关的这四个参数。3) The production line equipment tool binds the chip IDs of the first domain controller and the second domain controller, as well as the signature verification public keys generated by the first domain controller and the second domain controller, and uploads them to the car cloud server. . For example, the data uploaded by the production line equipment tool includes: socid_one: socid_two, pk_one: pk_two. Among them, the data not only indicates the four parameters of the chip ID of the first domain controller and the second domain controller, and the signature verification public key generated by the first domain controller and the second domain controller, but also indicates these four parameters. The binding relationship of the four parameters. When the car cloud server obtains one or more of the four parameters, it can find the four parameters related to the one or more parameters based on the binding relationship.
在车辆升级阶段,主要包括以下步骤:In the vehicle upgrade stage, it mainly includes the following steps:
1)车辆在发送资产信息时,可以将至少一个域控制器DC的芯片ID(例如第一域控制器的芯片ID,socid_one)作为车辆身份标识,发送给车云服务器。1) When a vehicle sends asset information, it can send the chip ID of at least one domain controller DC (for example, the chip ID of the first domain controller, sociod_one) as the vehicle identity identifier to the car cloud server.
2)车云服务器在获取到资产信息后,可以根据该至少一个域控制器DC的芯片ID,查找到在整车产线阶段接收到的,包含该域控制器的芯片ID的多个域控制器的芯片ID,以及这多个域控制器生成的验签公钥,即第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的验签公钥。2) After obtaining the asset information, the vehicle cloud server can find multiple domain controls containing the chip ID of the domain controller received during the vehicle production line stage based on the chip ID of at least one domain controller DC. The chip ID of the controller, and the signature verification public keys generated by these multiple domain controllers, that is, the chip IDs of the first domain controller and the second domain controller, and the signature verification public keys generated by the first domain controller and the second domain controller. Verification public key.
3)车云服务器将该第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的验签公钥作为车辆身份标识,放入授权文件中,发送给车辆。3) The car cloud server uses the chip IDs of the first domain controller and the second domain controller and the signature verification public keys generated by the first domain controller and the second domain controller as the vehicle identity and puts them into the authorization file. , sent to the vehicle.
4)车辆通过第一域控制器和第二域控制器,校验授权文件中的车辆身份标识。4) The vehicle passes the first domain controller and the second domain controller to verify the vehicle identity in the authorization file.
可以看出,车辆发送的资产信息中的车辆身份标识可以为一个域控制器DC的芯片ID,例如第一域控制器的芯片ID,但车云服务器返回的授权文件中的车辆身份标识为多个域控制器的芯片ID和生成的验签公钥,例如,第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的验签公钥。也就是说,车辆可以仅发送了一个参数,车云服务器便可根据该参数查找到与该参数有关的所有参数,将这所有参数一起返回给车辆。这里,与该参数有关的其他参数可以是指车云服务器存储的与该参数存在绑定关系的所有参数。It can be seen that the vehicle identity in the asset information sent by the vehicle can be the chip ID of a domain controller DC, such as the chip ID of the first domain controller, but the vehicle identity in the authorization file returned by the car cloud server is multiple. The chip ID of a domain controller and the generated signature verification public key, for example, the chip ID of the first domain controller and the second domain controller, and the signature verification public key generated by the first domain controller and the second domain controller. key. In other words, the vehicle can only send one parameter, and the vehicle cloud server can find all parameters related to this parameter based on this parameter, and return all parameters to the vehicle together. Here, other parameters related to the parameter may refer to all parameters stored in the car cloud server that have a binding relationship with the parameter.
下面通过图8详细描述上述车辆升级阶段,步骤4的详细校验过程。The above-mentioned vehicle upgrade stage and the detailed verification process of step 4 will be described in detail below through Figure 8 .
图8为本申请实施例提供的多个域控制器校验授权文件中的车辆身份标识时,域控制器之间的交互流程图。 Figure 8 is a flow chart of interaction between multiple domain controllers when verifying the vehicle identity in the authorization file provided by the embodiment of the present application.
如图8所示,这多个域控制器以第一域控制器与第二域控制器为例,域控制器之间的交互流程如下:As shown in Figure 8, these multiple domain controllers take the first domain controller and the second domain controller as an example. The interaction process between the domain controllers is as follows:
S301.第一域控制器校验授权文件中,第一域控制器的芯片ID与本地第一域控制器的芯片ID是否一致。S301. The first domain controller verifies whether the chip ID of the first domain controller in the authorization file is consistent with the chip ID of the local first domain controller.
授权文件中包括:第一域控制器和第二域控制器的芯片ID,以及,第一域控制器和第二域控制器生成的公钥。The authorization file includes: the chip IDs of the first domain controller and the second domain controller, and the public keys generated by the first domain controller and the second domain controller.
第一域控制器可以先获取本地第一域控制器的芯片ID,然后比较该本地第一域控制器的芯片ID与授权文件中的第一域控制器的芯片ID是否一致。如果一致,则执行步骤S302。The first domain controller may first obtain the chip ID of the local first domain controller, and then compare whether the chip ID of the local first domain controller is consistent with the chip ID of the first domain controller in the authorization file. If they are consistent, step S302 is executed.
S302.第一域控制器将授权文件发送给第二域控制器。S302. The first domain controller sends the authorization file to the second domain controller.
S303.第二域控制器校验授权文件中,第二域控制器的芯片ID与本地第二域控制器的芯片ID是否一致。S303. The second domain controller verifies whether the chip ID of the second domain controller in the authorization file is consistent with the chip ID of the local second domain controller.
第二域控制器可以先获取本地第二域控制器的芯片ID,然后比较该本地第二域控制器的芯片ID与授权文件中指示的第二域控制器的芯片ID是否一致。如果一致,则执行步骤S304。The second domain controller may first obtain the chip ID of the local second domain controller, and then compare whether the chip ID of the local second domain controller is consistent with the chip ID of the second domain controller indicated in the authorization file. If they are consistent, step S304 is executed.
S304.第二域控制器用签名私钥计算授权文件的签名。S304. The second domain controller uses the signature private key to calculate the signature of the authorization file.
该签名私钥为上述整车产线阶段,第二域控制器在安全系统环境下生成的签名-验签密钥对中的签名私钥sk_two。The signature private key is the signature private key sk_two in the signature-verification key pair generated by the second domain controller in a secure system environment during the vehicle production line stage.
第二域控制器用签名私钥对授权文件中的参数进行签名,得到该授权文件的签名。The second domain controller uses the signature private key to sign the parameters in the authorization file to obtain the signature of the authorization file.
S305.第二域控制器将授权文件的签名发送给第一域控制器。S305. The second domain controller sends the signature of the authorization file to the first domain controller.
S306.第一域控制器用授权文件中的第二域控制器的验签公钥校验授权文件的签名。S306. The first domain controller verifies the signature of the authorization file using the signature verification public key of the second domain controller in the authorization file.
该验证公钥为上述整车产线阶段,第二域控制器在安全系统环境下生成的签名-验签密钥对中的验签公钥pk_two。第一域控制器可以在授权文件中找到该第二域控制器生成的验签公钥。The verification public key is the signature verification public key pk_two in the signature-verification key pair generated by the second domain controller in a secure system environment during the vehicle production line stage. The first domain controller can find the signature verification public key generated by the second domain controller in the authorization file.
第一域控制器校验授权文件的签名,具体为,第一域控制器利用该第二域控制器的验签公钥对授权文件的签名进行校验。The first domain controller verifies the signature of the authorization file. Specifically, the first domain controller verifies the signature of the authorization file using the signature verification public key of the second domain controller.
其中,如果签名校验通过,则授权文件中的车辆身份标识的校验通过,否则,授权文件中的车辆身份标识的校验不通过。If the signature verification passes, the verification of the vehicle identity in the authorization file passes; otherwise, the verification of the vehicle identity in the authorization file fails.
可以看出,当授权文件的校验由多个域控制器DC完成,该车辆身份标识的校验可以为多个域控制器的芯片ID的校验,以及对授权文件的签名的校验。It can be seen that when the verification of the authorization file is completed by multiple domain controllers DC, the verification of the vehicle identity can be verification of the chip IDs of multiple domain controllers and verification of the signature of the authorization file.
需要注意的是,上述车辆身份标识中使用的第二域控制器的验签公钥,是为了进一步保证第二域控制器向第一域控制器发送给的信息的可信程度。如果域控制器之前的数据传输过程足够安全,则车辆身份标识中可以不涉及公钥。It should be noted that the signature verification public key of the second domain controller used in the above vehicle identification is to further ensure the credibility of the information sent by the second domain controller to the first domain controller. If the data transmission process before the domain controller is sufficiently secure, the public key may not be involved in the vehicle identification.
可以理解的是,当车辆身份标识不包括公钥时,在整车产线阶段,产线装备工具可以仅读取和上传芯片ID,在车辆升级阶段,也可以不涉及利用该公钥,计算授权文件的签名以及利用该签名校验车辆身份标识的过程。It can be understood that when the vehicle identity does not include a public key, during the vehicle production line stage, the production line equipment tool can only read and upload the chip ID. During the vehicle upgrade stage, it does not involve using the public key to calculate The signature of the authorization document and the process of using that signature to verify the vehicle's identity.
另外,需要注意的是,上述步骤S301-S306仅描述了车辆身份标识所涉及的校验过程,但在实际校验过程中,域控制器除了校验车辆身份标识外,还会校验防重放参数,完整性信 息等等,例如,在步骤S301中,第一域控制器除了校验芯片ID之外,还会校验授权文件的签名、完整性信息以及防重放参数等等,在所有校验都通过后,才会执行步骤S302,将授权文件发送给第二域控制器,另外,在步骤S302中,第二域控制器除了校验芯片ID外,还会校验授权文件的签名等等,在所有校验都通过后,才会执行步骤S304。具体关于授权文件的校验过程可以参见前述步骤S107-S108的相关内容,这里不再赘述。In addition, it should be noted that the above steps S301-S306 only describe the verification process involved in the vehicle identity. However, in the actual verification process, in addition to verifying the vehicle identity, the domain controller will also verify the anti-replication process. Put the parameters and complete the information Information, etc., for example, in step S301, in addition to verifying the chip ID, the first domain controller will also verify the signature of the authorization file, integrity information, anti-replay parameters, etc., after all verifications pass Only then will step S302 be executed to send the authorization file to the second domain controller. In addition, in step S302, in addition to verifying the chip ID, the second domain controller will also verify the signature of the authorization file, etc. Step S304 will be executed only after all verifications pass. For specific details about the verification process of the authorization file, please refer to the relevant content of the aforementioned steps S107-S108, which will not be described again here.
示例性地,该第一域控制器可以为汽车盒子(Telematics BOX,Tbox),该第二域控制器可以为座舱域控制器(cockpit domaincontroller,CDC),本申请实施例对该第一域控制器和第二域控制器所对应的车辆中的部件不作限制。当第一域控制器为Tbox,第二域控制器为CDC时,表2示例性示出了本申请实施提供的签名的授权文件的另一种可能的结构。For example, the first domain controller may be a Telematics BOX (Tbox), and the second domain controller may be a cockpit domain controller (CDC). This embodiment of the present application controls the first domain. There are no restrictions on the components in the vehicle corresponding to the controller and the second domain controller. When the first domain controller is Tbox and the second domain controller is CDC, Table 2 exemplarily shows another possible structure of the signed authorization file provided by the implementation of this application.
表2
Table 2
从表2可以看出,授权文件中的车辆身份标识Space_Attr具体包括:socid_Tbox:socid_CDC以及pk_Tbox:pk_CDC。其中,socid_Tbox为Tbox的芯片ID,socid_CDC为CDC的芯片ID,pk_Tbox为Tbox生成的公钥,pk_CDC为CDC生成的公钥。socid_Tbox:socid_CDC用于表示Tbox和CDC的芯片ID的绑定关系,pk_Tbox:pk_CDC用于表示Tbox和CDC的公钥的绑定关系。As can be seen from Table 2, the vehicle identity identifier Space_Attr in the authorization file specifically includes: socid_Tbox: socid_CDC and pk_Tbox: pk_CDC. Among them, socid_Tbox is the chip ID of Tbox, socid_CDC is the chip ID of CDC, pk_Tbox is the public key generated by Tbox, and pk_CDC is the public key generated by CDC. socid_Tbox: socid_CDC is used to represent the binding relationship between Tbox and CDC's chip ID, pk_Tbox: pk_CDC is used to represent the binding relationship between Tbox and CDC's public key.
另外,关于授权文件中的Time_Attr、Integrity_Attr、Sig(sk,M)和pk&pk_validity_proof的描述可以参见前述表1的相关内容,这里不再赘述。In addition, for descriptions of Time_Attr, Integrity_Attr, Sig(sk,M) and pk&pk_validity_proof in the authorization file, please refer to the relevant content in the aforementioned Table 1 and will not be repeated here.
可以理解的是,表2所示的签名的授权文件的结构只是示例性举例,不构成对授权文件的限制。另外,上面以两个域控制器为例描述了车辆身份标识Space_Attr的具体实现过程,但是本申请实施例对校验授权文件涉及到的域控制器的数量不做限制,例如,当授权文件的校验由三个域控制器完成时,车辆身份标识Space_Attr可以包括这三个域控制器的芯片ID的绑定关系,以及,这三个域控制器生成的公钥的绑定关系。It can be understood that the structure of the signed authorization file shown in Table 2 is only an illustrative example and does not constitute a limitation on the authorization file. In addition, the specific implementation process of the vehicle identity identifier Space_Attr is described above by taking two domain controllers as an example. However, the embodiment of this application does not limit the number of domain controllers involved in verifying the authorization file. For example, when the authorization file When the verification is completed by three domain controllers, the vehicle identity identifier Space_Attr may include the binding relationship of the chip IDs of the three domain controllers and the binding relationship of the public keys generated by the three domain controllers.
下面详细介绍防重放参数的具体实现过程。The specific implementation process of anti-replay parameters is introduced in detail below.
防重放参数Time_Attr用于唯一标识一次升级。车辆在升级时,可以通过校验该防重放参数Time_Attr,来防止攻击者利用老版本的升级包来升级车辆。The anti-replay parameter Time_Attr is used to uniquely identify an upgrade. When the vehicle is being upgraded, the anti-replay parameter Time_Attr can be verified to prevent attackers from using old version upgrade packages to upgrade the vehicle.
方案一:利用重放保护存储分区(Replay Protected MemoryBlock,RPMB)设置防重放参数Time_AttrSolution 1: Use Replay Protected MemoryBlock (RPMB) to set the anti-replay parameter Time_Attr
RPMB是一个具有安全特性的存储分区,当存在数据写入RPMB时,会校验数据的合法性,只有指定的发送方才能够写入数据,同时在读数据时,也提供了签名机制,保证对方读取到的数据是RPMB的内部数据,而不是攻击者伪造的数据。因此,在RPMB实际应用中,通常用于存储一些有防止非法篡改需求的数据。 RPMB is a storage partition with security features. When data is written to RPMB, the validity of the data will be verified. Only the designated sender can write the data. At the same time, when reading data, a signature mechanism is also provided to ensure that the other party reads it. The data obtained is the internal data of RPMB, not the data forged by the attacker. Therefore, in practical applications, RPMB is usually used to store some data that needs to be prevented from illegal tampering.
在本申请实施例中,可以将该防重放参数Time_Attr存储在域控制器的RPMB中。In this embodiment of the present application, the anti-replay parameter Time_Attr can be stored in the RPMB of the domain controller.
其中,该防重放参数Time_Attr可以有以下两种设计方式:Among them, the anti-replay parameter Time_Attr can be designed in the following two ways:
1)利用随机数来设置防重放参数Time_Attr1) Use random numbers to set the anti-replay parameter Time_Attr
为了避免车辆在升级时,再次根据已升级过的版本进行升级,在车辆升级过程中,车辆和车云服务器可以预定一个“暗号”,在车辆校验防重放参数Time_Attr时,只有“暗号”一致,防重放参数Time_Attr的校验才通过。In order to prevent the vehicle from being upgraded again based on the upgraded version during the vehicle upgrade process, the vehicle and the vehicle cloud server can reserve a "secret code". When the vehicle verifies the anti-replay parameter Time_Attr, only the "secret code" If they are consistent, the verification of the anti-replay parameter Time_Attr will pass.
这时,防重放参数Time_Attr可以是一个随机数nonce,且该随机数为一个仅一次有效的数,该仅一次有效是指车辆在每次升级生成该防重放参数Time_Attr时,该随机数nonce都不同,即每一次生成的防重放参数Time_Attr都唯一代表了一次升级。例如,车辆和车云服务器在某一次升级时约定了一个随机数A,只有在此次升级时,车云服务器向车辆发送的防重放参数Time_Attr为该随机数A时,该防重放参数Time_Attr的校验才通过。At this time, the anti-replay parameter Time_Attr can be a random number nonce, and the random number is a number that is only valid once. The only valid one time means that when the vehicle upgrades and generates the anti-replay parameter Time_Attr, the random number The nonces are different, that is, each generated anti-replay parameter Time_Attr uniquely represents an upgrade. For example, the vehicle and the vehicle cloud server agree on a random number A during a certain upgrade. Only when the anti-replay parameter Time_Attr sent by the vehicle cloud server to the vehicle during this upgrade is the random number A, the anti-replay parameter The verification of Time_Attr is passed.
那么,在前述步骤S103-S114中,关于防重放参数Time_Attr主要涉及到以下实现过程:Then, in the aforementioned steps S103-S114, the anti-replay parameter Time_Attr mainly involves the following implementation process:
a)在车辆向车云服务器发送资产信息之前,车辆可以在安全系统环境,例如TEE环境中,随机生成一个字符串nonce,并将该字符串nonce作为防重放参数Time_Attr写入RPMB中。a) Before the vehicle sends asset information to the vehicle cloud server, the vehicle can randomly generate a string nonce in a secure system environment, such as a TEE environment, and write the string nonce into the RPMB as the anti-replay parameter Time_Attr.
b)在车辆发送资产信息时,车辆将该nonce作为防重放参数Time_Attr随资产信息发送给车云服务器。b) When the vehicle sends asset information, the vehicle sends the nonce as the anti-replay parameter Time_Attr along with the asset information to the vehicle cloud server.
c)在车云服务器获取到该nonce后,将该nonce作为授权文件中的防重放参数Time_Attr,发送给车辆。c) After the vehicle cloud server obtains the nonce, it uses the nonce as the anti-replay parameter Time_Attr in the authorization file and sends it to the vehicle.
d)在车辆校验授权文件的过程中,车辆在获取到该授权文件中的防重放参数Time_Attr后,从本地的RPMB中读取防重放参数Time_Attr,并判断该授权文件中的防重放参数Time_Attr与本地的防重放参数Time_Attr是否一致。如果该授权文件中的防重放参数Time_Attr与本地的防重放参数Time_Attr一致,则防重放参数的校验通过,否则,防重放参数的校验不通过。d) During the process of the vehicle verifying the authorization file, after obtaining the anti-replay parameter Time_Attr in the authorization file, the vehicle reads the anti-replay parameter Time_Attr from the local RPMB and determines the anti-replay parameter Time_Attr in the authorization file. Check whether the replay parameter Time_Attr is consistent with the local anti-replay parameter Time_Attr. If the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter Time_Attr, the anti-replay parameter verification passes; otherwise, the anti-replay parameter verification fails.
具体关于步骤S103-S114的详细描述可以参见前述图4的相关内容,这里不再赘述。For a detailed description of steps S103-S114, please refer to the relevant content of Figure 4, and will not be described again here.
可以理解的是,上面仅详细描述了远端升级场景中,防重放参数Time_Attr的具体实现过程,在近端升级场景中,防重放参数Time_Attr的具体实现过程与远端升级场景类似,不同的是,在近端升级场景中,车辆和车云服务器通过诊断终端中转资产信息、签名的升级包和授权文件,而远端升级场景中,车辆和车云服务器直接交互,不涉及诊断终端的中转。具体关于近端升级场景中,防重放参数Time_Attr的具体实现过程可以参考前述远端升级场景中,防重放参数Time_Attr的具体实现过程以及前述步骤S203-S217,这里不再展开。It can be understood that the above only describes in detail the specific implementation process of the anti-replay parameter Time_Attr in the remote upgrade scenario. In the near-end upgrade scenario, the specific implementation process of the anti-replay parameter Time_Attr is similar to the remote upgrade scenario, but different What is interesting is that in the near-end upgrade scenario, the vehicle and the vehicle cloud server transfer asset information, signed upgrade packages, and authorization files through the diagnostic terminal, while in the remote upgrade scenario, the vehicle and the vehicle cloud server interact directly, without involving the diagnostic terminal. transit. Regarding the specific implementation process of the anti-replay parameter Time_Attr in the near-end upgrade scenario, please refer to the specific implementation process of the anti-replay parameter Time_Attr in the aforementioned remote upgrade scenario and the aforementioned steps S203-S217, which will not be discussed here.
另外,需要注意的是,上述实现过程中,防重放参数Time_Attr由车辆来生成,在本申请其他实施例中,该防重放参数Time_Attr也可以由车云服务器生成,并发送给车辆,本申请实施例对利用随机数来设置防重放参数Time_Attr时,生成该防重放参数Time_Attr的设备不作限制。In addition, it should be noted that in the above implementation process, the anti-replay parameter Time_Attr is generated by the vehicle. In other embodiments of the present application, the anti-replay parameter Time_Attr can also be generated by the vehicle cloud server and sent to the vehicle. The application embodiment does not limit the device that generates the anti-replay parameter Time_Attr when using random numbers to set the anti-replay parameter Time_Attr.
2)利用计数器来设置防重放参数Time_Attr2) Use the counter to set the anti-replay parameter Time_Attr
为了避免车辆在升级时,再次根据已升级过的版本进行升级,在车辆升级过程中,车辆与车云服务器可以约定一个计数器,该计数器的数值可以根据升级包的版本进行单向递增,车辆与车云服务器可以将该计数器的数值作为防重放参数,在车辆校验防重放参数的过程中,如果车辆接收到的防重放参数与本地的防重放参数不一致,则说明车云服务器发送的升级包 的版本与车辆升级所需的升级包的版本不符合。In order to prevent the vehicle from being upgraded again based on the upgraded version during the vehicle upgrade process, the vehicle and the vehicle cloud server can agree on a counter. The value of the counter can be incremented in one direction according to the version of the upgrade package. The vehicle and the vehicle cloud server can The car cloud server can use the value of this counter as an anti-replay parameter. During the process of the vehicle verifying the anti-replay parameters, if the anti-replay parameters received by the vehicle are inconsistent with the local anti-replay parameters, it means that the car cloud server Upgrade package sent The version of does not match the version of the upgrade package required for vehicle upgrade.
这时,防重放参数Time_Attr是一个单向递增的数值,示例性地,每次递增的数值为1。例如,当车辆进行第5次升级时,该防重放参数Time_Attr可以为5,当车辆进行第6次升级时,该防重放参数Time_Attr可以为6。其中,在车辆进行第6次升级时,如果车辆接收到的防重放参数Time_Attr为5,则说明车云服务器发送给的升级包可能是车辆在进行第5次升级时,发送的升级包,该防重放参数Time_Attr的校验不通过。At this time, the anti-replay parameter Time_Attr is a value that increases in one direction. For example, the value that increases each time is 1. For example, when the vehicle is upgraded for the fifth time, the anti-replay parameter Time_Attr may be 5, and when the vehicle is upgraded for the sixth time, the anti-replay parameter Time_Attr may be 6. Among them, when the vehicle is upgraded for the sixth time, if the anti-replay parameter Time_Attr received by the vehicle is 5, it means that the upgrade package sent by the car cloud server may be the upgrade package sent by the vehicle when it is upgraded for the fifth time. The verification of the anti-replay parameter Time_Attr failed.
该计数器的数值的更改可以存在以下两种情况:The value of this counter can change in the following two situations:
情况1:车辆每升级一个版本更改一次计数器的数值Situation 1: The value of the counter changes every time the vehicle is upgraded to a version
这种情况下,车辆每升级一次,计数器的数值就会加1。这样,车辆每升级一个版本的升级包都会对应一个防重放参数,且不同版本的防重放参数不一致。例如,假设车辆升级V7版本的升级包时,防重放参数为7,如果车云服务器发送的防重放参数为6,则车云服务器发送的升级包可能是V6版本的升级包,即为老版本的升级包,则车辆判断防重放参数的校验不通过,车辆取消升级。In this case, every time the vehicle is upgraded, the counter value will be increased by 1. In this way, each version of the upgrade package for the vehicle will correspond to an anti-replay parameter, and the anti-replay parameters of different versions are inconsistent. For example, assume that when the vehicle upgrades the V7 version of the upgrade package, the anti-replay parameter is 7. If the anti-replay parameter sent by the car cloud server is 6, the upgrade package sent by the car cloud server may be the V6 version upgrade package, which is For an old version of the upgrade package, the vehicle determines that the anti-replay parameter verification fails, and the vehicle cancels the upgrade.
这样,可以避免车辆用老版本的升级包升级车辆,保证车辆每次升级都与之前的升级不同。In this way, the vehicle can be prevented from being upgraded with an old version of the upgrade package, ensuring that each vehicle upgrade is different from the previous upgrade.
示例性地,下面结合图9描述情况1中,利用计数器来保障防重放的原理。By way of example, the principle of using a counter to prevent replay in case 1 is described below with reference to FIG. 9 .
图9为本申请实施例提供的一种车辆升级的时序图。Figure 9 is a sequence diagram of a vehicle upgrade provided by an embodiment of the present application.
如图9所示,车辆在时间点T1、T2、T3分别使用升级包V1、V2、V3成功进行了一次升级,每一次升级,计数器的数值都会加1,假设T1时刻之前防重放参数为0,那么,T1、T2、T3车辆能够成功进行升级,是因为车辆在T1时刻接收到的授权文件1、T2时刻接收到的授权文件2、T3时刻接收到的授权文件3中的防重放参数分别为0、1、2。As shown in Figure 9, the vehicle was successfully upgraded using upgrade packages V1, V2, and V3 at time points T1, T2, and T3 respectively. For each upgrade, the counter value will be increased by 1. Assume that the anti-replay parameters before time T1 are 0, then, T1, T2, and T3 vehicles can be successfully upgraded because of the anti-replay in the authorization file 1 received by the vehicle at T1, the authorization file 2 received at T2, and the authorization file 3 received at T3. The parameters are 0, 1, and 2 respectively.
以此类推,在T4时刻再次进行升级时,此时车辆本地的防重放参数为3。可以看出,如果T4时刻再次接收到T1时刻发送过的授权文件1和升级包V1时,由于授权文件1中的防重放参数为0,与本地的防重放参数不一致,所以车辆不会使用升级包V1进行升级,避免了车辆再次使用老版本升级包进行升级,而如果T4时刻,车辆接收到授权文件4中的防重放参数为3,则车辆可以使用该升级包V4进行升级。By analogy, when the upgrade is performed again at T4, the vehicle's local anti-replay parameter is 3. It can be seen that if T4 receives the authorization file 1 and upgrade package V1 sent at T1 again, since the anti-replay parameter in authorization file 1 is 0, which is inconsistent with the local anti-replay parameter, the vehicle will not Upgrading with upgrade package V1 avoids the vehicle being upgraded with the old version upgrade package again. If at T4, the vehicle receives the anti-replay parameter in authorization file 4 as 3, the vehicle can use the upgrade package V4 to upgrade.
可以看出,通过每次升级更改一次计数器的数值,可以避免车辆在每次升级时,使用老版本的升级包进行升级。It can be seen that by changing the value of the counter for each upgrade, it is possible to avoid using the old version of the upgrade package every time the vehicle is upgraded.
情况2:车辆升级过一个有漏洞的版本后更改一次计数器的数值Scenario 2: The vehicle changes the value of the counter after being upgraded to a vulnerable version
这种情况下,车辆只有在升级到有漏洞的版本时,计数器的数值才会加1。这样,虽然车辆每升级一个版本的升级包都会对应一个防重放参数,但是不同版本的防重放参数可能一致,只有在车辆某一次升级过有漏洞的版本时,该防重放参数才会发生更改。In this case, the counter will only be incremented by one when the vehicle is upgraded to a vulnerable version. In this way, although each version of the upgrade package of the vehicle will correspond to an anti-replay parameter, the anti-replay parameters of different versions may be the same. Only when the vehicle has been upgraded to a vulnerable version, the anti-replay parameters will be changed. Changes occur.
其中,车辆更改计数器的数值可以由车云服务器触发。具体的,当车云服务器检测到车辆升级过一个有漏洞的版本,向车辆发送调整指令,车辆可以根据该调整指令触发更改技计数器的数值,例如,计数器的数值加1。Among them, the value of the vehicle change counter can be triggered by the vehicle cloud server. Specifically, when the car cloud server detects that the vehicle has been upgraded to a vulnerable version, it sends an adjustment instruction to the vehicle. The vehicle can trigger a change in the value of the technical counter based on the adjustment instruction. For example, the value of the counter is increased by 1.
这样,车辆只有在升级过有漏洞的版本时才更改计数器的数值,可以降低计数器的数值的更改频率。In this way, the vehicle will only change the value of the counter when it has been upgraded to a vulnerable version, which can reduce the frequency of changing the value of the counter.
示例性地,下面结合图10来描述情况2中,利用计数器来保障防重放的原理。For example, the principle of using counters to prevent replay in case 2 is described below with reference to FIG. 10 .
图10为本申请实施例提供的另一种车辆升级的时序图。 Figure 10 is a sequence diagram of another vehicle upgrade provided by an embodiment of the present application.
如图10所示,车辆在时间点T1、T2、T3分别使用升级包V1、V2、V3成功进行了一次升级,且每次升级的授权文件中的防重放参数都为0。当T4时刻发现车辆在T2时刻升级的升级包V2存在安全漏洞时,车辆会将计数器的数值加1。As shown in Figure 10, the vehicle was successfully upgraded using upgrade packages V1, V2, and V3 at time points T1, T2, and T3 respectively, and the anti-replay parameter in the authorization file for each upgrade was 0. When it is discovered at T4 that there is a security vulnerability in the upgrade package V2 upgraded by the vehicle at T2, the vehicle will increase the counter value by 1.
也就是说,在T5时刻再次进行升级时,此时车辆本地的防重放参数为1。可以看出,如果T5时刻再次接收到T2时刻发送过的授权文件2和升级包V2时,由于授权文件2中的防重放参数为0,与本地的防重放参数不一致,所以车辆不会使用升级包V2进行升级,避免了车辆再次使用老版本升级包进行升级,而如果T5时刻,车辆接收到授权文件4中的防重放参数为1,则车辆可以使用该升级包V4进行升级。That is to say, when the upgrade is performed again at time T5, the local anti-replay parameter of the vehicle is 1 at this time. It can be seen that if the authorization file 2 and upgrade package V2 sent at T2 are received again at time T5, since the anti-replay parameter in authorization file 2 is 0, which is inconsistent with the local anti-replay parameter, the vehicle will not Upgrading using the upgrade package V2 avoids the vehicle being upgraded with the old version upgrade package again. If at T5, the vehicle receives the anti-replay parameter in authorization file 4 as 1, the vehicle can use the upgrade package V4 to upgrade.
可以看出,通过在发现车辆升级过存在漏洞的升级包后更改计数器的数值,可以在发现有漏洞的版本后,避免车辆使用老版本的升级包进行升级。It can be seen that by changing the value of the counter after discovering that the vehicle has been upgraded with a vulnerable upgrade package, it can prevent the vehicle from being upgraded with an old version of the upgrade package after a vulnerable version is discovered.
类似于前述利用随机数来设置防重放参数Time_Attr,在利用计数器来设置防重放参数Time_Attr时,车辆可以在向车云服务器发送资产信息之前,确定该计数器的数值,并将该数值作为防重放参数Time_Attr写入RPMB中,之后将该数值作为防重放参数Time_Attr随资产信息发送给车云服务器,再接收到车云服务器发送的授权文件,校验授权文件中的防重放参数Time_Attr。具体关于利用计数器来设置防重放参数Time_Attr时,防重放参数Time_Attr的实现过程可以参考前述利用计数器来设置防重放参数Time_Attr时,防重放参数Time_Attr的实现过程,以及前述步骤S103-S114和步骤S203-S217的相关内容,这里不再展开。Similar to the aforementioned use of random numbers to set the anti-replay parameter Time_Attr, when using a counter to set the anti-replay parameter Time_Attr, the vehicle can determine the value of the counter before sending asset information to the vehicle cloud server, and use this value as the anti-replay parameter. The replay parameter Time_Attr is written into RPMB, and then this value is used as the anti-replay parameter Time_Attr and is sent to the Che Cloud server along with the asset information. Then the authorization file sent by the Che Cloud server is received and the anti-replay parameter Time_Attr in the authorization file is verified. . Specifically regarding the implementation process of the anti-replay parameter Time_Attr when using a counter to set the anti-replay parameter Time_Attr, please refer to the implementation process of the anti-replay parameter Time_Attr when using the counter to set the anti-replay parameter Time_Attr, as well as the aforementioned steps S103-S114. The related content of steps S203-S217 will not be expanded here.
需要注意的是,当利用计数器来设置防重放参数Time_Attr时,车辆也可以不用向车云服务器发送防重放参数Time_Attr。也就是说,在步骤S103以及步骤S203中提及的资产信息中也可以不包括防重放参数Time_Attr。这是由于如果车辆和车云服务器都约定使用计数器来设置防重放参数Time_Attr,即在何种情况下更改计数器的值,以及计数器的初始值,则车辆和车云服务器可以根据车辆的升级情况,自行在本地确定该防重放参数Time_Attr。例如车辆和车云服务器约定每升级一个版本时更改一次计数器的数值,并且初始值为0,则车辆第三次升级时,车辆和车云服务器可以自行确定当前的防重放参数Time_Attr为3。It should be noted that when using a counter to set the anti-replay parameter Time_Attr, the vehicle does not need to send the anti-replay parameter Time_Attr to the car cloud server. That is to say, the asset information mentioned in step S103 and step S203 may not include the anti-replay parameter Time_Attr. This is because if the vehicle and the car cloud server both agree to use a counter to set the anti-replay parameter Time_Attr, that is, under what circumstances the value of the counter is changed, and the initial value of the counter, then the vehicle and the car cloud server can use the counter to set the anti-replay parameter Time_Attr. , determine the anti-replay parameter Time_Attr locally. For example, the vehicle and the vehicle cloud server agree to change the value of the counter every time a version is upgraded, and the initial value is 0. Then when the vehicle is upgraded for the third time, the vehicle and the vehicle cloud server can determine the current anti-replay parameter Time_Attr to be 3.
另外,由于车辆中某些域控制器DC不具备RPMB,因此当授权文件的校验由多个域控制器DC完成时,该域控制器可以利用其它具备域控制器DC中的RPMB开设置防重放参数Time_Attr,这样,克服了某些域控制器DC不具备RPMB,无法使用RPMB来设置防重放参数Time_Attr的缺陷。In addition, since some domain controller DCs in the vehicle do not have RPMB, when the verification of the authorization file is completed by multiple domain controller DCs, the domain controller can use the RPMB settings in other domain controller DCs to set up defenses. The replay parameter Time_Attr overcomes the defect that some domain controller DCs do not have RPMB and cannot use RPMB to set the anti-replay parameter Time_Attr.
并且,需要注意的是,防重放参数Time_Attr由生成该防重放参数Time_Attr的域控制器校验。例如,第一域控制器利用第二域控制器来设置第一域控制器所需的防重放参数Time_Attr,即第一域控制器获取第二域控制器设置的防重放参数Time_Attr,第一域控制器设置资产信息中的其他参数,例如车辆身份标识后,并将该防重放参数Time_Attr随资产信息发送给车云服务器,之后,在校验授权文件时,第一域控制器完成除防重放参数Time_Attr之外的其他参数的校验,之后,再将授权文件发送给第二域控制,由第二域控制器校验该防重放参数Time_Attr。Furthermore, it should be noted that the anti-replay parameter Time_Attr is verified by the domain controller that generates the anti-replay parameter Time_Attr. For example, the first domain controller uses the second domain controller to set the anti-replay parameter Time_Attr required by the first domain controller, that is, the first domain controller obtains the anti-replay parameter Time_Attr set by the second domain controller. The first domain controller sets other parameters in the asset information, such as the vehicle identification, and sends the anti-replay parameter Time_Attr along with the asset information to the car cloud server. Afterwards, when verifying the authorization file, the first domain controller completes After verifying other parameters except the anti-replay parameter Time_Attr, the authorization file is sent to the second domain controller, and the second domain controller verifies the anti-replay parameter Time_Attr.
方案二:利用非易变计数器(Non-Volatile Counter,NV-Cnt)设置防重放参数Time_AttrSolution 2: Use Non-Volatile Counter (NV-Cnt) to set the anti-replay parameter Time_Attr
由于NV-Cnt可以生成单方向依次递增的数值,且该数值的更改由熔断机制保证,其数值大小不能够随意篡改。因此可以在NV-Cnt中存放计数器的数值,将该数值作为防重放参数Time_Attr。这样可以保证防重放参数的不可篡改性,保障防重放参数的校验过程的可信度。其中,熔断机制是通过熔断芯片中的熔丝位,一次性且不可逆的更改熔丝位的状态,从而保 证数据存储后的不可篡改。具体关于利用计数器来设置防重放参数Time_Attr的描述可以参考前述方案一利用设置防重放参数Time_Attr的相关内容,这里不再展开。Since NV-Cnt can generate values that increase sequentially in one direction, and the change of this value is guaranteed by the fuse mechanism, its value cannot be tampered with at will. Therefore, the counter value can be stored in NV-Cnt and used as the anti-replay parameter Time_Attr. This can ensure that the anti-replay parameters cannot be tampered with and ensure the credibility of the verification process of the anti-replay parameters. Among them, the fusing mechanism is to blow the fuse bit in the chip to change the state of the fuse bit one-time and irreversibly, thereby protecting the The data cannot be tampered with after being stored. For a specific description of using a counter to set the anti-replay parameter Time_Attr, please refer to the above-mentioned solution 1 for setting the anti-replay parameter Time_Attr, which will not be elaborated here.
示例性地,可以预留车辆芯片的OTP中的固定位域,例如32bit,作为设置防重放参数Time_Attr的NV-Cnt,示例性地,NV-Cnt的初始数值为0。本申请实施例对NV-Cnt的初始数值不做限制。For example, a fixed bit field, such as 32 bits, in the OTP of the vehicle chip can be reserved as the NV-Cnt for setting the anti-replay parameter Time_Attr. For example, the initial value of NV-Cnt is 0. The embodiment of the present application does not limit the initial value of NV-Cnt.
下面详细描述利用NV-Cnt设置防重放参数Time_Attr的具体实现过程。The specific implementation process of using NV-Cnt to set the anti-replay parameter Time_Attr is described in detail below.
1)车云服务器和车辆约定NV-Cnt的初始值为0,并将该NV-Cnt的数值作为防重放参数Time_Attr。1) The car cloud server and the vehicle agree that the initial value of NV-Cnt is 0, and the value of this NV-Cnt is used as the anti-replay parameter Time_Attr.
2)当车云服务器检测到本车辆或其他车辆升级的升级包中存在有安全漏洞的版本,则车云服务器对车辆发送调整指令,该调整指令用于更改NV-Cnt的数值,例如使NV-Cnt的数值加1。2) When the car cloud server detects that there is a version with security vulnerabilities in the upgrade package of this vehicle or other vehicles, the car cloud server sends an adjustment instruction to the vehicle. The adjustment instruction is used to change the value of NV-Cnt, for example, to make NV -The value of Cnt is increased by 1.
3)车辆在获取到该调整指令后,更改NV-Cnt的数值,例如由3更改为4。3) After the vehicle obtains the adjustment instruction, it changes the value of NV-Cnt, for example, from 3 to 4.
4)在车辆发送资产信息时,车辆将该更改后的NV-Cnt的数值作为防重放参数Time_Attr,随资产信息发送给车云服务器。4) When the vehicle sends asset information, the vehicle uses the changed value of NV-Cnt as the anti-replay parameter Time_Attr and sends it to the vehicle cloud server along with the asset information.
5)车云服务器再将该NV-Cnt的数值作为防重放参数Time_Attr,随授权文件发送给车辆。5) The car cloud server then uses the value of the NV-Cnt as the anti-replay parameter Time_Attr and sends it to the vehicle along with the authorization file.
6)车辆在获取到该授权文件中的防重放参数Time_Attr后,从本地的NV-Cnt中读取防重放参数Time_Attr,并判断该授权文件中的防重放参数Time_Attr与本地的防重放参数Time_Attr是否一致。如果该授权文件中的防重放参数Time_Attr与本地的防重放参数Time_Attr一致,则防重放参数的校验通过,否则,防重放参数的校验不通过。6) After obtaining the anti-replay parameter Time_Attr in the authorization file, the vehicle reads the anti-replay parameter Time_Attr from the local NV-Cnt, and determines whether the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter. Check whether the parameter Time_Attr is consistent. If the anti-replay parameter Time_Attr in the authorization file is consistent with the local anti-replay parameter Time_Attr, the anti-replay parameter verification passes; otherwise, the anti-replay parameter verification fails.
需要注意的是,利用NV-Cnt来设置防重放参数Time_Attr时,同样存在上述方案一中计数器数值更改的两种情况:车辆每升级一个版本更改一次计数器的数值,以及,车辆升级过一个有漏洞的版本后更改一次计数器的数值。其中,由于NV-Cnt的数值更改由硬件机制保障,其数值的更改不可逆,而V-Cnt的位数是固定的,因此NV-Cnt的数值更改次数是有限的。例如,32bit的NV-Cnt支持最多熔断32次,即NV-Cnt最多仅能支持更改32次数值。可以看出,在车辆升级过一个有漏洞的版本后更改一次计数器的数值,可以减少NV-Cnt的数值的更改次数,能够尽可能的延长芯片的使用时长,避免车辆的频繁换件。It should be noted that when using NV-Cnt to set the anti-replay parameter Time_Attr, there are also two situations where the counter value changes in the above solution one: the counter value changes every time the vehicle upgrades to a version, and the vehicle upgrades to a new version. The value of the counter is changed once after the version of the vulnerability is released. Among them, since the numerical change of NV-Cnt is guaranteed by the hardware mechanism, the numerical change is irreversible, and the number of digits of V-Cnt is fixed, so the number of numerical changes of NV-Cnt is limited. For example, 32-bit NV-Cnt supports up to 32 fusing times, that is, NV-Cnt can only support changing values up to 32 times. It can be seen that changing the counter value after the vehicle has been upgraded to a vulnerable version can reduce the number of changes to the NV-Cnt value, extend the use time of the chip as much as possible, and avoid frequent replacement of vehicle parts.
另外,安全启动场景下的授权文件的校验,相比于方案一,利用方案二来设置防重放参数Time_Attr,能够提高车辆的检测效率。这是由于部件的安全启动为启动链中各软件的逐级校验过程,而RPMB在启动链的后期才能够校验到,因此无法保护启动链的前端的安全,校验效率较低,通过NV-Cnt设置的防重放参数Time_Attr,可以保护启动链的前端的安全,提高校验效率。In addition, when verifying the authorization file in the secure boot scenario, compared to the first solution, using the second solution to set the anti-replay parameter Time_Attr can improve the vehicle detection efficiency. This is because the secure startup of components is a step-by-step verification process for each software in the startup chain, and RPMB can only be verified at the later stage of the startup chain. Therefore, it cannot protect the security of the front end of the startup chain, and the verification efficiency is low. The anti-replay parameter Time_Attr set by NV-Cnt can protect the security of the front end of the startup chain and improve verification efficiency.
方案三:结合RPMB和NV-Cnt设置防重放参数Time_AttrSolution 3: Combine RPMB and NV-Cnt to set the anti-replay parameter Time_Attr
当结合RPMB和NV-Cnt设置防重放参数Time_Attr时,可以通过RPMB设置一个随机数,通过NV-Cnt设置计数器,并将该随机数和计数器的数值作为防重放参数Time_Attr。When setting the anti-replay parameter Time_Attr in combination with RPMB and NV-Cnt, you can set a random number through RPMB, set the counter through NV-Cnt, and use the random number and the value of the counter as the anti-replay parameter Time_Attr.
那么,防重放参数Time_Attr可以包括:域控制器DC的RPMB中存放的随机数nonce,以及,该域控制器DC中的NV-Cnt的数值。Then, the anti-replay parameter Time_Attr can include: the random number nonce stored in the RPMB of the domain controller DC, and the value of NV-Cnt in the domain controller DC.
示例性地,以域控制器DC为CDC为例,表3示例性示出了本申请实施例提供的签名的授权文件的另一种可能的结构。Taking the domain controller DC as CDC as an example, Table 3 illustrates another possible structure of the signed authorization file provided by the embodiment of the present application.
表3

table 3

从表3可以看出,授权文件中的防重放参数Time_Attr具体包括:NV-Cnt_CDC、nonce_CDC。其中,NV-Cnt_CDC为CDC的NV-Cnt中的数值,nonce_CDC为CDC生成的随机数。As can be seen from Table 3, the anti-replay parameter Time_Attr in the authorization file specifically includes: NV-Cnt_CDC, nonce_CDC. Among them, NV-Cnt_CDC is the value in NV-Cnt of CDC, and nonce_CDC is the random number generated by CDC.
另外,关于授权文件中的Space_Attr、Integrity_Attr、Sig(sk,M)和pk&pk_validity_proof的描述可以参见前述表1的相关内容,这里不再赘述。In addition, for descriptions of Space_Attr, Integrity_Attr, Sig(sk,M) and pk&pk_validity_proof in the authorization file, please refer to the relevant content in the aforementioned Table 1 and will not be repeated here.
可以理解的是,表3所示的签名的授权文件的结构只是示例性举例,不构成对授权文件的限制。It can be understood that the structure of the signed authorization file shown in Table 3 is only an illustrative example and does not constitute a limitation on the authorization file.
另外,需要注意的是,当升级的部件为电子控制单元ECU时,由于电子控制单元ECU对应的授权文件的校验可以由其连接的域控制器DC来进行校验,那么防重放参数的设置可以由该域控制器DC来完成。也就是说,电子控制单元ECU对应的授权文件中的防重放参数,由其连接的域控制器DC生成得到。In addition, it should be noted that when the upgraded component is an electronic control unit ECU, since the verification of the authorization file corresponding to the electronic control unit ECU can be verified by its connected domain controller DC, then the anti-replay parameters The setup can be done by this domain controller DC. In other words, the anti-replay parameters in the authorization file corresponding to the electronic control unit ECU are generated by the domain controller DC to which it is connected.
总的来说,防重放参数为车云服务器与车辆约定的用于标识车辆本地的升级的参数,其中,该防重放参数可以随着车辆每次升级而更新,那么这是防重放参数仅用于标识的一次升级,防重放参数还可以不定期更新,这种情况下,防重放参数可以在预设情况下更新,例如车云服务器发现了已经发送的老版本升级包存在漏洞时,通知车辆跟随车云服务器同步更新防重放参数。In general, the anti-replay parameters are parameters agreed between the car cloud server and the vehicle to identify the local upgrade of the vehicle. The anti-replay parameters can be updated with each upgrade of the vehicle, so this is the anti-replay parameter. The parameters are only used for one upgrade of the logo. The anti-replay parameters can also be updated from time to time. In this case, the anti-replay parameters can be updated under preset circumstances. For example, the car cloud server discovers the existence of an old version upgrade package that has been sent. When a vulnerability occurs, the vehicle is notified to follow the vehicle cloud server and update the anti-replay parameters simultaneously.
下面详细介绍完整性信息的具体实现过程。The specific implementation process of integrity information is introduced in detail below.
完整性信息Integrity_Attr用于唯一标识此次升级,车云服务器发送的升级包。The integrity information Integrity_Attr is used to uniquely identify this upgrade and the upgrade package sent by the Che Cloud server.
在车辆升级阶段,该授权文件中完整性信息Integrity_Attr可用于唯一标识车云服务器发送的升级包。也就是说,当车辆接收到升级包和该升级包的授权文件时,车辆可以通过校验该完整性信息Integrity_Attr来确定该授权文件,是否为车辆接收到的升级包的授权文件,或者,换句话说,确定车辆接收到的升级包是否完整或被篡改。这样,可以避免攻击者伪造升级包,用假冒的升级包来进行车辆升级,保证车辆升级的安全性。During the vehicle upgrade phase, the integrity information Integrity_Attr in the authorization file can be used to uniquely identify the upgrade package sent by the vehicle cloud server. That is to say, when the vehicle receives the upgrade package and the authorization file of the upgrade package, the vehicle can determine whether the authorization file is the authorization file of the upgrade package received by the vehicle by verifying the integrity information Integrity_Attr, or replace it with In other words, determine whether the upgrade package received by the vehicle is complete or has been tampered with. In this way, attackers can be prevented from forging upgrade packages and using fake upgrade packages to upgrade vehicles, ensuring the safety of vehicle upgrades.
在安全启动阶段,该授权文件中的完整性信息Integrity_Attr可用于唯一标识车辆按照车云服务器发送的升级包升级后,车辆升级后的软件数据。换句话说,当车辆接收到升级包和该升级包的授权文件,并按照该升级包升级后,车辆可以在安全启动时,通过校验该完整性信息Integrity_Attr,来确定车辆的数据是否为根据该升级包升级后的软件数据。这样,可以防止车辆升级后,攻击者直接拆机,将升级包非法导入车辆部件,更改车辆部件的软件数据。During the secure startup phase, the integrity information Integrity_Attr in the authorization file can be used to uniquely identify the vehicle's upgraded software data after it is upgraded according to the upgrade package sent by the vehicle cloud server. In other words, when the vehicle receives the upgrade package and the authorization file of the upgrade package, and upgrades according to the upgrade package, the vehicle can determine whether the vehicle's data is based on the integrity information Integrity_Attr during safe startup. The software data after the upgrade package is upgraded. In this way, it can be prevented that after the vehicle is upgraded, the attacker can directly disassemble the vehicle, illegally import the upgrade package into the vehicle components, and change the software data of the vehicle components.
由于车辆的升级方式不同时,完整性信息Integrity_Attr包含的内容不同。下面按照车辆不同的升级方式,来介绍完整性信息Integrity_Attr。Because the vehicle upgrade methods are different, the integrity information Integrity_Attr contains different contents. The integrity information Integrity_Attr is introduced below according to different vehicle upgrade methods.
方案一:全量升级Option 1: Full upgrade
全量升级是指车辆升级时,通过下载完整的软件数据,直接将下载完成的软件数据搬运到软件运行的位置,来实现车辆的升级。 Full upgrade means that when a vehicle is upgraded, the vehicle is upgraded by downloading the complete software data and directly moving the downloaded software data to the location where the software runs.
也就是说,全量升级时,车云服务器发送的升级包中包含部件升级后的完整的数据。In other words, during a full upgrade, the upgrade package sent by the car cloud server contains the complete data after the component upgrade.
这种情况下,完整性信息Integrity_Attr可以包括升级包的哈希值Hash[],该哈希值为对该升级包使用哈希算法计算得到哈希值。In this case, the integrity information Integrity_Attr may include the hash value Hash[] of the upgrade package, which is a hash value calculated using a hash algorithm for the upgrade package.
方案二:差分升级Option 2: Differential upgrade
差分升级是指车辆升级时,通过下载与老版本软件数据存在差异的增量部分,再利用算法,根据该增量部分合成升级版本的软件数据,再将其搬运到软件运行的位置,来实现车辆的升级。Differential upgrade means that when a vehicle is upgraded, it is implemented by downloading the incremental part that is different from the old version of the software data, then using the algorithm to synthesize the upgraded version of the software data based on the incremental part, and then moving it to the location where the software runs. Vehicle upgrades.
也就是说,差分升级时,车云服务器发送给的升级包中只包含部件升级前后存在差异的软件数据。这时,车云服务器发送的升级包还可以被称为差分包。In other words, during differential upgrade, the upgrade package sent by the car cloud server only contains software data that is different before and after the component upgrade. At this time, the upgrade package sent by the car cloud server can also be called a differential package.
这种情况下,完整性信息Integrity_Attr可以包括:升级包的哈希值Hash_diff[],镜像文件的哈希值Hash_full[]。In this case, the integrity information Integrity_Attr may include: the hash value Hash_diff[] of the upgrade package and the hash value Hash_full[] of the image file.
其中,Hash_diff[]为对升级包使用哈希算法计算得到的哈希值。该升级包的哈希值Hash_diff[]为车辆在车辆升级阶段,校验授权文件时,校验的完整性信息。镜像文件的哈希值Hash_full[]为对部件升级所需的完整的软件数据使用哈希算法,计算得到的哈希值。该镜像文件的哈希值Hash_full[]为车辆在安全启动阶段,校验授权文件时,校验的完整性信息。Among them, Hash_diff[] is the hash value calculated using the hash algorithm for the upgrade package. The hash value Hash_diff[] of the upgrade package is the integrity information verified when the vehicle is verifying the authorization file during the vehicle upgrade stage. The hash value Hash_full[] of the image file is the hash value calculated using the hash algorithm for the complete software data required for component upgrade. The hash value Hash_full[] of the image file is the integrity information verified when the vehicle verifies the authorization file during the safe startup phase.
也就是说,当车辆的升级方式为差分升级时,车云服务器给车辆发送的授权文件中包含两个完整性信息,在车辆升级阶段和安全启动阶段分别校验不同的完整性信息。That is to say, when the vehicle upgrade method is differential upgrade, the authorization file sent by the vehicle cloud server to the vehicle contains two integrity information, and different integrity information is verified during the vehicle upgrade stage and the safe startup stage.
在本申请实施例中,镜像文件的哈希值Hash_full[]还可以被称为第二完整性信息。In this embodiment of the present application, the hash value Hash_full[] of the image file may also be called the second integrity information.
方案三:A/B升级Option 3: A/B upgrade
A/B升级的前提是车辆存在两套系统,A/B升级是指在升级过程中,保证一个系统正常运行,升级另一个系统。The premise of A/B upgrade is that there are two systems in the vehicle. A/B upgrade means ensuring the normal operation of one system and upgrading the other system during the upgrade process.
这种情况下,完整性信息Integrity_Attr可以包括:升级包的哈希值Hash_update[],回滚文件的哈希值Hash_rollback[]。In this case, the integrity information Integrity_Attr may include: the hash value Hash_update[] of the upgrade package, and the hash value Hash_rollback[] of the rollback file.
其中,升级包的哈希值Hash_update[]为对升级包使用哈希算法计算得到的哈希值。该升级包的哈希值Hash_diff[]用于在车辆升级阶段和安全启动阶段,校验授权文件时,校验的完整性信息。回滚文件的哈希值Hash_rollback[]为结合当前车辆的数据和升级后的数据,计算得到的哈希值。该回滚文件包含车辆部件升级失败后,回滚到原版本时,部件中包含的数据。该回滚文件的哈希值Hash_rollback[]用于在车辆升级失败后,对车辆中的数据的校验。Among them, the hash value Hash_update[] of the upgrade package is the hash value calculated using the hash algorithm for the upgrade package. The hash value Hash_diff[] of the upgrade package is used to verify the integrity information when verifying the authorization file during the vehicle upgrade phase and secure startup phase. The hash value Hash_rollback[] of the rollback file is the hash value calculated by combining the current vehicle data and the upgraded data. This rollback file contains the data contained in the parts when the vehicle part upgrade fails and is rolled back to the original version. The hash value Hash_rollback[] of the rollback file is used to verify the data in the vehicle after the vehicle upgrade fails.
具体地,在车云服务器接收到资产信息后,车云服务器可以根据资产信息终端的软硬件信息来确定车辆的升级方式,从而确定需要向车辆发送给的完整性信息。Specifically, after the vehicle cloud server receives the asset information, the vehicle cloud server can determine the vehicle upgrade method based on the software and hardware information of the asset information terminal, thereby determining the integrity information that needs to be sent to the vehicle.
在本申请实施例中,回滚文件的哈希值Hash_rollback[]还可以被称为第三完整性信息。In this embodiment of the present application, the hash value Hash_rollback[] of the rollback file may also be called the third integrity information.
另外,针对升级的不同部件,完整性信息Integrity_Attr的表现形式也不同。下面结合两个方案来介绍完整性信息Integrity_Attr。In addition, the integrity information Integrity_Attr has different expression forms for different components that are upgraded. The following combines two solutions to introduce the integrity information Integrity_Attr.
方案一:对整个升级包计算哈希值Option 1: Calculate the hash value of the entire upgrade package
这时,完整性信息Integrity_Attr可以是指对整个升级包使用哈希算法,计算得到的一个数值。At this time, the integrity information Integrity_Attr may refer to a value calculated using a hash algorithm for the entire upgrade package.
该方案适用于升级的部件为域控制器DC连接的电子控制单元ECU。This solution is applicable to the electronic control unit (ECU) connected to the domain controller DC as the upgraded component.
这种对整个升级包计算哈希值的方法,能够加快完整性信息的校验。在车辆升级阶段,车辆只需在校验授权文件时,计算升级包的哈希值,判断该哈希值与授权文件中的完整性信 息是否一致,即可确定完整性信息的校验是否通过。在车辆部件升级之后的安全启动阶段,车辆只需在校验授权文件时,计算车辆部件的整个软件的哈希值,判断该哈希值与授权文件中的完整新信息是否一致,即可确定完整性信息的校验是否通过。This method of calculating hash values for the entire upgrade package can speed up the verification of integrity information. During the vehicle upgrade phase, the vehicle only needs to calculate the hash value of the upgrade package when verifying the authorization file, and determine whether the hash value matches the integrity information in the authorization file. If the information is consistent, you can determine whether the integrity information verification has passed. During the secure startup phase after vehicle component upgrades, the vehicle only needs to calculate the hash value of the entire software of the vehicle component when verifying the authorization file, and determine whether the hash value is consistent with the complete new information in the authorization file. Whether the integrity information verification passes.
方案二:对升级文件计算哈希值Option 2: Calculate the hash value of the upgrade file
这时,完整性信息Integrity_Attr可以是指对升级包中包含的多个升级文件使用哈希算法,计算得到的多个哈希值。也就是说,完整性信息Integrity_Attr表现为一个数组,其中包含多个数值。At this time, the integrity information Integrity_Attr may refer to multiple hash values calculated using a hash algorithm on multiple upgrade files included in the upgrade package. In other words, the integrity information Integrity_Attr is represented as an array containing multiple values.
该方案适用于升级的部件为域控制器DC。This scenario applies to the upgraded component being the domain controller DC.
这种对升级文件计算哈希值的方法,能够升级包的完整性校验更加精准,车辆能够根据这多个哈希值,更加准确的得知在传输升级包过程中,升级包中遭到篡改的部分,或者,在车辆启动阶段,部件中遭到篡改的软件部分。This method of calculating the hash value of the upgrade file can make the integrity check of the upgrade package more accurate. Based on these multiple hash values, the vehicle can more accurately know that during the transmission of the upgrade package, the upgrade package has been damaged. The tampered part, or the software part of the component that was tampered with during the vehicle start-up phase.
也就会说,完整性信息可以包括一个或多个参数,这一个或多个参数可以用于标识升级包。In other words, the integrity information may include one or more parameters, and the one or more parameters may be used to identify the upgrade package.
另外,在实际情况中,可以将车辆的升级方式以及车辆升级的部件来综合设置完整性信息Integrity_Attr。例如,当车辆的升级方式为全量升级,升级的部件为电子控制单元ECU,则完整性信息Integrity_Attr为对该部件的整个升级包计算得到的哈希值。又例如,当车辆的升级方式为差分升级,升级的部件为域控制器DC,则完整性信息Integrity_Attr可以包括升级包中的多个升级文件的哈希值,以及,升级后的多个完整镜像文件的哈希值。In addition, in actual situations, the integrity information Integrity_Attr can be set comprehensively based on the vehicle upgrade method and vehicle upgrade components. For example, when the vehicle upgrade mode is full upgrade and the upgraded component is the electronic control unit ECU, the integrity information Integrity_Attr is the hash value calculated for the entire upgrade package of the component. For another example, when the vehicle upgrade method is differential upgrade and the upgraded component is a domain controller DC, the integrity information Integrity_Attr can include the hash values of multiple upgrade files in the upgrade package, as well as multiple complete images after the upgrade. The hash value of the file.
下面详细介绍用于验证授权公钥合法的合法性证明的具体实现过程。The following describes in detail the specific implementation process of the legality certificate used to verify the legality of the authorized public key.
由于授权文件的签名是利用车云服务器生成的授权私钥进行加密得到的,而签名的校验也是通过车云服务器提供的授权公钥来实现的,为了防止攻击者通过伪造该授权私钥和授权公钥来篡改授权文件,需要车云服务器在提供用于校验签名的授权公钥时,存在能够校验该授权公钥的合法性的校验机制。Since the signature of the authorized file is encrypted using the authorized private key generated by the CheCloud server, and the verification of the signature is also implemented through the authorized public key provided by the CheCloud server, in order to prevent attackers from forging the authorized private key and To authorize the public key to tamper with the authorization file, the car cloud server needs to have a verification mechanism that can verify the legitimacy of the authorized public key when it provides the authorized public key for verifying the signature.
也就是说,在车辆触发对授权文件的校验之前,例如步骤S113之前,可以先校验授权公钥的合法性。That is to say, before the vehicle triggers the verification of the authorization file, for example, before step S113, the legality of the authorization public key can be verified first.
下面提供了两种校验机制,来实现对授权公钥的合法性证明。Two verification mechanisms are provided below to prove the legitimacy of the authorized public key.
方案一:车辆在芯片中预存用于校验授权文件签名的授权公钥的哈希值Option 1: The vehicle pre-stores in the chip the hash value of the authorized public key used to verify the signature of the authorized file.
示例性地,车辆可以在芯片的OTP中预留熔丝位,用于存储校验授权文件签名的授权公钥的哈希值。可以看出,在OTP中存储该授权公钥的哈希值可以避免攻击者篡改车辆本地存储的授权公钥的哈希值,保证校验授权公钥的合法性时,校验机制的可信度。For example, the vehicle can reserve a fuse bit in the OTP of the chip for storing the hash value of the authorized public key for verifying the signature of the authorized file. It can be seen that storing the hash value of the authorized public key in OTP can prevent attackers from tampering with the hash value of the authorized public key stored locally in the vehicle, ensuring the credibility of the verification mechanism when verifying the legitimacy of the authorized public key. Spend.
具体地,在车辆获取到授权文件时,可以利用哈希算法计算授权文件中的授权公钥的哈希值,然后将该哈希值,与车辆本地预存的用于校验授权文件签名的授权公钥的哈希值进行比较,如果两者一致,则说明授权文件中的授权公钥合法,没有被篡改,否则,则说明授权文件中的授权公钥不合法。Specifically, when the vehicle obtains the authorization file, the hash algorithm can be used to calculate the hash value of the authorization public key in the authorization file, and then the hash value is compared with the authorization stored locally in the vehicle for verifying the signature of the authorization file. Compare the hash value of the public key. If the two are consistent, it means that the authorized public key in the authorization file is legal and has not been tampered with. Otherwise, it means that the authorized public key in the authorization file is illegal.
可以看出,在这种情况下,授权文件中可以不包含授权公钥的合法性证明pk_validity_proof。It can be seen that in this case, the authorization file does not need to contain the legality proof pk_validity_proof of the authorization public key.
方案二:复用校验编包签名的公钥 Solution 2: Reuse the public key to verify the package signature
车云服务器在生成用于加密和校验授权文件签名的密钥对后,可以将该密钥对中的授权公钥发送给供应商服务器,供应商服务器利用生成编包签名的私钥对该授权公钥进行加密,得到该授权公钥的签名,并将该签名发送给车云服务器。这样,在车辆得到授权文件中的授权公钥和该授权公钥的签名时,可以通过用于校验编包签名的公钥来校验该授权公钥的合法性。After the Cheyun server generates a key pair for encrypting and verifying the signature of the authorized file, it can send the authorized public key in the key pair to the supplier server, and the supplier server uses the private key to generate the package signature. The authorized public key is encrypted, the signature of the authorized public key is obtained, and the signature is sent to the car cloud server. In this way, when the vehicle obtains the authorized public key in the authorization file and the signature of the authorized public key, the legitimacy of the authorized public key can be verified through the public key used to verify the package signature.
这时,授权公钥的合法性证明可以为供应商服务器利用生成编包签名的私钥,对该授权公钥进行数字签名时得到的签名。在本申请实施例中,供应商服务器利用生成编包签名的私钥,得到的授权文件的签名还可以被称为第二签名。At this time, the legality proof of the authorized public key can be the signature obtained when the supplier server uses the private key to generate the package signature and digitally signs the authorized public key. In this embodiment of the present application, the supplier server uses the private key to generate the packet signature, and the obtained signature of the authorization file may also be called a second signature.
具体地,车辆在获得授权文件之后,可以计算授权文件中的授权公钥的消息摘要,并利用用于解密编包签名的公钥对授权文件中的授权公钥的合法性证明进行解密,得到一个消息摘要,车辆可以通过比较该消息摘要,与计算得到的授权文件中的授权公钥的消息摘要是否一致,来确定授权文件中的消息摘要是否未被篡改,如果两者一致,则说明授权文件中的授权公钥合法,没有被篡改,否则,则说明授权文件中的授权公钥不合法。Specifically, after the vehicle obtains the authorization file, it can calculate the message digest of the authorized public key in the authorization file, and use the public key used to decrypt the package signature to decrypt the legality certificate of the authorized public key in the authorization file, obtaining A message digest. The vehicle can determine whether the message digest in the authorization file has not been tampered with by comparing the message digest with the calculated message digest of the authorization public key in the authorization file. If the two are consistent, it indicates authorization. The authorized public key in the file is legal and has not been tampered with. Otherwise, it means that the authorized public key in the authorization file is illegal.
当编包签名是供应商服务器采用多级密钥对升级文件签名得到的,采用方案二来设置授权公钥的合法证明时,还需要额外包括以下内容:When the package signature is obtained by the supplier server using a multi-level key to sign the upgrade file, and using option 2 to set the legal proof of the authorized public key, the following additional content needs to be included:
1)规定授权公钥的用途,或,采用多级密钥设置授权公钥的签名1) Specify the purpose of the authorized public key, or use multi-level keys to set the signature of the authorized public key
当供应商服务器采用三级密钥来实现升级包中的编包签名,那么,车云服务器可以自行生成密钥对来伪造该升级包中的编包签名,从而造成供应商服务器和车云服务器的签名能力的混淆。When the supplier server uses a third-level key to implement the package signature in the upgrade package, then the CheCloud server can generate a key pair on its own to forge the package signature in the upgrade package, thus causing a problem between the supplier server and the CheCloud server. Confusion about signature capabilities.
由于编包签名为供应商服务器采用三级密钥对升级文件签名得到的,则车辆在校验编包签名时,需要校验三次,才能最终完成编包签名的校验。具体可以参见前述步骤S115中的相关内容。Since the package signature is obtained by the supplier's server using a third-level key to sign the upgrade file, when the vehicle verifies the package signature, it needs to be verified three times to finally complete the verification of the package signature. For details, please refer to the relevant content in the aforementioned step S115.
假设授权公钥的合法性证明为供应商服务器利用三级密钥中的编包根私钥,对该授权公钥进行的签名。则车云服务器可以自行在授权公钥和授权私钥的下一级生成一对密钥,并使用该密钥对中的私钥对升级包进行签名,在车辆对该签名进行校验时,同样可以实现车辆校验三次的效果,且对该签名的校验和对供应商服务器生成编包签名的校验,都是从校验供应商服务器生成的编包根公钥开始。可以看出,车云服务器能够伪造编包签名的可能性,降低了编包签名的校验的可信度。It is assumed that the legality proof of the authorized public key is the signature of the authorized public key by the supplier server using the wrapped root private key in the third-level key. Then the car cloud server can generate a pair of keys at the next level of the authorized public key and authorized private key, and use the private key in the key pair to sign the upgrade package. When the vehicle verifies the signature, The effect of vehicle verification three times can also be achieved, and the verification of the signature and the verification of the packaged signature generated by the supplier server start from verifying the packaged root public key generated by the supplier server. It can be seen that the Cheyun server can forge the possibility of compiling signatures, which reduces the credibility of verification of compilation signatures.
因此,可以通过规定授权公钥的用途,或,采用多级密钥设置授权公钥的签名,来实现供应商服务器和车云服务器的签名能力的区分。Therefore, the signature capabilities of the supplier server and the car cloud server can be distinguished by specifying the purpose of the authorized public key, or by using multi-level keys to set the signature of the authorized public key.
其中,规定授权公钥的用途是指,车云服务器在向车辆发送授权公钥时,还包括该授权公钥的用途信息,该用途信息用于指示该授权公钥仅能用于校验授权文件的签名,从而从公钥用途上区分开供应商服务器和车云服务器的签名能力。示例性地,该用途信息可以存储在usage字段中。采用多级密钥设置授权公钥的签名时,校验该授权公钥的签名时,其校验次数应大于校验编包签名时的校验次数,从而从校验次数上区分开供应商服务器和车云服务器的签名能力。Among them, stipulating the purpose of the authorized public key means that when the car cloud server sends the authorized public key to the vehicle, it also includes the purpose information of the authorized public key. This purpose information is used to indicate that the authorized public key can only be used to verify authorization. Sign the file, thereby distinguishing the signature capabilities of the supplier server and the car cloud server from the use of public keys. For example, the usage information can be stored in the usage field. When using multi-level keys to set the signature of an authorized public key, the number of verifications when verifying the signature of the authorized public key should be greater than the number of verifications when verifying the packaged signature, so as to distinguish the supplier from the number of verifications Signature capabilities of servers and car cloud servers.
图11为本申请实施例提供的采用多级密钥设置授权公钥的签名时,供应商服务器和车云服务器之间的交互流程图。Figure 11 is a flow chart of the interaction between the supplier server and the car cloud server when multi-level keys are used to set the signature of the authorized public key provided by the embodiment of the present application.
如图11所示,供应商服务器和车云服务器之间的交互流程包括: As shown in Figure 11, the interaction process between the supplier server and the car cloud server includes:
S401.车云服务器将授权公钥发送给供应商服务器。S401. The car cloud server sends the authorized public key to the supplier server.
授权公钥为车云服务器生成的用于校验授权文件的签名的公钥。其中,授权文件的签名对车云服务器利用授权私钥对授权文件进行签名得到的。具体关于该授权公钥的描述可以参见前述内容,这里不再赘述。The authorization public key is the public key generated by the car cloud server and used to verify the signature of the authorization file. Among them, the signature of the authorization file is obtained by using the authorization private key to sign the authorization file on the Cheyun server. For a specific description of the authorized public key, please refer to the foregoing content and will not be repeated here.
S402.供应商服务器生成N对密钥。S402. The supplier server generates N pairs of keys.
当供应商服务器采用多级密钥实现编包签名,假设供应商服务器采用M级密钥实现编包签名,其中,M≥2,且M为正整数。When the supplier server uses multi-level keys to implement package signature, it is assumed that the supplier server uses M-level keys to implement package signature, where M≥2 and M is a positive integer.
为了实现供应商服务器和车云服务器的签名能力的区分,N≥M-1,且N为正整数。例如,当M=3,则供应商服务器采用三级密钥实现编包签名,则N可以取2,即供应商服务器可以生成2对密钥。又例如,当M=4,则供应商服务器采用四级密钥实现编包签名,则N可以取4,即供应商服务器可以生成4对密钥。In order to distinguish the signature capabilities of the supplier server and the car cloud server, N≥M-1, and N is a positive integer. For example, when M=3, the supplier server uses a third-level key to implement package signature, and N can be 2, that is, the supplier server can generate 2 pairs of keys. For another example, when M=4, the supplier server uses a four-level key to implement package signature, and N can be 4, that is, the supplier server can generate 4 pairs of keys.
S403.供应商服务器利用编包根私钥、该N对密钥实现对授权公钥的签名。S403. The supplier server uses the wrapped root private key and the N pairs of keys to sign the authorized public key.
编包根私钥为实现编包签名时,采用的多级密钥中的第一层级的私钥。The package root private key is the first-level private key among the multi-level keys used to implement package signature.
具体地,该N对密钥可以包括:第1公钥和第1私钥、第2公钥和第2私钥、……、第N公钥和第N私钥。Specifically, the N pairs of keys may include: the first public key and the first private key, the second public key and the second private key, ..., the Nth public key and the Nth private key.
当供应商服务器利用编包根私钥、该N对密钥实现对授权公钥的签名时,供应商服务器可以利用编包根私钥对第1公钥进行签名,得到第1公钥的签名、利用第1私钥对第2公钥进行签名,得到第2公钥的签名、……、利用第N私钥对授权公钥进行签名,得到授权公钥的签名,从而实现利用多级密钥设置授权公钥的签名。When the supplier server uses the wrapped root private key and the N pairs of keys to sign the authorized public key, the supplier server can use the wrapped root private key to sign the first public key to obtain the signature of the first public key. , use the first private key to sign the second public key, and obtain the signature of the second public key..., use the Nth private key to sign the authorized public key, and obtain the signature of the authorized public key, thereby realizing the use of multi-level encryption The key sets the signature of the authorized public key.
下面以一个具体了例子来描述供应商服务器利用编包根私钥、该N对密钥实现对授权公钥的签名。The following uses a specific example to describe how the supplier server uses the wrapped root private key and the N pairs of keys to implement the signature of the authorized public key.
其中,假设M=3、N=2。即供应商服务器采用三级密钥实现编包签名,生成2对密钥用于授权文件的签名。Among them, it is assumed that M=3 and N=2. That is, the supplier server uses a three-level key to implement package signature and generates 2 pairs of keys for signing the authorization file.
示例性地,图12为本申请实施例提供的多级密钥的结构示意图。Exemplarily, FIG. 12 is a schematic structural diagram of a multi-level key provided by an embodiment of the present application.
其中,图12中所示的编包根公钥和编包根私钥、编包二层公钥和编包二层私钥、编包三层公钥和编包三层私钥为供应商服务器生成的三级密钥,这三级密钥用于完成升级包中的升级文件的编包签名。Among them, the packaged root public key and packaged root private key, packaged layer 2 public key and packaged layer 2 private key, packaged layer 3 public key and packaged layer 3 private key shown in Figure 12 are the suppliers. A third-level key generated by the server. This third-level key is used to complete the package signature of the upgrade file in the upgrade package.
可以看出,在校验编包签名时,需要完成编包根公钥校验编包二层公钥的签名,编包二层公钥校验编包三层公钥的签名,编包三层公钥校验软件数据的编包签名这三次校验过程。具体关于这三级密钥的描述可以参见前述步骤S101和步骤S115的相关内容,这里不再赘述。It can be seen that when verifying the packaged signature, it is necessary to complete the packaged root public key to verify the signature of the packaged layer 2 public key, the packaged layer 2 public key to verify the packaged layer 3 public key, and the packaged layer 3 public key. This is the three verification processes of layer public key verification software data package signature. For a specific description of these three-level keys, please refer to the relevant content of the aforementioned step S101 and step S115, which will not be described again here.
另外,图12所示的一车一授权公钥和一车一授权私钥、授权根公钥和授权根私钥为供应商服务器生成的用于实现授权文件的签名的2对密钥。In addition, the one-vehicle-authorization public key and one-vehicle authorization private key, the authorization root public key, and the authorization root private key shown in Figure 12 are two pairs of keys generated by the supplier server to implement the signature of the authorization file.
具体地,供应商服务器可以利用编包根私钥对一车一授权公钥进行签名,得到一车一授权公钥的签名,利用一车一授权私钥对授权根公钥进行签名,得到授权根公钥的签名,利用授权根私钥对授权公钥进行签名,得到授权公钥的签名。Specifically, the supplier server can use the packaged root private key to sign the one-vehicle-authorized public key to obtain the signature of the one-vehicle-authorized public key, and use the one-vehicle authorized private key to sign the authorized root public key to obtain authorization. For the signature of the root public key, use the authorized root private key to sign the authorized public key to obtain the signature of the authorized public key.
可以看出,在校验授权文件的签名时,需要完成编包根公钥校验一车一授权公钥的签名,一车一授权公钥校验授权根公钥的签名,授权根公钥校验授权公钥的签名,授权公钥校验授权文件的签名这四次校验过程。这样即可避免车云服务器自行生成密钥对来伪造该升级包的编包签名的问题。 It can be seen that when verifying the signature of the authorized file, it is necessary to complete the packaged root public key to verify the signature of one authorized public key for each vehicle, and verify the signature of the authorized root public key for each vehicle. The authorized root public key Verify the signature of the authorized public key, and verify the signature of the authorized file with the authorized public key. This is a four-step verification process. This can avoid the problem of the CheCloud server generating a key pair on its own to forge the package signature of the upgrade package.
S404.供应商服务器将该授权公钥的签名发送给车云服务器。S404. The supplier server sends the signature of the authorized public key to the car cloud server.
供应商服务器可以将该授权公钥的签名作为该授权公钥的合法性证明发送给车云服务器,从而实现了复用校验编包签名的公钥,来验证授权公钥合法的目的。The supplier server can send the signature of the authorized public key to the CheCloud server as proof of the legality of the authorized public key, thereby achieving the purpose of reusing the public key for verification and package signature to verify the legality of the authorized public key.
2)对不同车云服务器的授权公钥进行区分2) Distinguish the authorized public keys of different car cloud servers
应理解,由于车辆厂商通常存在多家,不同车辆厂商的服务器可以完成车辆的升级。例如,车辆厂商A(以下简称车厂A)生产的车辆可以通过车厂A的服务器(以下简称车云服务器A)获取升级包,完成升级,车辆厂商B(以下简称车厂B)生产的车辆可以通过车厂B的服务器(以下简称车云服务器B)获取升级包,完成升级。It should be understood that since there are usually multiple vehicle manufacturers, the servers of different vehicle manufacturers can complete vehicle upgrades. For example, vehicles produced by vehicle manufacturer A (hereinafter referred to as vehicle manufacturer A) can obtain the upgrade package through the server of vehicle manufacturer A (hereinafter referred to as vehicle cloud server A) and complete the upgrade. Vehicles produced by vehicle manufacturer B (hereinafter referred to as vehicle manufacturer B) can obtain the upgrade package through the vehicle manufacturer A's server (hereinafter referred to as vehicle cloud server A). Server B (hereinafter referred to as Cheyun Server B) obtains the upgrade package and completes the upgrade.
图13为本申请实施例提供的供应商服务器对多个车云服务器的授权公钥进行签名的逻辑示意图。Figure 13 is a logical schematic diagram of the supplier server signing the authorized public keys of multiple car cloud servers provided by the embodiment of the present application.
如图13所示,存在车云服务器A和车云服务器B通过供应商服务器对授权公钥进行签名。其中,供应商服务器使用密钥生成器Kg(1n)生成一对密钥(pk,sk),其中,sk为用于对升级文件x进行编包签名Sig(sk,x)的编包私钥,pk为用于校验编包签名σx的编包公钥。车云服务器A使用密钥生成器Kg(1n)生成一对密钥(pkA,skA),其中,skA为用于对授权文件auth_docA进行签名Sig(skA,auth_docA)的授权私钥,pkA为用于校验授权文件auth_docA的签名σauth_docA的授权公钥,车云服务器B使用密钥生成器Kg(1n)生成一对密钥(pkB,skB),其中,skB为用于对授权文件auth_docB进行签名Sig(skB,auth_docB)的授权私钥,pkB为用于校验授权文件auth_docB的签名σauth_docB的授权公钥。As shown in Figure 13, there are car cloud server A and car cloud server B that sign the authorized public key through the supplier server. Among them, the supplier server uses the key generator Kg(1 n ) to generate a pair of keys (pk, sk), where sk is the package secret used to package the upgrade file x with the package signature Sig(sk,x). key, pk is the packet public key used to verify the packet signature σ x . Cheyun server A uses the key generator Kg(1 n ) to generate a pair of keys (pk A , sk A ), where sk A is used to sign the authorization file auth_doc A Sig (sk A , auth_doc A ) Authorization private key, pk A is the authorization public key used to verify the signature σauth_doc A of the authorization file auth_doc A. Cheyun server B uses the key generator Kg(1 n ) to generate a pair of keys (pk B , sk B ) , where sk B is the authorization private key used to sign the authorization file auth_doc B Sig (sk B , auth_doc B ), and pk B is the authorization public key used to verify the signature σauth_doc B of the authorization file auth_doc B.
车云服务器A可以将pkA发送给供应商服务器,供应商服务器可以使用sk对该pkA进行签名,即Sig(sk,pkA),得到pkA的签名σA,并将其返回给车云服务器A。The car cloud server A can send pk A to the supplier server, and the supplier server can use sk to sign the pk A , that is, Sig(sk,pk A ), get the signature σ A of pk A , and return it to the car cloud server A. Cloud server A.
车云服务器B可以将pkB发送给供应商服务器,供应商服务器可以使用sk对该pkB进行签名,即Sig(sk,pkB),得到pkB的签名σB,并将其返回给车云服务器B。The car cloud server B can send pk B to the supplier server, and the supplier server can use sk to sign the pk B , that is, Sig(sk,pk B ), get the signature σ B of pk B , and return it to the car cloud server B. Cloud server B.
从图13可以看出,针对供应商服务器提供的同一个升级文件,车云服务器A的授权公钥和车云服务器B的授权公钥的合法性都是由供应商服务器提供的同一个公钥来保证的。As can be seen from Figure 13, for the same upgrade file provided by the supplier server, the legality of the authorized public key of Car Cloud Server A and the authorized public key of Car Cloud Server B are the same public key provided by the supplier server. To guarantee.
也就是说,车厂A生产的车辆升级时,不仅车云服务器A提供的授权文件中的授权公钥能够通过合法性证明,车云服务器B提供的授权文件中的授权公钥也能够通过合法性证明。That is to say, when the vehicle produced by car manufacturer A is upgraded, not only the authorized public key in the authorization file provided by car cloud server A can pass the legality certificate, but the authorized public key in the authorization file provided by car cloud server B can also pass the legality certificate. prove.
那么,如果车厂B的授权私钥被攻击者窃取,进而伪造授权文件的签名,利用伪造的授权文件来攻击车厂A生产的车辆,容易造成车厂A的商业利益受到牵连。Then, if the authorization private key of car manufacturer B is stolen by an attacker, and then forges the signature of the authorization document, and uses the forged authorization document to attack the vehicles produced by car manufacturer A, the commercial interests of car manufacturer A may be easily affected.
对不同车辆厂商的车云服务器的授权公钥进行区分,就是为了避免部分车辆厂商的车云服务器的授权私钥丢失,而连带影响到其他车辆厂商。也就是说,在车辆在获取到授权文件后,可以先判断授权文件中的授权公钥的生成方是否为目标车厂,来决定是否用该授权公钥来校验授权文件的合法性。Distinguishing the authorized public keys of the car cloud servers of different vehicle manufacturers is to avoid the loss of the authorized private keys of the car cloud servers of some vehicle manufacturers, which will also affect other vehicle manufacturers. That is to say, after the vehicle obtains the authorization file, it can first determine whether the generator of the authorization public key in the authorization file is the target car manufacturer, and then decide whether to use the authorization public key to verify the legality of the authorization file.
示例性地,车辆厂商可以利用黑/白名单来设置该目标车厂,其中,白名单中的车厂生成的授权公钥,为允许用来校验授权文件的公钥,黑名单中的车厂生成的授权公钥,为不允许用来校验授权文件的公钥。For example, the vehicle manufacturer can use a black/white list to set the target vehicle manufacturer. The authorization public key generated by the vehicle manufacturer in the white list is a public key that is allowed to be used to verify the authorization file, and the authorization public key generated by the vehicle manufacturer in the black list is Authorization public key is a public key that is not allowed to be used to verify authorized files.
例如,当车辆厂商利用白名单来设置目标车厂时,车辆厂商可以在车辆校验授权文件之前,提前将白名单发送给车辆,车辆在校验授权文件的合法性之前,先判断该授权公钥的生成方是否为白名单中的车厂,如果是,则车辆可以使用该授权公钥校验授权文件的合法性,否则,车辆不可以使用该授权公钥校验授权文件的合法性。 For example, when a vehicle manufacturer uses a whitelist to set a target vehicle manufacturer, the vehicle manufacturer can send the whitelist to the vehicle in advance before the vehicle verifies the authorization file. The vehicle first determines the authorization public key before verifying the legality of the authorization file. Is the generator in the whitelist a car manufacturer? If so, the vehicle can use the authorized public key to verify the legality of the authorized file. Otherwise, the vehicle cannot use the authorized public key to verify the legality of the authorized file.
另外,为了避免攻击者伪造黑/白名单,车辆厂商在提供黑/白名单之前,可以将黑/白名单发送给供应商服务器,由供应商服务器生成的密钥对设置该黑/白名单的签名。进一步地,供应商服务器可以利用多级密钥来设置该黑/白名单的签名。In addition, in order to prevent attackers from forging the black/white list, the vehicle manufacturer can send the black/white list to the supplier server before providing the black/white list, and the key pair generated by the supplier server sets the black/white list sign. Further, the supplier server can use multi-level keys to set the signature of the black/white list.
下面以一个具体的例子来描述供应商服务器利用多级密钥来设置该黑/白名单的签名。The following uses a specific example to describe how the supplier server uses multi-level keys to set the signature of the black/white list.
假设供应商服务器利用三级密钥来设置白名单,存在车厂服务器A生成的授权公钥A和授权私钥A,车厂服务器B生成的授权公钥B和授权私钥B,以及车厂A的白名单A,车厂B的白名单B,白名单A中列举的车厂的授权公钥,为车厂A生产的车辆允许用来校验授权文件的公钥,白名单B中列举的车厂的授权公钥,为车厂B生产的车辆允许用来校验授权文件的公钥。Assume that the supplier server uses a third-level key to set up a whitelist. There are authorized public key A and authorized private key A generated by car factory server A, authorized public key B and authorized private key B generated by car factory server B, and whitelist of car factory A. List A, whitelist B of car manufacturer B, authorized public keys of car manufacturers listed in whitelist A, public keys allowed to be used to verify authorization files for vehicles produced by car manufacturer A, authorized public keys of car manufacturers listed in whitelist B , the public key that is allowed to be used to verify the authorization file for vehicles produced by vehicle manufacturer B.
示例性地,图14为本申请实施例提供的另一种多级密钥的结构示意图。Exemplarily, FIG. 14 is a schematic structural diagram of another multi-level key provided by an embodiment of the present application.
如图14所示,授权公钥A和授权私钥A为车厂服务器A生成的密钥对,授权公钥B和授权公钥B为车厂服务器B生成的密钥对,编包根公钥(pk1)和编包根私钥(sk1)、一车一授权公钥(pk2)和一车一授权私钥(sk2)、授权根公钥和授权根私钥为供应商服务器生成的用来设置车厂服务器A的授权公钥A和车厂服务器B的授权公钥B的签名的密钥对,具体关于这些密钥对的描述可以参见前述图8的相关内容,这里不再赘述。As shown in Figure 14, authorized public key A and authorized private key A Key pair generated for car factory server A, authorized public key B and authorized public key B The key pair generated for the car factory server B, the packaged root public key (pk 1 ) and the packaged root private key (sk 1 ), the one-vehicle-one-authorization public key (pk 2 ) and the one-vehicle-one-authorization private key (sk 2 ), authorized root public key and authorized root private key A key pair generated by the supplier server to set the signature of the authorized public key A of the car manufacturer server A and the authorized public key B of the car manufacturer server B. For a detailed description of these key pairs, please refer to the relevant content of Figure 8. I won’t go into details here.
另外,为了设置白名单的签名,供应商服务器还可以生成一对密钥:许可公钥和许可私钥并利用一车一授权私钥对许可公钥进行签名,得到许可公钥的签名,利用许可私钥对白名单A和白名单B进行签名,得到白名单A的签名和白名单B的签名。In addition, in order to set up the signature of the whitelist, the supplier server can also generate a pair of keys: the permission public key and license private key And use the one-vehicle-one-authorized private key to sign the license public key to obtain the signature of the license public key. Use the license private key to sign whitelist A and whitelist B to obtain the signature of whitelist A and the signature of whitelist B.
车厂服务器可以向车辆发送许可列表,该许可列表中可以包括:车辆厂商设置的白名单,以及该白名单的签名。示例性地,表4示出了授权文件A的结构,表5示出了授权文件B的结构,表6示出了车厂服务器A发送的许可列表A的结构,表7示出了车厂服务器B发送的许可列表B的结构。The car manufacturer's server can send a permission list to the vehicle, and the permission list can include: a whitelist set by the vehicle manufacturer, and the signature of the whitelist. Exemplarily, Table 4 shows the structure of authorization file A, Table 5 shows the structure of authorization file B, Table 6 shows the structure of the permission list A sent by car manufacturer server A, and Table 7 shows the structure of car manufacturer server B. The structure of the sent permission list B.
表4
Table 4
其中,授权文件A可以包括三个部分:属性域M1、签名域和授权公钥域。其中,属性域M1中可包括:车辆身份标识Space_Attr1、防重放参数Time_Attr1、完整性信息Integrity_Attr1。签名域中包括车云服务器A用自己的授权私钥对属性域M1计算得到的签名授权公钥域中包括:授权公钥以及,用于验证的合法性的多个参数,这多个参数包括:多个公钥和公钥的签名,即,编包根公钥(pk1),一车一授权公钥pk2,一车一授权公钥pk2的签名Sig(sk1,pk2),授权根公钥授权根公钥的签名授权公钥的签名其中,授权公钥用于校验签名授权根公钥用于校 验签名一车一授权公钥pk2用于校验签名编包根公钥(pk1)用于校验签名Sig(sk1,pk2)。Among them, the authorization file A may include three parts: attribute field M 1 , signature field and authorized public key field. Among them, the attribute domain M 1 may include: vehicle identity identifier Space_Attr1, anti-replay parameter Time_Attr1, and integrity information Integrity_Attr1. The signature domain includes the car cloud server A using its own authorized private key. Signature calculated for attribute domain M 1 The authorized public key field includes: authorized public key and, for verification Multiple parameters for the legality of Signature Sig(sk 1 ,pk 2 ) of key pk 2 , authorized root public key Authorized root public key signature Authorized public key signature Among them, the authorized public key Used to verify signature Authorized root public key Used for school Verification signature One vehicle, one authorized public key pk 2 is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
具体关于属性域的描述可以参见前述表1的相关内容,具体关于pk1,pk2,Sig(sk1,pk2),的描述可以参见图13的相关内容。For the specific description of the attribute domain, please refer to the relevant content of the aforementioned Table 1, specifically regarding pk 1 , pk 2 , Sig(sk 1 , pk 2 ), The description can be found in Figure 13.
表5
table 5
其中,授权文件B可以包括三个部分:属性域M2、签名域和授权公钥域。其中,属性域M2中可包括:车辆身份标识Space_Attr2、防重放参数Time_Attr2、完整性信息Integrity_Attr2。签名域中包括车云服务器B用自己的授权私钥对属性域M1计算得到的签名授权公钥域中包括:授权公钥以及,用于验证的合法性的多个参数,这多个参数包括:多个公钥和公钥的签名,即,编包根公钥(pk1),一车一授权公钥pk2,一车一授权公钥pk2的签名Sig(sk1,pk2),授权根公钥授权根公钥的签名授权公钥的签名其中,授权公钥用于校验签名授权根公钥用于校验签名一车一授权公钥pk2用于校验签名编包根公钥(pk1)用于校验签名Sig(sk1,pk2)。Among them, the authorization file B may include three parts: attribute field M 2 , signature field and authorized public key field. Among them, the attribute domain M 2 may include: vehicle identity identifier Space_Attr2, anti-replay parameter Time_Attr2, and integrity information Integrity_Attr2. The signature domain includes the car cloud server B using its own authorized private key. Signature calculated for attribute domain M 1 The authorized public key field includes: authorized public key and, for verification Multiple parameters for the legality of Signature Sig(sk 1 ,pk 2 ) of key pk 2 , authorized root public key Authorized root public key signature Authorized public key signature Among them, the authorized public key Used to verify signature Authorized root public key Used to verify signature One vehicle, one authorized public key pk 2 is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
具体关于属性域的描述可以参见前述表1的相关内容,具体关于pk1,pk2,Sig(sk1,pk2),的描述可以参见图13的相关内容。For the specific description of the attribute domain, please refer to the relevant content of the aforementioned Table 1, specifically regarding pk 1 , pk 2 , Sig(sk 1 , pk 2 ), The description can be found in Figure 13.
表6
Table 6
其中,许可列表A可以包括三个部分:属性域MA、签名域和密钥链域。其中,属性域MA中可包括:车辆身份标识Space_Attr1、防重放参数Time_Attr1和白名单公钥签名域中包括供应商服务器用自己的许可私钥对属性域MA计算得到的签名密 钥链域中包括:编包根公钥(pk1),一车一授权公钥(pk2),一车一授权公钥(pk2)的签名Sig(sk1,pk2),许可公钥许可公钥的签名其中,许可公钥用于校验签名一车一授权公钥(pk2)用于校验签名编包根公钥(pk1)用于校验签名Sig(sk1,pk2)。Among them, the permission list A may include three parts: attribute domain M A , signature domain and key chain domain. Among them, the attribute domain M A may include: vehicle identity identifier Space_Attr1, anti-replay parameter Time_Attr1 and whitelist public key The signing domain includes the vendor server with its own licensing private key The signature calculated for the attribute domain M A dense The key chain domain includes: packaged root public key (pk 1 ), one-car-one-authorized public key (pk 2 ), one-car-one authorized public key (pk 2 ) signature Sig (sk 1 , pk 2 ), license public key key License public key signature Among them, the license public key Used to verify signature One vehicle, one authorized public key (pk 2 ) is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
具体关于车辆身份标识和防重放参数的描述可以参见前述内容,具体关于pk1,pk2,Sig(sk1,pk2),的描述可以参见图13的相关内容。For specific descriptions of vehicle identification and anti-replay parameters, please refer to the foregoing content, specifically regarding pk 1 , pk 2 , Sig(sk 1 ,pk 2 ), The description can be found in Figure 13.
从表6可以看出,属性域MA中的指示了车厂A的车辆只能使用车厂A生成的授权公钥来校验授权文件的合法性,签名域中的签名用于证明属性域MA的合法性,密钥链域中包含用于校验签名的公钥和该公钥的合法性证明。As can be seen from Table 6, in the attribute domain M A Vehicles instructed by car manufacturer A can only use the authorized public key generated by car manufacturer A. To verify the legality of the authorization file, the signature in the signature field is used to prove the legality of the attribute field M A. The key chain field contains the public key used to verify the signature and the legality certificate of the public key.
表7
Table 7
其中,许可列表B可以包括三个部分:属性域MB、签名域和密钥链域。其中,属性域MB中可包括:车辆身份标识Space_Attr2、防重放参数Time_Attr2和白名单公钥签名域中包括供应商服务器用自己的许可私钥对属性域MB计算得到的签名密钥链域中包括:编包根公钥(pk1),一车一授权公钥(pk2),一车一授权公钥(pk2)的签名Sig(sk1,pk2),许可公钥许可公钥的签名其中,许可公钥用于校验签名一车一授权公钥(pk2)用于校验签名编包根公钥(pk1)用于校验签名Sig(sk1,pk2)。Among them, the permission list B may include three parts: the attribute field MB , the signature field and the key chain field. Among them, the attribute domain M B may include: vehicle identity identifier Space_Attr2, anti-replay parameter Time_Attr2 and whitelist public key The signing domain includes the vendor server with its own licensing private key The signature calculated for the attribute domain M B The key chain domain includes: packaged root public key (pk 1 ), one-car-one-authorized public key (pk 2 ), one-car-one authorized public key (pk 2 ) signature Sig (sk 1 , pk 2 ), license public key License public key signature Among them, the license public key Used to verify signature One vehicle, one authorized public key (pk 2 ) is used to verify signatures The packaged root public key (pk 1 ) is used to verify the signature Sig (sk 1 ,pk 2 ).
具体关于车辆身份标识和防重放参数的描述可以参见前述内容,具体关于pk1,pk2,Sig(sk1,pk2),的描述可以参见图10的相关内容。For specific descriptions of vehicle identification and anti-replay parameters, please refer to the foregoing content, specifically regarding pk 1 , pk 2 , Sig(sk 1 ,pk 2 ), The description can be found in the relevant content of Figure 10.
从表7可以看出,属性域MB中的指示了车厂B的车辆只能使用车厂B生成的授权公钥来校验授权文件的合法性,签名域中的签名用于证明属性域MB的合法性,密钥链域中包含用于校验签名的公钥和该公钥的合法性证明。As can be seen from Table 7, in the attribute domain M B Vehicles instructed by Depot B can only use the authorized public key generated by Depot B. To verify the legality of the authorization file, the signature in the signature field is used to prove the legality of the attribute field MB . The key chain field contains the public key used to verify the signature and the legality certificate of the public key.
在本申请实施例中,许可列表或黑/白名单还可以被称为第一列表。In the embodiment of this application, the permission list or black/white list may also be called the first list.
可以理解的是,上述表5-表7只是示例性举例,不构成对本申请实施例的限定。在本申请其他实施例中,许可列表中可以包含更多或更少的参数。例如,属性域中可以仅包含白名单公钥,当供应商服务器用更多或更少层级的密钥对来设置白名单的签名时,密钥链域中可以包含更多或更少的公钥和公钥的签名。It can be understood that the above-mentioned Tables 5 to 7 are only illustrative examples and do not constitute a limitation on the embodiments of the present application. In other embodiments of the present application, the permission list may contain more or fewer parameters. For example, the attribute field can contain only whitelist public keys, and when the supplier server uses more or fewer levels of key pairs to set up the whitelist's signature, the keychain field can contain more or fewer public keys. key and public key signature.
总的来说,本申请实施例提供的车辆升级验证方法,能够在车辆升级阶段,对车辆接收到的升级包进行校验,只有在该升级包为适用于本车辆此次升级的升级包时,才触发对车辆的升级,当升级包为不适用于该车辆的升级包,例如,老版本的升级包、其他车辆的升级包、研发阶段使用的升级包时,则取消车辆的升级。进一步地,在安全启动阶段,该方法也能够 触发对车辆升级后的数据进行校验,只有在车辆升级的数据为经过车辆升级阶段,通过升级包升级得到的数据时,才能够启动车辆的运行,避免了攻击者恶意拆件,将不适用于该车辆的升级包导入该车辆,更改车辆的数据,保障了车辆的安全。In general, the vehicle upgrade verification method provided by the embodiment of the present application can verify the upgrade package received by the vehicle during the vehicle upgrade stage, only when the upgrade package is an upgrade package suitable for the current upgrade of the vehicle. , the vehicle upgrade is triggered. When the upgrade package is not applicable to the vehicle, for example, an upgrade package for an old version, an upgrade package for other vehicles, or an upgrade package used in the research and development phase, the vehicle upgrade will be cancelled. Furthermore, during the safe startup phase, this method can also Triggers the verification of vehicle upgraded data. Only when the vehicle upgraded data is the data obtained through the vehicle upgrade stage and the upgrade package, the vehicle can be started to run. This avoids malicious disassembly by attackers and will not be applicable. Import the vehicle's upgrade package into the vehicle and change the vehicle's data to ensure vehicle safety.
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software. The method steps disclosed in conjunction with the embodiments of this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
本申请还提供一种电子设备,该电子设备可以包括:存储器和处理器。其中,存储器可用于存储计算机程序;处理器可用于调用所述存储器中的计算机程序,以使得该电子设备执行上述任意一个实施例中供应商服务器、车云服务器或车辆执行的方法。This application also provides an electronic device, which may include a memory and a processor. The memory can be used to store computer programs; the processor can be used to call the computer program in the memory, so that the electronic device executes the method executed by the supplier server, vehicle cloud server or vehicle in any of the above embodiments.
本申请还提供了一种芯片系统,所述芯片系统包括至少一个处理器,用于实现上述任一个实施例中供应商服务器、车云服务器或车辆执行的方法中所涉及的功能。This application also provides a chip system that includes at least one processor for implementing the functions involved in the method executed by the supplier server, vehicle cloud server, or vehicle in any of the above embodiments.
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。In a possible design, the chip system further includes a memory, the memory is used to store program instructions and data, and the memory is located within the processor or outside the processor.
该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The chip system can be composed of chips or include chips and other discrete devices.
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, there may be one or more processors in the chip system. The processor can be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in memory.
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, there may be one or more memories in the chip system. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited by the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be separately provided on different chips. The embodiments of this application vary on the type of memory, and The arrangement of the memory and processor is not specifically limited.
示例性地,该芯片系统可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。For example, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC). It can also be a central processor (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), or a microcontroller (micro controller unit (MCU), or a programmable logic device (PLD) or other integrated chip.
本申请还提供一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机执行上述任一个实施例中供应商服务器、车云服务器或车辆任意一个执行的方法。The present application also provides a computer program product. The computer program product includes: a computer program (which can also be called a code, or an instruction). When the computer program is run, it causes the computer to execute any of the above embodiments. A method executed by any one of the server, vehicle cloud server or vehicle.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序(也可以称为代码,或指令)。当所述计算机程序被运行时,使得计算机执行上述任一个实施例中供应商服务器、车云服务器或车辆任意一个执行的方法。This application also provides a computer-readable storage medium that stores a computer program (which may also be called a code, or an instruction). When the computer program is run, the computer is caused to execute the method executed by any one of the supplier server, vehicle cloud server, or vehicle in any of the above embodiments.
应理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(AP 800plication specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例 所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an AP 800plication specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. Combined with the embodiments of this application The steps of the disclosed method can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
另外,本申请实施例还提供一种装置。该装置具体可以是组件或模块,该装置可包括相连的一个或多个处理器和存储器。其中,存储器用于存储计算机程序。当该计算机程序被一个或多个处理器执行时,使得装置执行上述各方法实施例中的方法。In addition, the embodiment of the present application also provides a device. The device may specifically be a component or module, and the device may include one or more connected processors and memories. Among them, memory is used to store computer programs. When the computer program is executed by one or more processors, the device is caused to execute the methods in each of the above method embodiments.
其中,本申请实施例提供的装置、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法。因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the devices, computer-readable storage media, computer program products or chips provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be described again here.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are implemented. This process can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, , may include the processes of the above method embodiments. The aforementioned storage media include: ROM, random access memory (RAM), magnetic disks, optical disks and other media that can store program codes.
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 In short, the above descriptions are only examples of the technical solutions of the present invention and are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made based on the disclosure of the present invention shall be included in the protection scope of the present invention.

Claims (33)

  1. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    车辆接收到第一文件和第一升级包,所述第一文件包括:第一车辆标识,第一完整性信息,和,根据所述第一车辆标识以及所述第一完整性信息确定的第一签名;The vehicle receives a first file and a first upgrade package. The first file includes: a first vehicle identification, first integrity information, and a third information determined based on the first vehicle identification and the first integrity information. a signature;
    所述车辆使用第一服务器的公钥校验所述第一签名,且校验通过;所述第一服务器用于管理所述车辆的升级;The vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle;
    所述车辆确定所述第一车辆标识与所述车辆的车辆标识相同,且,所述第一升级包为所述第一完整性信息指示的升级包;The vehicle determines that the first vehicle identification is the same as the vehicle identification of the vehicle, and the first upgrade package is the upgrade package indicated by the first integrity information;
    所述车辆根据所述第一升级包进行升级,以增强第一功能或增加第一功能。The vehicle is upgraded according to the first upgrade package to enhance a first function or add a first function.
  2. 根据权利要求1所述的方法,其特征在于,所述车辆根据所述第一升级包进行升级之后,所述方法还包括:The method according to claim 1, characterized in that after the vehicle is upgraded according to the first upgrade package, the method further includes:
    所述车辆再次使用所述第一服务器的公钥校验所述第一签名,并且校验通过,The vehicle again uses the public key of the first server to verify the first signature, and the verification passes,
    所述车辆再次确定所述第一车辆标识与所述车辆的车辆标识相同,且,升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据;The vehicle again determines that the first vehicle identification is the same as the vehicle identification of the vehicle, and the upgraded data of the vehicle includes data in the upgrade package indicated by the first integrity information;
    所述车辆启动所述第一功能。The vehicle activates the first function.
  3. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    车辆接收到第一文件和第一升级包,所述第一文件包括:第一防重放参数,第一完整性信息,和,根据所述第一防重放参数和所述第一完整性信息确定的第一签名;The vehicle receives a first file and a first upgrade package, the first file includes: a first anti-replay parameter, first integrity information, and, according to the first anti-replay parameter and the first integrity The first signature to confirm the information;
    所述车辆使用第一服务器的公钥校验所述第一签名,且校验通过;所述第一服务器用于管理所述车辆的升级;The vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle;
    所述车辆确定所述第一防重放参数与所述车辆的防重放参数相同,且,所述第一升级包为所述第一完整性信息指示的升级包;所述车辆的防重放参数用于标识所述车辆本次的升级;The vehicle determines that the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the first upgrade package is the upgrade package indicated by the first integrity information; the anti-replay parameter of the vehicle The parameters are used to identify the current upgrade of the vehicle;
    所述车辆根据所述第一升级包进行升级,以增强第一功能或增加第一功能。The vehicle is upgraded according to the first upgrade package to enhance a first function or add a first function.
  4. 根据权利要求3所述的方法,其特征在于,所述第一文件还包括第一车辆标识,所述第一签名为根据所述第一车辆标识和所述第一防重放参数确定的签名;The method of claim 3, wherein the first file further includes a first vehicle identification, and the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter. ;
    所述车辆根据所述第一升级包进行升级之前,所述方法还包括:Before the vehicle is upgraded according to the first upgrade package, the method further includes:
    所述车辆确定所述第一车辆标识和所述车辆的车辆标识相同。The vehicle determines that the first vehicle identification and the vehicle identification of the vehicle are the same.
  5. 根据权利要求3或4所述的方法,其特征在于,所述车辆根据所述第一升级包进行升级之后,所述方法还包括:The method according to claim 3 or 4, characterized in that after the vehicle is upgraded according to the first upgrade package, the method further includes:
    所述车辆再次使用第一服务器的公钥校验所述第一签名,且校验通过;The vehicle uses the public key of the first server again to verify the first signature, and the verification passes;
    所述车辆再次确定所述第一防重放参数与所述车辆的防重放参数相同,且,升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据;The vehicle again determines that the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and the upgraded data of the vehicle includes the data in the upgrade package indicated by the first integrity information;
    所述车辆启动所述第一功能。The vehicle activates the first function.
  6. 根据权利要求4所述的方法,其特征在于,所述车辆根据所述第一升级包进行升级之后,所述方法还包括: The method according to claim 4, characterized in that after the vehicle is upgraded according to the first upgrade package, the method further includes:
    所述车辆再次使用所述第一服务器的公钥校验所述第一签名,且校验通过;The vehicle uses the public key of the first server again to verify the first signature, and the verification passes;
    所述车辆再次确定所述第一防重放参数与所述车辆的防重放参数相同,且,所述第一车辆标识与所述车辆的车辆标识相同,且,升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据;The vehicle again determines that the first anti-replay parameter is the same as the anti-replay parameter of the vehicle, and that the first vehicle identification is the same as the vehicle identification of the vehicle, and that the upgraded vehicle's The data includes data in the upgrade package indicated by the first integrity information;
    所述车辆启动所述第一功能。The vehicle activates the first function.
  7. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    车辆接收到第一文件和第一升级包,所述第一文件包括:第一车辆标识,第一完整性信息,和,根据所述第一车辆标识以及所述第一完整性信息确定的第一签名;The vehicle receives a first file and a first upgrade package. The first file includes: a first vehicle identifier, first integrity information, and a third file determined based on the first vehicle identifier and the first integrity information. a signature;
    所述车辆检测到启动第一功能的指令,所述第一功能为所述车辆根据所述第一升级包进行升级后增强或增加的功能;The vehicle detects an instruction to activate a first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package;
    所述车辆使用第一服务器的公钥校验所述第一签名,且校验通过;所述第一服务器用于管理所述车辆的升级;The vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle;
    所述车辆再次确定所述第一车辆标识与所述车辆的车辆标识相同,且,升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据;The vehicle again determines that the first vehicle identification is the same as the vehicle identification of the vehicle, and the upgraded data of the vehicle includes data in the upgrade package indicated by the first integrity information;
    所述车辆启动所述第一功能。The vehicle activates the first function.
  8. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    车辆接收到第一文件和第一升级包,所述第一文件包括:第一防重放参数,第一完整性信息,和,根据所述第一防重放参数以及所述第一完整性信息确定的第一签名;The vehicle receives a first file and a first upgrade package, the first file includes: a first anti-replay parameter, first integrity information, and, according to the first anti-replay parameter and the first integrity The first signature to confirm the information;
    所述车辆检测到启动第一功能的指令,所述第一功能为所述车辆根据所述第一升级包进行升级后增强或增加的功能;The vehicle detects an instruction to activate a first function, and the first function is a function that is enhanced or added after the vehicle is upgraded according to the first upgrade package;
    所述车辆使用第一服务器的公钥校验所述第一签名,且校验通过;所述第一服务器用于管理所述车辆的升级;The vehicle uses the public key of the first server to verify the first signature, and the verification passes; the first server is used to manage the upgrade of the vehicle;
    所述车辆再次确定所述第一防重放参数与所述车辆的车辆标识相同,且,升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据;The vehicle again determines that the first anti-replay parameter is the same as the vehicle identification of the vehicle, and the upgraded data of the vehicle includes the data in the upgrade package indicated by the first integrity information;
    所述车辆启动所述第一功能。The vehicle activates the first function.
  9. 根据权利要求8所述的方法,其特征在于,所述第一文件还包括第一车辆标识,所述第一签名为根据所述第一车辆标识和所述第一防重放参数确定的签名;The method of claim 8, wherein the first file further includes a first vehicle identification, and the first signature is a signature determined based on the first vehicle identification and the first anti-replay parameter. ;
    所述车辆启动所述第一功能之前,所述方法还包括:Before the vehicle activates the first function, the method further includes:
    所述车辆确定所述第一车辆标识和所述车辆的车辆标识相同。The vehicle determines that the first vehicle identification and the vehicle identification of the vehicle are the same.
  10. 根据权利要求3-6,8,9任一项所述的方法,其特征在于,所述车辆的防重放参数随着所述车辆的每一次升级而更新且仅用于标识所述车辆的一次升级,或者,所述车辆的防重放参数用于标识所述车辆的多次升级。The method according to any one of claims 3-6, 8, and 9, characterized in that the anti-replay parameters of the vehicle are updated with each upgrade of the vehicle and are only used to identify the vehicle. One upgrade, or the vehicle's anti-replay parameters are used to identify multiple upgrades of the vehicle.
  11. 根据权利要求1-10任一项所述的方法,其特征在于,在所述第一升级包为所述第一完整性信息标识的升级包的情况下,所述第一完整性信息包括一个或多个参数,所述一个或多个参数用于标识所述第一升级包。 The method according to any one of claims 1 to 10, characterized in that, when the first upgrade package is an upgrade package identified by the first integrity information, the first integrity information includes a or multiple parameters, the one or more parameters are used to identify the first upgrade package.
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述第一文件还包括:第一公钥;所述车辆预存有所述第一服务器的公钥的第一标识,所述车辆使用第一服务器的公钥校验所述第一签名之前,所述方法还包括:The method according to any one of claims 1-11, characterized in that the first file further includes: a first public key; the vehicle has a first identifier of the public key of the first server pre-stored, so Before the vehicle uses the public key of the first server to verify the first signature, the method further includes:
    所述车辆确定所述第一公钥的标识;The vehicle determines the identity of the first public key;
    在所述第一公钥的标识和所述第一标识相同的情况下,所述车辆确定所述第一公钥为所述第一服务器的公钥。When the identifier of the first public key is the same as the first identifier, the vehicle determines that the first public key is the public key of the first server.
  13. 根据权利要求1-12任一项所述的方法,其特征在于,所述第一文件中还包括:第一公钥,和,根据所述第一公钥确定的第二签名,所述车辆使用第一服务器的公钥校验所述第一签名之前,所述方法还包括:The method according to any one of claims 1 to 12, characterized in that the first file further includes: a first public key, and a second signature determined according to the first public key, the vehicle Before verifying the first signature using the public key of the first server, the method further includes:
    所述车辆使用第二服务器的公钥校验所述第二签名;其中,所述第二服务器为开发并提供所述车辆升级所需的升级包的服务器;The vehicle uses the public key of a second server to verify the second signature; wherein the second server is a server that develops and provides an upgrade package required for the vehicle upgrade;
    在所述第二签名的校验通过的情况下,所述车辆确定所述第一公钥为所述第一服务器的公钥。If the verification of the second signature passes, the vehicle determines that the first public key is the public key of the first server.
  14. 根据权利要求13所述的方法,其特征在于,所述车辆存储有所述第一公钥的用途信息,所述用途信息用于指示所述第一公钥仅用于校验所述第一签名。The method of claim 13, wherein the vehicle stores usage information of the first public key, and the usage information is used to indicate that the first public key is only used to verify the first public key. sign.
  15. 根据权利要求1-14任一项所述的方法,其特征在于,所述车辆使用第一服务器的公钥校验所述第一签名之前,所述方法还包括:The method according to any one of claims 1 to 14, characterized in that before the vehicle uses the public key of the first server to verify the first signature, the method further includes:
    所述车辆确定所述第一公钥为所述第一服务器允许所述车辆使用的公钥。The vehicle determines that the first public key is a public key that the first server allows the vehicle to use.
  16. 根据权利要求1,2,4-6,8,9任一项所述的方法,其特征在于,所述车辆的车辆标识用于标识所述车辆的第一部件;The method according to any one of claims 1, 2, 4-6, 8, 9, characterized in that the vehicle identification of the vehicle is used to identify the first component of the vehicle;
    所述车辆根据所述第一升级包进行升级,具体包括:The vehicle is upgraded according to the first upgrade package, which specifically includes:
    所述车辆根据所述第一升级包进行所述第一部件或第二部件的升级,所述第二部件的升级由所述第一部件管理。The vehicle upgrades the first component or the second component according to the first upgrade package, and the upgrade of the second component is managed by the first component.
  17. 根据权利要求16所述的方法,其特征在于,在所述车辆升级所述第二部件的情况下,所述车辆的身份标识还用于标识第三部件。The method of claim 16, wherein when the vehicle upgrades the second component, the vehicle's identity is also used to identify a third component.
  18. 根据权利要求17所述的方法,其特征在于,所述车辆通过所述第一部件校验所述第一文件,或者,所述车辆通过所述第一部件和所述第三部件校验所述第一文件。The method of claim 17, wherein the vehicle verifies the first file through the first component, or the vehicle verifies the first file through the first component and the third component. Describe the first document.
  19. 根据权利要求2,5-10任一项所述的方法,其特征在于,所述第一文件还包括:第二完整性信息,所述第一签名还根据所述第二完整性信息确定,The method according to any one of claims 2 and 5-10, wherein the first file further includes: second integrity information, and the first signature is further determined based on the second integrity information,
    所述车辆确定升级后的所述车辆的数据包括所述第一完整性信息指示的升级包中的数据,具体包括:The vehicle determines that the data of the upgraded vehicle includes data in the upgrade package indicated by the first integrity information, specifically including:
    所述车辆确定所述升级后的车辆的数据与所述第二完整性信息指示的数据相同,所述第二完整性信息指示的数据包括所述第一升级包中的数据。 The vehicle determines that the data of the upgraded vehicle is the same as the data indicated by the second integrity information, and the data indicated by the second integrity information includes the data in the first upgrade package.
  20. 根据权利要求1-19任一项所述的方法,其特征在于,所述第一文件还包括:第三完整性信息,所述第一签名还根据所述第三完整性信息确定,在所述第一签名的校验通过的情况下,所述第三完整性信息用于指示所述车辆升级失败后的数据。The method according to any one of claims 1 to 19, characterized in that the first file further includes: third integrity information, the first signature is further determined based on the third integrity information, in which If the verification of the first signature passes, the third integrity information is used to indicate the data after the vehicle upgrade fails.
  21. 根据权利要求1-20任一项所述的方法,其特征在于,所述第一升级包中包括第三签名和/或第四签名,所述第三签名由所述第一服务器签名得到,所述第四签名由第二服务器签名得到,所述第二服务器为开发并提供所述车辆升级所需的升级文件的服务器;The method according to any one of claims 1 to 20, characterized in that the first upgrade package includes a third signature and/or a fourth signature, and the third signature is obtained by signing the first server, The fourth signature is obtained by a second server signature, and the second server is a server that develops and provides upgrade files required for the vehicle upgrade;
    所述车辆根据所述第一升级包进行升级之前,所述方法还包括:Before the vehicle is upgraded according to the first upgrade package, the method further includes:
    所述车辆使用所述第一服务器的公钥校验所述第三签名,且校验通过;The vehicle uses the public key of the first server to verify the third signature, and the verification passes;
    和/或,and / or,
    所述车辆使用所述第二服务器的公钥校验所述第四签名,且校验通过。The vehicle uses the public key of the second server to verify the fourth signature, and the verification passes.
  22. 根据权利要求1-21任一项所述的方法,其特征在于,所述车辆接收到第一文件和第一升级包之前,所述方法还包括:The method according to any one of claims 1-21, characterized in that before the vehicle receives the first file and the first upgrade package, the method further includes:
    所述车辆接收到升级策略;The vehicle receives an upgrade policy;
    所述车辆根据所述升级策略确定第一地址,所述第一地址为存储所述第一升级包的地址;The vehicle determines a first address according to the upgrade strategy, and the first address is an address where the first upgrade package is stored;
    所述车辆向所述第一地址所在的服务器发送下载请求,所述下载请求用于请求获取所述第一升级包。The vehicle sends a download request to the server where the first address is located, and the download request is used to request to obtain the first upgrade package.
  23. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    第一服务器获取车辆的车辆标识;The first server obtains the vehicle identification of the vehicle;
    所述第一服务器确定升级包的完整性信息,所述完整性信息用于标识所述升级包;The first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package;
    所述第一服务器根据所述车辆标识和所述完整性信息确定签名;所述第一服务器发送文件和所述升级包,所述文件包括:所述车辆标识、所述完整性信息和所述签名;所述升级包用于升级所述车辆。The first server determines a signature based on the vehicle identification and the integrity information; the first server sends a file and the upgrade package, the file includes: the vehicle identification, the integrity information and the Signature; the upgrade package is used to upgrade the vehicle.
  24. 根据权利要求23所述的方法,其特征在于,所述第一服务器根据所述车辆标识和所述完整性信息确定签名,具体包括:The method of claim 23, wherein the first server determines a signature based on the vehicle identification and the integrity information, specifically including:
    所述第一服务器根据防重放参数、所述车辆标识和所述完整性信息确定所述签名,所述防重放参数用于标识所述车辆本次的升级。The first server determines the signature based on anti-replay parameters, the vehicle identification and the integrity information, and the anti-replay parameters are used to identify the current upgrade of the vehicle.
  25. 一种车辆校验方法,其特征在于,所述方法包括:A vehicle verification method, characterized in that the method includes:
    所述第一服务器确定升级包的完整性信息,所述完整性信息用于标识所述升级包;The first server determines the integrity information of the upgrade package, and the integrity information is used to identify the upgrade package;
    第一服务器根据防重放参数和所述完整性信息确定签名,所述防重放参数用于标识车辆本次的升级;The first server determines a signature based on anti-replay parameters and the integrity information, where the anti-replay parameters are used to identify this upgrade of the vehicle;
    所述第一服务器发送文件和所述升级包,所述文件包括:所述防重放参数、所述完整性信息和所述签名;所述升级包用于升级所述车辆。The first server sends a file and the upgrade package, where the file includes: the anti-replay parameters, the integrity information and the signature; the upgrade package is used to upgrade the vehicle.
  26. 根据权利要求25所述的方法,其特征在于,所述第一服务器根据所述防重放参数和所述完整性信息确定签名,具体包括:The method of claim 25, wherein the first server determines a signature based on the anti-replay parameter and the integrity information, specifically including:
    所述第一服务器根据所述防重放参数、所述车辆的车辆标识和所述完整性信息确定所述 签名。The first server determines the anti-replay parameter, the vehicle identification of the vehicle and the integrity information. sign.
  27. 根据权利要求23-26任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 23-26, characterized in that the method further includes:
    所述第一服务器发送第一列表,所述第一列表指示了所述第一服务器允许或禁止所述车辆校验所述签名时,使用的公钥。The first server sends a first list indicating the public keys used when the first server allows or prohibits the vehicle from verifying the signature.
  28. 根据权利要求23-27任一项所述的方法,其特征在于,所述文件还包括所述第一服务器生成的,用于校验所述签名的公钥。The method according to any one of claims 23 to 27, characterized in that the file further includes a public key generated by the first server and used to verify the signature.
  29. 根据权利要求28所述的方法,其特征在于,所述文件还包括所述公钥的签名,所述第一服务器发送文件和升级包之前,所述方法还包括:The method of claim 28, wherein the file further includes a signature of the public key, and before the first server sends the file and the upgrade package, the method further includes:
    所述第一服务器向第二服务器发送所述公钥,所述第二服务器为开发并提供所述车辆升级所需的升级文件的服务器;The first server sends the public key to a second server, and the second server is a server that develops and provides upgrade files required for the vehicle upgrade;
    所述第一服务器接收所述公钥的签名,所述公钥的签名由所述第二服务器根据所述公钥确定。The first server receives the signature of the public key, and the signature of the public key is determined by the second server based on the public key.
  30. 一种车辆,其特征在于,包括存储器,一个或多个处理器,以及一个或多个程序;所述一个或多个处理器在执行所述一个或多个程序时,使得所述车辆实现如权利要求1至22任一项所述的方法。A vehicle, characterized in that it includes a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the vehicle implements the following: The method of any one of claims 1 to 22.
  31. 一种电子设备,其特征在于,包括存储器,一个或多个处理器,以及一个或多个程序;所述一个或多个处理器在执行所述一个或多个程序时,使得所述电子设备实现如权利要求23至29任一项所述的方法。An electronic device, characterized in that it includes a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device causes the electronic device to Implement the method as claimed in any one of claims 23 to 29.
  32. 一种通信系统,其特征在于,所述系统包括如权利要求30所述的车辆和如权利要求31所述的电子设备。A communication system, characterized in that the system includes the vehicle as claimed in claim 30 and the electronic device as claimed in claim 31.
  33. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1至22,或,23至29任一项所述的方法。 A computer-readable storage medium comprising instructions, characterized in that when the instructions are run on an electronic device, the electronic device is caused to execute the method described in any one of claims 1 to 22, or 23 to 29. method.
PCT/CN2023/097264 2022-06-01 2023-05-30 Vehicle verification method, and related apparatus and system WO2023232045A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210618805.7A CN117195216A (en) 2022-06-01 2022-06-01 Vehicle verification method, related device and system
CN202210618805.7 2022-06-01

Publications (1)

Publication Number Publication Date
WO2023232045A1 true WO2023232045A1 (en) 2023-12-07

Family

ID=89004039

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/097264 WO2023232045A1 (en) 2022-06-01 2023-05-30 Vehicle verification method, and related apparatus and system

Country Status (2)

Country Link
CN (1) CN117195216A (en)
WO (1) WO2023232045A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090119657A1 (en) * 2007-10-24 2009-05-07 Link Ii Charles M Methods and systems for software upgrades
CN109495307A (en) * 2018-11-27 2019-03-19 北京车和家信息技术有限公司 Method for upgrading system, OTA upgrade package encryption method, terminal device and vehicle
CN110378153A (en) * 2019-07-18 2019-10-25 上海擎感智能科技有限公司 A kind of upgrade package safety downloading method and system
CN112640500A (en) * 2020-09-27 2021-04-09 华为技术有限公司 Vehicle upgrading method and device
CN112907769A (en) * 2019-11-15 2021-06-04 天地融科技股份有限公司 Vehicle-mounted unit management method and system based on pre-installation and step-by-step information writing
CN112913209A (en) * 2021-01-27 2021-06-04 华为技术有限公司 Service authorization management method and device
CN113170003A (en) * 2021-03-09 2021-07-23 华为技术有限公司 Method for acquiring file through over-the-air OTA technology and related equipment
WO2022010492A1 (en) * 2020-07-10 2022-01-13 Harman International Industries, Incorporated System and method for detecting traffic pole attacks for vehicles

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090119657A1 (en) * 2007-10-24 2009-05-07 Link Ii Charles M Methods and systems for software upgrades
CN109495307A (en) * 2018-11-27 2019-03-19 北京车和家信息技术有限公司 Method for upgrading system, OTA upgrade package encryption method, terminal device and vehicle
CN110378153A (en) * 2019-07-18 2019-10-25 上海擎感智能科技有限公司 A kind of upgrade package safety downloading method and system
CN112907769A (en) * 2019-11-15 2021-06-04 天地融科技股份有限公司 Vehicle-mounted unit management method and system based on pre-installation and step-by-step information writing
WO2022010492A1 (en) * 2020-07-10 2022-01-13 Harman International Industries, Incorporated System and method for detecting traffic pole attacks for vehicles
CN112640500A (en) * 2020-09-27 2021-04-09 华为技术有限公司 Vehicle upgrading method and device
CN112913209A (en) * 2021-01-27 2021-06-04 华为技术有限公司 Service authorization management method and device
CN113170003A (en) * 2021-03-09 2021-07-23 华为技术有限公司 Method for acquiring file through over-the-air OTA technology and related equipment

Also Published As

Publication number Publication date
CN117195216A (en) 2023-12-08

Similar Documents

Publication Publication Date Title
den Hartog et al. Security and privacy for innovative automotive applications: A survey
US11755713B2 (en) System and method for controlling access to an in-vehicle communication network
Pan et al. Cyber security attacks to modern vehicular systems
Bernardini et al. Security and privacy in vehicular communications: Challenges and opportunities
Sagstetter et al. Security challenges in automotive hardware/software architecture design
Guette et al. Using tpms to secure vehicular ad-hoc networks (vanets)
CN108207039B (en) Safe transmission method of vehicle-mounted data, external equipment and vehicle-mounted gateway
Othmane et al. A survey of security and privacy in connected vehicles
CN111279310A (en) Vehicle-mounted equipment upgrading method and related equipment
JP2019519853A (en) Specially programmed computing system having associated devices configured to implement secure lockdown and method of use thereof
Koushanfar et al. EDA for secure and dependable cybercars: Challenges and opportunities
WO2013123057A1 (en) Trusted connected vehicle systems and methods
Petri et al. Evaluation of lightweight TPMs for automotive software updates over the air
Ammar et al. Securing the on-board diagnostics port (obd-ii) in vehicles
US20210012591A1 (en) Data storage device and non-transitory tangible computer readable storage medium
WO2023232045A1 (en) Vehicle verification method, and related apparatus and system
Efstathiadis et al. Smart cars and over-the-air updates
Schweppe Security and privacy in automotive on-board networks
Apvrille et al. Design and Verification of Secure Autonomous Vehicles
WO2021207986A1 (en) Data verification method and apparatus
Rumez et al. Security hardening of automotive networks through the implementation of attribute-based plausibility checks
Prathap et al. Penetration Testing of Vehicle ECUs
WO2024032438A1 (en) Secure access method and system for vehicle, and related apparatus
Tratter et al. Shared Mobility for Transport and Its Environmental Impact VeSIPreS: A Vehicular Soft Integrity Preservation Scheme for Shared Mobility
Oka Securing the automotive critical infrastructure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23815223

Country of ref document: EP

Kind code of ref document: A1