WO2019003362A1 - In-vehicle system and count updating method - Google Patents

In-vehicle system and count updating method Download PDF

Info

Publication number
WO2019003362A1
WO2019003362A1 PCT/JP2017/023823 JP2017023823W WO2019003362A1 WO 2019003362 A1 WO2019003362 A1 WO 2019003362A1 JP 2017023823 W JP2017023823 W JP 2017023823W WO 2019003362 A1 WO2019003362 A1 WO 2019003362A1
Authority
WO
WIPO (PCT)
Prior art keywords
received
count value
vehicle
serial number
mac value
Prior art date
Application number
PCT/JP2017/023823
Other languages
French (fr)
Japanese (ja)
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 富士通株式会社
Priority to PCT/JP2017/023823 priority Critical patent/WO2019003362A1/en
Publication of WO2019003362A1 publication Critical patent/WO2019003362A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks

Definitions

  • the present invention relates to an in-vehicle system and a count updating method.
  • MAC Message Authentication Code
  • a transmitting ECU that transmits a message calculates a MAC value from the message, and notifies the receiving ECU of the MAC value and the message. Then, the receiving ECU calculates a MAC value from the received message, performs MAC verification between the MAC value received from the transmitting ECU and the calculated MAC value, and determines the authenticity of the received message based on the verification result. Do. For example, when the MAC values match, the receiving ECU determines that the verification result is OK, and determines that the received message is authentic. Further, for example, when the MAC values do not match, the receiving-side ECU determines that the verification result is NG, and determines that the received message is not authentic.
  • the transmitting ECU transmits the message and the MAC value in a broadcast manner. And each ECU is in the state which can receive a message and a MAC value.
  • the MAC values may coincide and the verification result may be OK. Therefore, in order to avoid such a situation, retransmission is performed by using a serial number synchronized between the transmitting ECU and the receiving ECU, and setting the MAC value to be different when the serial number is different even with the same message. You can avoid the attack.
  • the receiving side ECU when a dropout of a message occurs between the transmitting side ECU and the receiving side ECU, the receiving side ECU can not receive the message, and the serial number can not be counted up. Further, in the in-vehicle system, the serial number is reset even when the receiving ECU restarts. As a result, a serial number mismatch occurs between the transmitting ECU and the receiving ECU, and the verification result is NG due to the mismatch of the MAC values, and the received message is discarded. Therefore, in the in-vehicle system, a method of notifying the serial number from the transmitting side ECU to the receiving side ECU is adopted. In order to notify the receiving ECU of a serial number in addition to the MAC value for each message, the transmitting ECU establishes synchronization between the transmitting ECU and the receiving ECU with the received serial number.
  • the transmitting side ECU since the transmitting side ECU notifies the receiving side ECU of the serial number for each message, the amount of data communication between the transmitting side ECU and the receiving side ECU is increased. That is, the amount of data communication between the transmitting on-vehicle apparatus as the transmitting ECU and the receiving on-vehicle apparatus as the receiving ECU increases.
  • An object of the present invention is to provide an on-vehicle system and the like for reducing the amount of data communication.
  • the same internal count value is held between the transmitting on-vehicle apparatus and the receiving on-vehicle apparatus in the vehicle, and the receiving on-vehicle apparatus receives from the transmitting on-vehicle apparatus based on the internal count value.
  • It is an in-vehicle system which specifies the delivery order of the collected data.
  • the transmitting on-vehicle apparatus includes a first signal including an authentication value identifying authenticity of data to be transmitted, and a communication unit that selectively transmits a second signal including a count value in addition to the authentication value. .
  • the receiving in-vehicle apparatus determines whether the received signal includes the count value, and when the received signal includes the count value, the apparatus holds the signal based on the count value. And an update unit that updates the internal count value.
  • FIG. 1 is a block diagram showing an example of the in-vehicle system of the present embodiment.
  • FIG. 2 is an explanatory view showing an example of a hardware configuration in the ECU.
  • FIG. 3 is an explanatory view showing an example of the configuration of a data frame.
  • FIG. 4 is an explanatory view showing an example of the configuration of the first authentication frame.
  • FIG. 5 is an explanatory view showing an example of the configuration of the second authentication frame.
  • FIG. 6 is an explanatory diagram of an example of a functional configuration in the CPU.
  • FIG. 7 is a flowchart showing an example of the processing operation of the transmission side ECU involved in the transmission processing.
  • FIG. 8 is a flow chart showing an example of the processing operation of the reception side ECU related to the first reception processing.
  • FIG. 9 is a sequence diagram showing an example of processing operation related to data communication between the transmission side ECU and the reception side ECU.
  • FIG. 10 is a flow chart showing an example of the processing operation of the reception
  • FIG. 1 is a block diagram showing an example of the in-vehicle system 1 of the present embodiment.
  • An in-vehicle system 1 shown in FIG. 1 has a plurality of ECUs (Electronic Controller Units) 2 mounted on a vehicle 1 A, and each ECU 2 communicates and connects via a CAN (Controller Area Network) 3.
  • the ECU 2 is a device that controls control of various devices in the vehicle 1A.
  • the ECUs 2 are, for example, n ECUs # 1 to #n.
  • the ECU 2 of # 1 is a transmitter ECU 2A that transmits a message
  • the ECU 2 of #n is a receiver ECU 2B that receives a message.
  • the transmitting side ECU 2A corresponds to a transmitting side in-vehicle device
  • the receiving side ECU 2B corresponds to a receiving side in-vehicle device.
  • FIG. 2 is an explanatory view showing an example of a hardware configuration in the ECU 2.
  • the ECU 2 illustrated in FIG. 2 includes a communication unit 11, a read only memory (ROM) 12, a random access memory (RAM) 13, and a central processing unit (CPU) 14.
  • the communication unit 11 is a communication interface that manages communication with the CAN 3.
  • the ROM 12 is an area for storing various information such as various programs.
  • the RAM 13 is an area for storing various information.
  • the CPU 14 controls the entire ECU 2.
  • each ECU 2 When transmitting each data frame in a broadcast manner, each ECU 2 also transmits in a broadcast manner an authentication frame for verifying the authenticity of the message in the data frame.
  • the authentication frame includes a first authentication frame 32, which is a first signal, and a second authentication frame 33, which is a second signal.
  • FIG. 3 is an explanatory view showing an example of the configuration of the data frame 31.
  • a data frame 31 shown in FIG. 3 is a frame for storing data.
  • the data frame 31 has a CAN ID 31A and data 31B that is 5 bytes long.
  • the CAN ID 31A is an ID for identifying the content type of the CAN command.
  • the data 31B is, for example, state information of each part in units of 1 byte.
  • a CANID table 13A is stored that associates a CAN command with each CANID.
  • FIG. 4 is an explanatory view showing an example of the configuration of the first authentication frame 32.
  • the first authentication frame 32 shown in FIG. 4 has a CAN ID 32A and an 8-byte MAC value 32B.
  • the first authentication frame 32 is a first signal carrying a MAC value for verifying the authenticity of the MAC verification target message.
  • the CAN ID 32A is an ID for identifying the first authentication frame 32, and is, for example, "zzzh”.
  • the 8-byte long MAC value 32B is an 8-byte long MAC value calculated by an encryption algorithm based on a MAC verification target message, a CAN ID for identifying the MAC verification target message, an internal serial number, and a common key.
  • the internal serial number is the count value being counted by the counter unit 27.
  • the common key corresponds to the common key used to calculate the MAC value, and is the common key stored in the key management unit 22.
  • the MAC value 32B is constituted by 64 bits of 8 bytes, for example, but in order to maintain security strength, it is desirable that the MAC value 32B be 64 bits or more in consideration of collision of MAC values.
  • FIG. 5 is an explanatory view showing an example of the configuration of the second authentication frame 33.
  • the second authentication frame 33 shown in FIG. 5 has a CAN ID 33A, a 2-byte long serial number 33B, and a 6-byte long MAC value 33C.
  • the second authentication frame 33 is a second signal carrying a MAC value and a serial number for verifying the authenticity of the MAC verification target message.
  • the CAN ID 33A is an ID for identifying the second authentication frame 33, and is, for example, "yyyh”.
  • the 2-byte serial number 33 B is a count value being counted by the counter unit 27.
  • the serial number 33B defines the delivery order of MAC verification target messages.
  • the 6-byte MAC value 33C is the upper 6 bytes from the 8-byte MAC value calculated by the encryption algorithm based on the MAC verification target message, CANID for identifying the MAC verification target message, the internal serial number, and the common key. It is the MAC value which truncated the minute.
  • FIG. 6 is an explanatory view showing an example of a functional configuration in the CPU 14.
  • the CPU 14 illustrated in FIG. 6 includes a generation unit 21, a key management unit 22, a frame communication unit 23, an analysis unit 24, a calculation unit 25, a verification unit 26, a counter unit 27, and an update unit 28.
  • the generation unit 21 generates frames such as the data frame 31, the first authentication frame 32, and the second authentication frame 33, for example.
  • the key management unit 22 stores a common key used when each ECU 2 of the in-vehicle system 1 calculates the MAC value.
  • the frame communication unit 23 is a communication unit that communicates various frames through the communication unit 11.
  • the frame communication unit 23 transmits a frame to the CAN 3 when the transmission side ECU 2A is itself.
  • the frame communication unit 23 receives a frame from the CAN 3 when it is the receiving ECU 2B.
  • the analysis unit 24 analyzes the frame content of the received frame.
  • the analysis unit 24 refers to the CANID in the received frame to identify the frame type.
  • the analysis unit 24 refers to the CANID in the received frame, determines that the authentication frame 32 is the first authentication frame 32 when the CANID is “zzzh”, and determines the second authentication frame 33 when the CANID is “yyyh”.
  • the calculation unit 25 calculates the MAC value based on, for example, the message to be transmitted, the CAN ID, the internal serial number, and the common key.
  • the message is a message subject to MAC verification.
  • CANID is an ID for identifying a message.
  • the verification unit 26 compares and collates the calculated MAC value calculated by the calculation unit 25 with the received MAC value which is the MAC value in the authentication frame, and performs MAC verification based on the comparison result. If the calculation unit 25 is the transmitting ECU 2A, the calculation unit 25 calculates an 8-byte MAC value based on the MAC verification target message, the CAN ID of the MAC verification target message, the internal serial number, and the common key.
  • the generating unit 21 uses the CANID 32A for identifying the first authentication frame 32, and the 8-byte MAC value 32B calculated by the calculating unit 25. Generate 32 In addition, when generating the second authentication frame 33, the generation unit 21 uses the CANID 33A for identifying the second authentication frame 33, the 2-byte long internal serial number 33B, and the 6-byte long MAC value 33C. The second authentication frame 33 is generated.
  • the 6-byte MAC value 33C is a 6-byte MAC value obtained by truncating the upper 6 bytes from the 8-byte MAC value calculated by the calculating unit 25.
  • the calculation unit 25 determines the verification target message in the data frame 31, the CAN ID of the verification target message, the internal serial number, and the common key.
  • the calculated MAC value of 8 bytes is calculated.
  • the message in the received data frame is a MAC verification target message that is an authentication target of the first authentication frame 32.
  • the internal serial number is a serial number being counted by the counter unit 27 in the receiving side ECU 2B.
  • the common key is a common key stored in the key management unit 22 in the receiving side ECU 2B.
  • the verification unit 26 When the verification unit 26 is the receiving ECU 2 B and receives the first authentication frame 32, the calculated MAC value of 8 bytes long and the reception MAC of 8 bytes long in the first authentication frame 32. Compare and match values. If the calculated MAC value matches the received MAC value, the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and determines that the received message is not authentic.
  • the calculation unit 25 when the calculation unit 25 is the receiving ECU 2B and receives the second authentication frame 33, the check target message in the data frame 31, the CAN ID of the check target message, the internal serial number, and the common key The MAC value of 8 bytes is calculated based on Furthermore, the calculation unit 25 truncates the MAC value for the upper 6 bytes from the MAC value for 8 bytes to obtain a calculated MAC value having a length of 6 bytes.
  • the verification unit 26 receives the second authentication frame 33, the verification unit 26 compares and collates the calculated MAC value of 6 byte length with the reception MAC value of 6 byte length in the second authentication frame 33.
  • the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and requests the calculation unit 25 to calculate the MAC value using the serial number in the second authentication frame 33.
  • the calculation unit 25 is the receiving ECU 2B and the verification result is NG, the message in the received data frame 31, the CANID of the message, the received serial number in the second authentication frame 33, and the common in the received data frame 31 are common. Based on the key, a MAC value of 8 bytes is calculated. Furthermore, the calculation unit 25 truncates the MAC value of the upper 6 bytes from the MAC value of 8 bytes to obtain a calculated MAC value. The verification unit 26 compares and collates the calculated MAC value of 6 byte length calculated using the serial number in the second authentication frame 33 with the received MAC value of 6 byte length in the second authentication frame 33. .
  • the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and determines that the received message is not authentic.
  • the frame communication unit 23 transmits the first authentication frame 32 when transmitting the data frame 31. Furthermore, the frame communication unit 23 transmits the second authentication frame 33 instead of the first authentication frame 32 at one time every five times of the first authentication frame 32.
  • the transmission interval of the first authentication frame is, for example, 10 ms, but the setting can be changed as appropriate.
  • the updating unit 28 receives the second authentication frame 33, and when the comparison result between the calculated MAC value and the received MAC value is OK, the internal number being counted by the counter unit 27 with the serial number in the second authentication frame 33. Change serial number. Furthermore, when the comparison result between the calculated MAC value calculated using the serial number in the second authentication frame 33 and the received MAC value is OK, the updating unit 28 determines the serial number in the second authentication frame 33. The counter unit 27 compares it with the internal serial number being counted. When the serial number in the second authentication frame 33 is within the allowable range, the updating unit 28 changes the internal serial number being counted to the counter unit 27 with the serial number in the second authentication frame 33.
  • the allowable range is that the serial number in the second authentication frame 33 is larger than the internal serial number being counted by the counter unit 27, and the error between the serial numbers is within a predetermined number.
  • the verification unit 26 discards the received message. If the serial number in the second authentication frame 33 is out of the allowable range, for example, the serial number in the second authentication frame 33 is smaller than the internal serial number being counted, the verification unit 26 determines that the received message is a retransmission attack. It will judge and discard the received message.
  • the counter unit 27 counts up the serial number at a predetermined timing.
  • the counter unit 27 is the transmitting ECU 2A, after transmitting the data frame 31, the counter unit 27 increments the internal serial number being counted by +1.
  • the counter unit 27 is the receiving ECU 2B, the counter unit 27 increments the internal serial number being counted by +1 after receiving the data frame 31.
  • FIG. 7 is a flowchart showing an example of the processing operation of the transmission side ECU 2A involved in the transmission processing.
  • the calculation unit 25 in the CPU 14 in the transmission side ECU 2A determines whether or not the message to be verified and the CANID have been acquired (step S11).
  • the calculation unit 25 acquires the internal serial number being counted from the counter unit 27 (step S12).
  • the calculation unit 25 calculates an 8-byte MAC value based on the verification target message, the CANID of the verification target message, the internal serial number, and the common key (step S13).
  • the generation unit 21 in the CPU 14 determines whether the present time is the transmission timing of the second authentication frame 33 (step S14).
  • the transmission timing of the second authentication frame 33 is once every five times of the first authentication frame 32.
  • the generation unit 21 If the current time is not the transmission timing of the second authentication frame 33 (No at Step S14), the generation unit 21 generates the first authentication frame 32 (Step S15).
  • the generation unit 21 stores and generates the CANID for identifying the first authentication frame 32 and the 8-byte MAC value calculated in step S13.
  • the frame communication unit 23 in the CPU 14 transmits the data frame 31 and the authentication frame (step S16).
  • the counter unit 27 increments the internal serial number being counted by +1 (step S17), and ends the processing operation shown in FIG.
  • the authentication frame is any one of the first authentication frame 32 and the second authentication frame 33.
  • the calculation unit 25 truncates the upper 6 bytes from the calculated MAC value of the 8-byte length to obtain the calculated MAC value of the 6-byte length (step S18). Furthermore, the generation unit 21 generates a second authentication frame 33 (step S19). The generation unit 21 generates a second authentication frame 33 by storing a calculated MAC value of 6 bytes long, an internal serial number of 2 bytes long, and a CAN ID for identifying the second authentication frame 33. Then, in order to transmit the data frame 31 and the authentication frame 33, the frame communication unit 23 proceeds to step S16.
  • the transmitting side ECU 2A transmits the first authentication frame 32 when transmitting the data frame 31, and the second authentication including the serial number instead of the first authentication frame 32 at one transmission timing every five times.
  • Send frame 33 As a result, by periodically transmitting the second authentication frame 33 including the serial number, the amount of data communication related to the notification of the serial number can be reduced.
  • the second authentication frame 33 includes a MAC value of 6 bytes in length, a serial number of 2 bytes in length, and a CAN ID for identifying the second authentication frame 33.
  • the transmitting ECU 2A can notify the receiving ECU 2B of the MAC value and the serial number.
  • FIG. 8 is a flowchart showing an example of the processing operation of the reception side ECU 2B related to the first reception processing.
  • the frame communication unit 23 in the CPU 14 in the reception side ECU 2B determines whether the data frame 31 and the authentication frame are received from the CAN 3 (step S21).
  • the analysis unit 24 in the CPU 14 receives the data frame 31 and the authentication frame (Yes at Step S21)
  • the analysis unit 24 acquires the CAN ID and the message from the reception data frame 31 (Step S22).
  • the calculating unit 25 acquires the internal serial number being counted from the counter unit 27 (step S23).
  • the calculating unit 25 calculates an 8-byte MAC value based on the message to be authenticated, the CANID of the message to be authenticated, the internal serial number, and the common key (step S24).
  • the verification unit 26 in the CPU 14 determines whether the received authentication frame is the first authentication frame 32 (step S25). If the received authentication frame is the first authentication frame 32 (Yes at step S25), the verification unit 26 extracts an 8-byte MAC value, that is, a received MAC value, from the first authentication frame 32 (step S26).
  • the verification unit 26 compares the calculated MAC value of 8-byte length calculated in step S24 with the received MAC value extracted in step S26 (step S27), and determines whether or not the verification result is OK. (Step S28). The verification unit 26 determines that the verification result is OK when the calculated MAC value and the received MAC value match.
  • Step S28 Yes
  • the internal serial number in the count is incremented by 1 (Step S29)
  • the received message is judged to be authentic (Step S30), and the processing operation shown in FIG. finish.
  • the frame communication unit 23 does not receive the data frame 31 and the authentication frame (No at step S21)
  • the processing operation illustrated in FIG. 8 ends.
  • the verification result is not OK (No at Step S28)
  • the CPU 14 determines that the received message is not authentic, discards the received message (Step S31), and ends the processing operation shown in FIG.
  • the calculation unit 25 determines that the received authentication frame is the second authentication frame 33.
  • the calculation unit 25 truncates the upper 6 bytes from the calculated MAC value of the 8-byte length to calculate the calculated MAC value of the 6-byte length (step S32).
  • the verification unit 26 extracts a reception MAC value having a length of 6 bytes from the second authentication frame 33 (step S33).
  • the verification unit 26 compares the calculated MAC value of 6 byte length calculated in step S32 with the reception MAC value of 6 byte length extracted in step S33 (step S34), and the verification result is OK or not It is determined (step S35).
  • Step S35 If the verification result is OK (Yes at Step S35), the CPU 14 proceeds to Step S29 in order to increment the internal serial number being counted by +1.
  • the calculation unit 25 calculates a MAC value of 6 bytes in length based on the CAN ID in the reception data frame 31, the message, the reception serial number in the second authentication frame 33, and the common key. Is calculated (step S36).
  • the verification unit 26 compares the received MAC value of 6 byte length extracted in step S33 with the calculated MAC value of 6 byte length calculated in step S36 (step S37), and determines whether the verification result is OK or not. Is determined (step S38).
  • the updating unit 28 in the CPU 14 determines whether the reception serial number in the second authentication frame 33 is within the allowable range (Step S39).
  • the updating unit 28 compares the received serial number in the second authentication frame 33 with the internal serial number being counted by the counter unit 27. If the received serial number in the second authentication frame 33 is larger than the internal serial number and the difference between the received serial number and the internal serial number is within a predetermined number, the verification unit 26 determines that the received message is genuine. to decide.
  • the update unit 28 changes the internal serial number being counted by the counter unit 27 to the reception serial number in the second authentication frame 33 (step S40). . Then, the verification unit 26 proceeds to step S30 to determine that the received message is authentic.
  • Step S41 the verification unit 26 discards the received message (Step S41), and ends the processing operation illustrated in FIG. If the received serial number is not within the allowable range (No at Step S39), the verification unit 26 proceeds to Step S41 to discard the received message.
  • the receiving ECU 2B calculates an 8-byte MAC value based on the message in the data frame 31, the CAN ID, the internal serial number, and the common key. Furthermore, the receiving ECU 2B compares and compares the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value matches the received MAC value. Judge that the received message is genuine. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the reception side ECU 2 B compares and collates the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value and the received MAC value do not match, the received message It is determined that is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the receiving ECU 2B calculates an 8-byte MAC value based on the message in the received data frame, the CAN ID, the internal serial number, and the common key.
  • the reception-side ECU 2B truncates the upper 6 bytes from the 8-byte MAC value to obtain a calculated MAC value of 6 bytes.
  • the reception side ECU 2 B compares and collates the calculated MAC value of 6 byte length with the received MAC value of 6 byte length in the second authentication frame 33, and when the calculated MAC value and the received MAC value match, reception serial It is determined whether the number is within the allowable range. When the reception serial number is in the allowable range, the reception ECU 2B determines that the reception message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the receiving ECU 2B changes the internal serial number being counted to the received serial number in the second authentication frame 33.
  • the internal serial number being counted is aligned and the transmitting side ECU 2A and the receiving side ECU 2B You can establish synchronization between serial numbers.
  • the receiving ECU 2B determines that the received message is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • FIG. 9 is a sequence diagram showing an example of processing operation related to data communication between the transmission side ECU 2A and the reception side ECU 2B.
  • the transmission side ECU 2A shown in FIG. 9 calculates a MAC value from the message to be verified, the CANID to be verified, the common key, and the internal serial number "1" (step S51).
  • the transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S52). Furthermore, the transmitting side ECU 2A notifies the receiving side ECU 2B of the second authentication frame 33 storing the MAC value and the internal serial number "1" (step S53). Then, the transmitting side ECU 2A increments the internal serial number “1” being counted by +1 to make the internal serial number “2” (step S54).
  • the reception side ECU 2B calculates the MAC value based on the message to be verified in the data frame 31, the CAN ID to be verified, the common key, and the internal serial number "1". Further, the receiving ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, and sets the verification result as OK (step S55). The receiving ECU 2B increments the internal serial number “1” being counted by +1 to obtain an internal serial number “2” (step S56).
  • the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key, and the internal serial number "2" (step S57).
  • the transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S58).
  • the transmission side ECU 2A notifies the reception side ECU 2B of the first authentication frame 32 storing the MAC value (step S59).
  • the transmitting side ECU 2A increments the internal serial number "2" being counted by +1 to make the internal serial number "3" (step S60).
  • the reception side ECU 2B calculates the MAC value based on the message to be verified in the data frame 31, the CAN ID to be verified, the common key, and the internal serial number "2". Furthermore, the receiving ECU 2B compares the calculated MAC value with the received MAC value in the first authentication frame 32, and sets the verification result as OK (step S61). The reception side ECU 2B increments the serial number “1” being counted by +1 to make the serial number “2” (step S62).
  • the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key and the internal serial number “5” (step S63). .
  • the transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S64). Furthermore, the transmission side ECU 2A notifies the reception side ECU 2B of the first authentication frame 32 storing the MAC value (step S65). Then, the transmitting side ECU 2A increments the internal serial number "5" being counted by +1 to make the internal serial number "6" (step S66).
  • the receiving side ECU 2B causes a message loss that the data frame 31 and the first authentication frame 32 can not be received from the transmitting side ECU 2A due to some failure.
  • the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key, and the internal serial number "6" (step S67).
  • the transmission side ECU 2A notifies the reception ECU 2B of the data frame (step S68).
  • the transmitting side ECU 2A notifies the receiving side ECU 2B of the second authentication frame 33 storing the MAC value and the internal serial number "6" (step S69).
  • the transmitting side ECU 2A increments the internal serial number "6" being counted by +1 to make the internal serial number "7" (step S70).
  • the reception side ECU 2B calculates the MAC value based on the message in the data frame 31, the CAN ID, the common key, and the internal serial number "5". As a result, since the reception side ECU 2B could not receive the data frame 31 of step S64 and the first authentication frame 32 of step S65, the internal serial number being counted remains "6". Therefore, when the reception side ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, the verification result becomes NG (step S71).
  • the receiving ECU 2 B calculates the calculated MAC value based on the CAN ID in the data frame 31, the message, the common key, and the serial number “6” in the second authentication frame 33. Then, the reception side ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, and the verification result is OK (step S72). The receiving ECU 2 B changes the internal serial number “5” being counted to the serial number “6” in the second authentication frame 33. As a result, the reception side ECU 2B can establish synchronization of serial numbers with the transmission side ECU 2A. Then, the reception side ECU 2B increments the internal serial number "6" being counted by +1 to make the internal serial number "7" (step S73).
  • the transmitting side ECU 2A transmits the first authentication frame 32 when transmitting the data frame 31, and the second authentication including the serial number instead of the first authentication frame 32 at a predetermined timing once in five times.
  • Send frame 33 As a result, by periodically transmitting the second authentication frame 33 including the serial number, it is possible to reduce the amount of data communication related to the notification of the serial number between the transmitting ECU 2A and the receiving ECU 2B.
  • the transmitting side ECU 2A notifies the receiving side ECU 2B at a predetermined timing of the second authentication frame 33 including the MAC value of 6 byte length, the serial number of 2 byte length, and the CAN ID for identifying the second authentication frame 33. .
  • the transmission side ECU 2A notifies the second authentication frame 33 at a predetermined timing, it can notify the MAC value and the serial number while reducing the amount of data communication.
  • the reception side ECU 2B can identify the second authentication frame 33 by referring to the CAN ID in the reception frame.
  • the receiving ECU 2B calculates an 8-byte MAC value based on the verification target message in the received data frame 31, CAN ID, internal serial number, and common key. . Furthermore, the receiving ECU 2B compares and compares the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value matches the received MAC value. Judge that the received message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the reception side ECU 2 B compares and collates the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value and the received MAC value do not match, the received message It is determined that is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the receiving ECU 2B calculates an 8-byte MAC value based on the verification target message in the received data frame 31, CAN ID, internal serial number, and common key. .
  • the reception-side ECU 2B truncates the upper 6 bytes from the 8-byte MAC value to obtain a calculated MAC value of 6 bytes.
  • the reception side ECU 2 B compares and collates the calculated MAC value of 6 byte length with the received MAC value of 6 byte length in the second authentication frame 33, and when the calculated MAC value and the received MAC value match, reception serial It is determined whether the number is within the allowable range. When the reception serial number is within the allowable range, the reception side ECU 2B determines that the reception message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the receiving ECU 2B changes the internal serial number being counted to the received serial number in the second authentication frame 33.
  • the internal serial number being counted is aligned and the transmitting side ECU 2A and the receiving side ECU 2B You can establish synchronization between serial numbers.
  • the receiving ECU 2B determines that the received message is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
  • the receiving side ECU 2B compares the received MAC value in the second authentication frame 33 with the received MAC value using the received serial number in the second authentication frame 33, and confirms the verification result OK.
  • the received message was judged as genuine without changing the internal serial number.
  • the present invention is not limited to this, and an embodiment thereof will be described below as Example 2.
  • the same components as those of the in-vehicle system 1 of the first embodiment are denoted by the same reference numerals, and the description of the same components and operations will be omitted.
  • the receiving side ECU 2B calculates using the 6-byte length reception MAC value in the second authentication frame 33 and the reception serial number in the second authentication frame 33.
  • the calculated MAC value of the 6-byte length is compared and collated. Furthermore, when the received MAC value matches the calculated MAC value, the receiving ECU 2 B changes the internal serial number being counted to the received serial number in the second authentication frame 33.
  • FIG. 10 is a flowchart showing an example of the processing operation of the reception side ECU 2B related to the second reception processing.
  • the updating unit 28 determines whether the verification result is OK (step S35A). If the verification result is OK (Yes at Step S35A), the updating unit 28 changes the internal serial number being counted to the reception serial number in the second authentication frame 33 (Step S40A). After changing the internal serial number to the reception serial number in the second verification frame 33, the verification unit 26 proceeds to step S30 in order to determine that the received message is authentic. If the verification result is not OK (No at Step S35), the updating unit 28 proceeds to Step S36 in order to calculate a MAC value having a length of 6 bytes.
  • the receiving ECU 2 B changes the internal serial number being counted to the receiving serial number in the second authentication frame 33. As a result, when receiving the second authentication frame 33, the receiving ECU 2B can synchronize the serial number with the transmitting ECU 2A.
  • the receiving ECU 2B determines whether the received frame is the first authentication frame 32 or the second authentication frame 33 based on the CANID in the received frame. Therefore, different CANIDs are included in the first authentication frame 32 and the second authentication frame 33. However, if there is no CAN ID, it may be determined whether or not there is a serial number in the received frame, and if there is a serial number, it may be determined that the received frame is the second authentication frame.
  • each component of each unit shown in the drawings does not necessarily have to be physically configured as shown in the drawings. That is, the specific form of the dispersion and integration of each part is not limited to the illustrated one, and all or a part thereof is functionally or physically dispersed or integrated in any unit according to various loads, usage conditions, etc. Can be configured.
  • each device is performed by executing all or any part thereof on a CPU (or a microcomputer such as a micro processing unit (MPU) or a micro controller unit (MCU)). Also good.
  • various processing functions may execute all or any part of them on a program analyzed and executed by a CPU (or a microcomputer such as an MPU or an MCU) or on hardware by wired logic. Needless to say.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

This in-vehicle system (1) holds an identical internal count value between a transmission-side in-vehicle device (2A) and a reception-side in-vehicle device (2B) in a vehicle (1A), and regulates a delivery sequence of data which the reception-side in-vehicle device has received from the transmission-side in-vehicle device on the basis of the internal count value. The transmission-side in-vehicle device has a communication unit (23) which selectively transmits a first signal (32) that includes an authentication value for identifying the authenticity of data to be transmitted, and a second signal (33) that includes a count value in addition to the authentication value. The reception-side in-vehicle device has an interpretation unit (24) and an updating unit (28). The interpretation unit determines whether the received signal includes the count value. The updating unit updates, on the basis of the count value, the internal count value held by the own device when the received signal includes the count value. As a result, an amount of data communication between the transmission-side in-vehicle device and the reception-side in-vehicle device can be reduced.

Description

車載システム及びカウント更新方法In-vehicle system and count updating method
 本発明は、車載システム及びカウント更新方法に関する。 The present invention relates to an in-vehicle system and a count updating method.
 車両に搭載されたECU(Electronic Control Unit)間をCAN(Controller Area Network)で接続する車載システムでは、外部環境からのメッセージのなりすましや改ざんを防止するためにMAC(Message Authentication Code)検証機能がある。 In an in-vehicle system that connects ECUs (Electronic Control Units) mounted on a vehicle via a CAN (Controller Area Network), there is a MAC (Message Authentication Code) verification function to prevent spoofing or tampering with messages from the external environment. .
 MAC検証機能は、メッセージを送信する送信側ECUが当該メッセージからMAC値を算出し、MAC値及びメッセージを受信側ECUに通知する。そして、受信側ECUは、受信したメッセージからMAC値を算出し、送信側ECUから受信したMAC値と、算出したMAC値との間でMAC検証し、検証結果に基づき、受信メッセージの真正を判定する。受信側ECUは、例えば、MAC値が一致した場合に検証結果OKと判断し、受信メッセージの真正であると判断する。また、受信側ECUは、例えば、MAC値が不一致の場合に検証結果NGと判断し、受信メッセージが真正でないと判断する。 In the MAC verification function, a transmitting ECU that transmits a message calculates a MAC value from the message, and notifies the receiving ECU of the MAC value and the message. Then, the receiving ECU calculates a MAC value from the received message, performs MAC verification between the MAC value received from the transmitting ECU and the calculated MAC value, and determines the authenticity of the received message based on the verification result. Do. For example, when the MAC values match, the receiving ECU determines that the verification result is OK, and determines that the received message is authentic. Further, for example, when the MAC values do not match, the receiving-side ECU determines that the verification result is NG, and determines that the received message is not authentic.
 送信側ECUは、メッセージ及びMAC値をブロードキャスト方式で送信する。そして、各ECUは、メッセージ及びMAC値が受信可能な状態にある。しかしながら、受信側ECUでは、過去に使用したメッセージが別の機器から再度送信される再送攻撃を受けた場合でも、MAC値が一致して検証結果OKとなる場合がある。そこで、このような事態を回避すべく、送信側ECUと受信側ECUとの間で同期したシリアル番号を使用して同一メッセージでもシリアル番号が異なる場合にMAC値が異なる仕組みとすることで、再送攻撃を回避できる。 The transmitting ECU transmits the message and the MAC value in a broadcast manner. And each ECU is in the state which can receive a message and a MAC value. However, in the receiving ECU, even when a message used in the past is subjected to a re-transmission attack of being re-sent from another device, the MAC values may coincide and the verification result may be OK. Therefore, in order to avoid such a situation, retransmission is performed by using a serial number synchronized between the transmitting ECU and the receiving ECU, and setting the MAC value to be different when the serial number is different even with the same message. You can avoid the attack.
 しかしながら、シリアル番号を採用する場合には、送信側ECUと受信側ECUとの間でシリアル番号を同期させる必要がある。従って、送信側ECUは、メッセージを送信した場合にシリアル番号をカウントアップし、受信側ECUも、メッセージを受信した場合にシリアル番号をカウントアップする。その結果、送信側ECUと受信側ECUとの間でシリアル番号の同期を確立している。  However, when adopting a serial number, it is necessary to synchronize the serial number between the transmitting ECU and the receiving ECU. Therefore, the transmitting ECU counts up the serial number when transmitting the message, and the receiving ECU also counts up the serial number when receiving the message. As a result, synchronization of serial numbers is established between the transmitting ECU and the receiving ECU.
国際公開第2013/065689号International Publication No. 2013/065689 特開2016-96419号公報JP, 2016-96419, A
 しかしながら、車載システムでは、送信側ECUと受信側ECUとの間でメッセージの欠落が生じた場合に受信側ECUでメッセージが受信できず、シリアル番号がカウントアップできなくなる。また、車載システムでは、受信側ECUが再起動した場合でも、シリアル番号がリセットされる。その結果、送信側ECUと受信側ECUとの間でシリアル番号の不整合が生じ、MAC値の不一致で検証結果NGとなるため、受信メッセージが破棄されてしまう。そこで、車載システムでは、送信側ECUから受信側ECUにシリアル番号を通知する方法が採用されている。送信側ECUは、メッセージ毎にMAC値の他にシリアル番号を受信側ECUに通知するため、受信したシリアル番号で送信側ECUと受信側ECUとの間で同期を確立している。 However, in the in-vehicle system, when a dropout of a message occurs between the transmitting side ECU and the receiving side ECU, the receiving side ECU can not receive the message, and the serial number can not be counted up. Further, in the in-vehicle system, the serial number is reset even when the receiving ECU restarts. As a result, a serial number mismatch occurs between the transmitting ECU and the receiving ECU, and the verification result is NG due to the mismatch of the MAC values, and the received message is discarded. Therefore, in the in-vehicle system, a method of notifying the serial number from the transmitting side ECU to the receiving side ECU is adopted. In order to notify the receiving ECU of a serial number in addition to the MAC value for each message, the transmitting ECU establishes synchronization between the transmitting ECU and the receiving ECU with the received serial number.
 しかしながら、車載システムでは、送信側ECUから受信側ECUに対してメッセージ毎にシリアル番号を通知するため、送信側ECUと受信側ECUとの間のデータ通信量が増加してしまう。つまり、送信側ECUである送信側車載装置と受信側ECUである受信側車載装置との間のデータ通信量が増加してしまう。 However, in the in-vehicle system, since the transmitting side ECU notifies the receiving side ECU of the serial number for each message, the amount of data communication between the transmitting side ECU and the receiving side ECU is increased. That is, the amount of data communication between the transmitting on-vehicle apparatus as the transmitting ECU and the receiving on-vehicle apparatus as the receiving ECU increases.
 一つの側面では、データ通信量の削減を図る車載システム等を提供することを目的とする。 An object of the present invention is to provide an on-vehicle system and the like for reducing the amount of data communication.
 一つの案では、車両内の送信側車載装置と受信側車載装置との間で同一の内部カウント値を保持し、前記受信側車載装置が前記内部カウント値に基づき、前記送信側車載装置から受信したデータの送達順序を規定する車載システムである。前記送信側車載装置は、送信対象のデータの真正を識別する認証値を含む第1の信号及び、前記認証値に加えてカウント値を含む第2の信号を選択的に送信する通信部を有する。前記受信側車載装置は、受信した信号が前記カウント値を含むか否かを判定する解析部と、受信した信号が前記カウント値を含む場合に、当該カウント値に基づき、自装置が保持する前記内部カウント値を更新する更新部とを有する。 In one scheme, the same internal count value is held between the transmitting on-vehicle apparatus and the receiving on-vehicle apparatus in the vehicle, and the receiving on-vehicle apparatus receives from the transmitting on-vehicle apparatus based on the internal count value. It is an in-vehicle system which specifies the delivery order of the collected data. The transmitting on-vehicle apparatus includes a first signal including an authentication value identifying authenticity of data to be transmitted, and a communication unit that selectively transmits a second signal including a count value in addition to the authentication value. . The receiving in-vehicle apparatus determines whether the received signal includes the count value, and when the received signal includes the count value, the apparatus holds the signal based on the count value. And an update unit that updates the internal count value.
 データ通信量の削減を図る。 Reduce the amount of data communication.
図1は、本実施例の車載システムの一例を示すブロック図である。FIG. 1 is a block diagram showing an example of the in-vehicle system of the present embodiment. 図2は、ECU内のハードウェア構成の一例を示す説明図である。FIG. 2 is an explanatory view showing an example of a hardware configuration in the ECU. 図3は、データフレームの構成の一例を示す説明図である。FIG. 3 is an explanatory view showing an example of the configuration of a data frame. 図4は、第1の認証フレームの構成の一例を示す説明図である。FIG. 4 is an explanatory view showing an example of the configuration of the first authentication frame. 図5は、第2の認証フレームの構成の一例を示す説明図である。FIG. 5 is an explanatory view showing an example of the configuration of the second authentication frame. 図6は、CPU内の機能構成の一例を示す説明図である。FIG. 6 is an explanatory diagram of an example of a functional configuration in the CPU. 図7は、送信処理に関わる送信側ECUの処理動作の一例を示すフローチャートである。FIG. 7 is a flowchart showing an example of the processing operation of the transmission side ECU involved in the transmission processing. 図8は、第1の受信処理に関わる受信側ECUの処理動作の一例を示すフローチャートである。FIG. 8 is a flow chart showing an example of the processing operation of the reception side ECU related to the first reception processing. 図9は、送信側ECUと受信側ECUとの間のデータ通信に関わる処理動作の一例を示すシーケンス図である。FIG. 9 is a sequence diagram showing an example of processing operation related to data communication between the transmission side ECU and the reception side ECU. 図10は、第2の受信処理に関わる受信側ECUの処理動作の一例を示すフローチャートである。FIG. 10 is a flow chart showing an example of the processing operation of the reception side ECU related to the second reception processing.
 以下、図面に基づいて、本願の開示する車載システム及びカウント更新方法の実施例を詳細に説明する。尚、本実施例により、開示技術が限定されるものではない。また、以下に示す各実施例は、矛盾を起こさない範囲で適宜組み合わせても良い。 Hereinafter, embodiments of the on-vehicle system and the count updating method disclosed in the present application will be described in detail based on the drawings. The disclosed technology is not limited by the present embodiment. In addition, the embodiments described below may be combined appropriately as long as no contradiction occurs.
 図1は、本実施例の車載システム1の一例を示すブロック図である。図1に示す車載システム1は、車両1Aに搭載した複数のECU(Electronic Controller Unit)2を有し、各ECU2はCAN(Controller Area Network)3で通信接続する。ECU2は、車両1A内の各種機器の制御を司る機器である。ECU2は、例えば、#1のECU2~#nのECU2のn台とする。尚、説明の便宜上、例えば、#1のECU2は、メッセージを送信する送信側ECU2A、#nのECU2は、メッセージを受信する受信側ECU2Bとする。送信側ECU2Aは送信側車載装置、受信側ECU2Bは受信側車載装置に相当する。 FIG. 1 is a block diagram showing an example of the in-vehicle system 1 of the present embodiment. An in-vehicle system 1 shown in FIG. 1 has a plurality of ECUs (Electronic Controller Units) 2 mounted on a vehicle 1 A, and each ECU 2 communicates and connects via a CAN (Controller Area Network) 3. The ECU 2 is a device that controls control of various devices in the vehicle 1A. The ECUs 2 are, for example, n ECUs # 1 to #n. For convenience of explanation, for example, the ECU 2 of # 1 is a transmitter ECU 2A that transmits a message, and the ECU 2 of #n is a receiver ECU 2B that receives a message. The transmitting side ECU 2A corresponds to a transmitting side in-vehicle device, and the receiving side ECU 2B corresponds to a receiving side in-vehicle device.
 図2は、ECU2内のハードウェア構成の一例を示す説明図である。図2に示すECU2は、通信部11と、ROM(Read Only Memory)12と、RAM(Random Access Memory)13と、CPU(Central Processing Unit)14とを有する。通信部11は、CAN3との間の通信を司る通信インタフェースである。ROM12は、各種プログラム等の各種情報を記憶する領域である。RAM13は、各種情報を記憶する領域である。CPU14は、ECU2全体を制御する。 FIG. 2 is an explanatory view showing an example of a hardware configuration in the ECU 2. The ECU 2 illustrated in FIG. 2 includes a communication unit 11, a read only memory (ROM) 12, a random access memory (RAM) 13, and a central processing unit (CPU) 14. The communication unit 11 is a communication interface that manages communication with the CAN 3. The ROM 12 is an area for storing various information such as various programs. The RAM 13 is an area for storing various information. The CPU 14 controls the entire ECU 2.
 各ECU2は、データフレームをブロードキャスト方式で送信する場合、データフレーム内のメッセージの真正を検証するための認証フレームもブロードキャスト方式で送信する。尚、認証フレームは、第1の信号である第1の認証フレーム32と、第2の信号である第2の認証フレーム33とがある。 When transmitting each data frame in a broadcast manner, each ECU 2 also transmits in a broadcast manner an authentication frame for verifying the authenticity of the message in the data frame. The authentication frame includes a first authentication frame 32, which is a first signal, and a second authentication frame 33, which is a second signal.
 図3は、データフレーム31の構成の一例を示す説明図である。図3に示すデータフレーム31は、データを格納するフレームである。データフレーム31は、CANID31Aと、5バイト長のデータ31Bとを有する。CANID31Aは、CANコマンドの内容種別を識別するIDである。データ31Bは、例えば、1バイト単位で各部位の状態情報である。尚、RAM13内には、CANID毎にCANコマンドを対応付けるCANIDテーブル13Aが格納されている。 FIG. 3 is an explanatory view showing an example of the configuration of the data frame 31. As shown in FIG. A data frame 31 shown in FIG. 3 is a frame for storing data. The data frame 31 has a CAN ID 31A and data 31B that is 5 bytes long. The CAN ID 31A is an ID for identifying the content type of the CAN command. The data 31B is, for example, state information of each part in units of 1 byte. In the RAM 13, a CANID table 13A is stored that associates a CAN command with each CANID.
 図4は、第1の認証フレーム32の構成の一例を示す説明図である。図4に示す第1の認証フレーム32は、CANID32Aと、8バイト長のMAC値32Bとを有する。第1の認証フレーム32は、MAC検証対象メッセージの真正を検証するMAC値を搭載した第1の信号である。CANID32Aは、第1の認証フレーム32を識別するIDであって、例えば、“zzzh”である。8バイト長のMAC値32Bは、MAC検証対象メッセージと、MAC検証対象メッセージを識別するCANIDと、内部シリアル番号と、共通鍵とに基づく暗号アルゴリズムで算出した8バイト長のMAC値である。尚、内部シリアル番号は、カウンタ部27でカウント中のカウント値である。共通鍵は、MAC値を算出するのに使用する共通鍵に相当し、鍵管理部22に記憶中の共通鍵である。尚、説明の便宜上、MAC値32Bは、例えば、8バイトの64ビットで構成したが、セキュリティ強度を維持すべく、MAC値の衝突を考慮して64ビット以上であることが望ましい。 FIG. 4 is an explanatory view showing an example of the configuration of the first authentication frame 32. As shown in FIG. The first authentication frame 32 shown in FIG. 4 has a CAN ID 32A and an 8-byte MAC value 32B. The first authentication frame 32 is a first signal carrying a MAC value for verifying the authenticity of the MAC verification target message. The CAN ID 32A is an ID for identifying the first authentication frame 32, and is, for example, "zzzh". The 8-byte long MAC value 32B is an 8-byte long MAC value calculated by an encryption algorithm based on a MAC verification target message, a CAN ID for identifying the MAC verification target message, an internal serial number, and a common key. The internal serial number is the count value being counted by the counter unit 27. The common key corresponds to the common key used to calculate the MAC value, and is the common key stored in the key management unit 22. For convenience of explanation, the MAC value 32B is constituted by 64 bits of 8 bytes, for example, but in order to maintain security strength, it is desirable that the MAC value 32B be 64 bits or more in consideration of collision of MAC values.
 図5は、第2の認証フレーム33の構成の一例を示す説明図である。図5に示す第2の認証フレーム33は、CANID33Aと、2バイト長のシリアル番号33Bと、6バイト長のMAC値33Cとを有する。第2の認証フレーム33は、MAC検証対象メッセージの真正を検証するMAC値及びシリアル番号を搭載した第2の信号である。CANID33Aは、第2の認証フレーム33を識別するIDであって、例えば、“yyyh”である。2バイト長のシリアル番号33Bは、カウンタ部27でカウント中のカウント値である。尚、シリアル番号33Bは、MAC検証対象メッセージの送達順序を規定する。6バイト長のMAC値33Cは、MAC検証対象メッセージと、MAC検証対象メッセージを識別するCANIDと、内部シリアル番号と、共通鍵とに基づく暗号アルゴリズムで算出した8バイト長のMAC値から上位6バイト分をトランケートしたMAC値である。 FIG. 5 is an explanatory view showing an example of the configuration of the second authentication frame 33. As shown in FIG. The second authentication frame 33 shown in FIG. 5 has a CAN ID 33A, a 2-byte long serial number 33B, and a 6-byte long MAC value 33C. The second authentication frame 33 is a second signal carrying a MAC value and a serial number for verifying the authenticity of the MAC verification target message. The CAN ID 33A is an ID for identifying the second authentication frame 33, and is, for example, "yyyh". The 2-byte serial number 33 B is a count value being counted by the counter unit 27. The serial number 33B defines the delivery order of MAC verification target messages. The 6-byte MAC value 33C is the upper 6 bytes from the 8-byte MAC value calculated by the encryption algorithm based on the MAC verification target message, CANID for identifying the MAC verification target message, the internal serial number, and the common key. It is the MAC value which truncated the minute.
 図6は、CPU14内の機能構成の一例を示す説明図である。図6に示すCPU14は、生成部21と、鍵管理部22と、フレーム通信部23と、解析部24と、算出部25と、検証部26と、カウンタ部27と、更新部28とを有する。生成部21は、例えば、データフレーム31、第1の認証フレーム32及び第2の認証フレーム33等のフレームを生成する。鍵管理部22は、車載システム1の各ECU2でMAC値を算出する際に使用する共通鍵を記憶している。フレーム通信部23は、通信部11を通じて各種フレームを通信する通信部である。フレーム通信部23は、自分が送信側ECU2Aの場合、CAN3にフレームを送信する。フレーム通信部23は、自分が受信側ECU2Bの場合、CAN3からフレームを受信する。 FIG. 6 is an explanatory view showing an example of a functional configuration in the CPU 14. The CPU 14 illustrated in FIG. 6 includes a generation unit 21, a key management unit 22, a frame communication unit 23, an analysis unit 24, a calculation unit 25, a verification unit 26, a counter unit 27, and an update unit 28. . The generation unit 21 generates frames such as the data frame 31, the first authentication frame 32, and the second authentication frame 33, for example. The key management unit 22 stores a common key used when each ECU 2 of the in-vehicle system 1 calculates the MAC value. The frame communication unit 23 is a communication unit that communicates various frames through the communication unit 11. The frame communication unit 23 transmits a frame to the CAN 3 when the transmission side ECU 2A is itself. The frame communication unit 23 receives a frame from the CAN 3 when it is the receiving ECU 2B.
 解析部24は、受信フレームのフレーム内容を解析する。解析部24は、受信フレーム内のCANIDを参照し、フレーム種別を識別する。解析部24は、受信フレーム内のCANIDを参照し、CANIDが“zzzh”の場合、第1の認証フレーム32と判断し、CANIDが“yyyh”の場合、第2の認証フレーム33と判断する。 The analysis unit 24 analyzes the frame content of the received frame. The analysis unit 24 refers to the CANID in the received frame to identify the frame type. The analysis unit 24 refers to the CANID in the received frame, determines that the authentication frame 32 is the first authentication frame 32 when the CANID is “zzzh”, and determines the second authentication frame 33 when the CANID is “yyyh”.
 算出部25は、例えば、送信対象のメッセージ、CANID、内部シリアル番号及び共通鍵に基づき、MAC値を算出する。メッセージは、MAC検証対象のメッセージである。CANIDは、メッセージを識別するIDである。検証部26は、算出部25で算出した算出MAC値と、認証フレーム内のMAC値である受信MAC値とを比較照合し、その比較結果に基づき、MAC検証する。算出部25は、自分が送信側ECU2Aの場合、MAC検証対象メッセージ、MAC検証対象メッセージのCANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する。生成部21は、第1の認証フレーム32を生成する場合、第1の認証フレーム32を識別するCANID32Aと、算出部25で算出した8バイト長のMAC値32Bとを用いて第1の認証フレーム32を生成する。また、生成部21は、第2の認証フレーム33を生成する場合、第2の認証フレーム33を識別するCANID33Aと、2バイト長の内部シリアル番号33Bと、6バイト長のMAC値33Cとを用いて第2の認証フレーム33を生成する。尚、6バイト長のMAC値33Cは、算出部25で算出した8バイト長のMAC値から上位6バイト分をトランケートした6バイト長のMAC値である。 The calculation unit 25 calculates the MAC value based on, for example, the message to be transmitted, the CAN ID, the internal serial number, and the common key. The message is a message subject to MAC verification. CANID is an ID for identifying a message. The verification unit 26 compares and collates the calculated MAC value calculated by the calculation unit 25 with the received MAC value which is the MAC value in the authentication frame, and performs MAC verification based on the comparison result. If the calculation unit 25 is the transmitting ECU 2A, the calculation unit 25 calculates an 8-byte MAC value based on the MAC verification target message, the CAN ID of the MAC verification target message, the internal serial number, and the common key. When generating the first authentication frame 32, the generating unit 21 uses the CANID 32A for identifying the first authentication frame 32, and the 8-byte MAC value 32B calculated by the calculating unit 25. Generate 32 In addition, when generating the second authentication frame 33, the generation unit 21 uses the CANID 33A for identifying the second authentication frame 33, the 2-byte long internal serial number 33B, and the 6-byte long MAC value 33C. The second authentication frame 33 is generated. The 6-byte MAC value 33C is a 6-byte MAC value obtained by truncating the upper 6 bytes from the 8-byte MAC value calculated by the calculating unit 25.
 算出部25は、自分が受信側ECU2Bの場合であって、第1の認証フレーム32を受信した場合、データフレーム31内の検証対象メッセージ、検証対象メッセージのCANID、内部シリアル番号及び共通鍵に基づき、8バイト分の算出MAC値を算出する。尚、受信データフレーム内のメッセージは、第1の認証フレーム32の認証対象であるMAC検証対象メッセージである。内部シリアル番号は、受信側ECU2B内のカウンタ部27でカウント中のシリアル番号である。共通鍵は、受信側ECU2B内の鍵管理部22に記憶中の共通鍵である。検証部26は、自分が受信側ECU2Bの場合であって、第1の認証フレーム32を受信した場合、8バイト長の算出MAC値と、第1の認証フレーム32内の8バイト長の受信MAC値とを比較照合する。検証部26は、算出MAC値と受信MAC値とが一致する場合、検証結果OKと判断し、受信メッセージが真正と判断する。検証部26は、算出MAC値と受信MAC値とが不一致の場合、検証結果がNGと判断し、受信メッセージが真正でないと判断する。 If the calculation unit 25 is the receiving ECU 2B and receives the first authentication frame 32, the calculation unit 25 determines the verification target message in the data frame 31, the CAN ID of the verification target message, the internal serial number, and the common key. The calculated MAC value of 8 bytes is calculated. The message in the received data frame is a MAC verification target message that is an authentication target of the first authentication frame 32. The internal serial number is a serial number being counted by the counter unit 27 in the receiving side ECU 2B. The common key is a common key stored in the key management unit 22 in the receiving side ECU 2B. When the verification unit 26 is the receiving ECU 2 B and receives the first authentication frame 32, the calculated MAC value of 8 bytes long and the reception MAC of 8 bytes long in the first authentication frame 32. Compare and match values. If the calculated MAC value matches the received MAC value, the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and determines that the received message is not authentic.
 また、算出部25は、自分が受信側ECU2Bの場合であって、第2の認証フレーム33を受信した場合、データフレーム31内の検査対象メッセージ、検査対象メッセージのCANID、内部シリアル番号及び共通鍵に基づき、8バイト分のMAC値を算出する。更に、算出部25は、8バイト分のMAC値から上位6バイト分のMAC値をトランケートして6バイト長の算出MAC値を得る。検証部26は、第2の認証フレーム33を受信した場合、6バイト長の算出MAC値と、第2の認証フレーム33内の6バイト長の受信MAC値とを比較照合する。検証部26は、算出MAC値と受信MAC値とが一致する場合、検証結果OKと判断し、受信メッセージが真正と判断する。検証部26は、算出MAC値と受信MAC値とが不一致の場合、検証結果NGと判断し、第2の認証フレーム33内のシリアル番号を使用したMAC値の算出を算出部25に要求する。 In addition, when the calculation unit 25 is the receiving ECU 2B and receives the second authentication frame 33, the check target message in the data frame 31, the CAN ID of the check target message, the internal serial number, and the common key The MAC value of 8 bytes is calculated based on Furthermore, the calculation unit 25 truncates the MAC value for the upper 6 bytes from the MAC value for 8 bytes to obtain a calculated MAC value having a length of 6 bytes. When the verification unit 26 receives the second authentication frame 33, the verification unit 26 compares and collates the calculated MAC value of 6 byte length with the reception MAC value of 6 byte length in the second authentication frame 33. If the calculated MAC value matches the received MAC value, the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and requests the calculation unit 25 to calculate the MAC value using the serial number in the second authentication frame 33.
 また、算出部25は、自分が受信側ECU2Bの場合であって、検証結果NGの場合、受信データフレーム31内のメッセージ、当該メッセージのCANID、第2の認証フレーム33内の受信シリアル番号及び共通鍵に基づき、8バイト分のMAC値を算出する。更に、算出部25は、8バイト分のMAC値から上位6バイト分のMAC値をトランケートして算出MAC値を得る。検証部26は、第2の認証フレーム33内のシリアル番号を使用して算出した6バイト長の算出MAC値と、第2の認証フレーム33内の6バイト長の受信MAC値とを比較照合する。検証部26は、算出MAC値と受信MAC値とが一致する場合に、検証結果OKと判断し、受信メッセージが真正と判断する。検証部26は、算出MAC値と受信MAC値とが不一致の場合、検証結果NGと判断し、受信メッセージが真正でないと判断する。 If the calculation unit 25 is the receiving ECU 2B and the verification result is NG, the message in the received data frame 31, the CANID of the message, the received serial number in the second authentication frame 33, and the common in the received data frame 31 are common. Based on the key, a MAC value of 8 bytes is calculated. Furthermore, the calculation unit 25 truncates the MAC value of the upper 6 bytes from the MAC value of 8 bytes to obtain a calculated MAC value. The verification unit 26 compares and collates the calculated MAC value of 6 byte length calculated using the serial number in the second authentication frame 33 with the received MAC value of 6 byte length in the second authentication frame 33. . When the calculated MAC value matches the received MAC value, the verification unit 26 determines that the verification result is OK, and determines that the received message is authentic. If the calculated MAC value and the received MAC value do not match, the verification unit 26 determines that the verification result is NG, and determines that the received message is not authentic.
 フレーム通信部23は、データフレーム31を送信する際に第1の認証フレーム32を送信する。更に、フレーム通信部23は、第1の認証フレーム32の5回に1回のタイミングで第1の認証フレーム32の代わりに第2の認証フレーム33を送信する。尚、第1の認証フレームの送信間隔は、例えば、10m秒とするが、適宜設定変更可能である。 The frame communication unit 23 transmits the first authentication frame 32 when transmitting the data frame 31. Furthermore, the frame communication unit 23 transmits the second authentication frame 33 instead of the first authentication frame 32 at one time every five times of the first authentication frame 32. The transmission interval of the first authentication frame is, for example, 10 ms, but the setting can be changed as appropriate.
 更新部28は、第2の認証フレーム33を受信し、算出MAC値と受信MAC値との照合結果がOKの場合に第2の認証フレーム33内のシリアル番号でカウンタ部27にカウント中の内部シリアル番号を変更する。更に、更新部28は、第2の認証フレーム33内のシリアル番号を使用して算出した算出MAC値と受信MAC値との照合結果がOKの場合に、第2の認証フレーム33内のシリアル番号がカウンタ部27にカウント中の内部シリアル番号とを比較する。更新部28は、第2の認証フレーム33内のシリアル番号が許容範囲の場合、第2の認証フレーム33内のシリアル番号でカウンタ部27にカウント中の内部シリアル番号を変更する。尚、許容範囲は、第2の認証フレーム33内のシリアル番号がカウンタ部27にカウント中の内部シリアル番号よりも大で、かつ、そのシリアル番号間の誤差が所定数以内とする。 The updating unit 28 receives the second authentication frame 33, and when the comparison result between the calculated MAC value and the received MAC value is OK, the internal number being counted by the counter unit 27 with the serial number in the second authentication frame 33. Change serial number. Furthermore, when the comparison result between the calculated MAC value calculated using the serial number in the second authentication frame 33 and the received MAC value is OK, the updating unit 28 determines the serial number in the second authentication frame 33. The counter unit 27 compares it with the internal serial number being counted. When the serial number in the second authentication frame 33 is within the allowable range, the updating unit 28 changes the internal serial number being counted to the counter unit 27 with the serial number in the second authentication frame 33. The allowable range is that the serial number in the second authentication frame 33 is larger than the internal serial number being counted by the counter unit 27, and the error between the serial numbers is within a predetermined number.
 検証部26は、第2の認証フレーム33内のシリアル番号が許容範囲外の場合、受信メッセージを破棄する。検証部26は、第2の認証フレーム33内のシリアル番号が許容範囲外、例えば、第2の認証フレーム33内のシリアル番号がカウント中の内部シリアル番号よりも小さい場合は受信メッセージが再送攻撃と判断し、受信メッセージを破棄することになる。 If the serial number in the second authentication frame 33 is out of the allowable range, the verification unit 26 discards the received message. If the serial number in the second authentication frame 33 is out of the allowable range, for example, the serial number in the second authentication frame 33 is smaller than the internal serial number being counted, the verification unit 26 determines that the received message is a retransmission attack. It will judge and discard the received message.
 カウンタ部27は、所定タイミングでシリアル番号をカウントアップする。カウンタ部27は、自分が送信側ECU2Aの場合、データフレーム31を送信した後、カウント中の内部シリアル番号を+1インクリメントする。カウンタ部27は、自分が受信側ECU2Bの場合、データフレーム31を受信した後、カウント中の内部シリアル番号を+1インクリメントする。 The counter unit 27 counts up the serial number at a predetermined timing. When the counter unit 27 is the transmitting ECU 2A, after transmitting the data frame 31, the counter unit 27 increments the internal serial number being counted by +1. When the counter unit 27 is the receiving ECU 2B, the counter unit 27 increments the internal serial number being counted by +1 after receiving the data frame 31.
 次に実施例1の車載システム1の動作について説明する。図7は、送信処理に関わる送信側ECU2Aの処理動作の一例を示すフローチャートである。送信側ECU2A内のCPU14内の算出部25は、検証対象のメッセージ及びCANIDを取得したか否かを判定する(ステップS11)。算出部25は、検証対象のメッセージ及びCANIDを取得した場合(ステップS11肯定)、カウント中の内部シリアル番号をカウンタ部27から取得する(ステップS12)。 Next, the operation of the in-vehicle system 1 of the first embodiment will be described. FIG. 7 is a flowchart showing an example of the processing operation of the transmission side ECU 2A involved in the transmission processing. The calculation unit 25 in the CPU 14 in the transmission side ECU 2A determines whether or not the message to be verified and the CANID have been acquired (step S11). When acquiring the message to be verified and the CANID (Yes at step S11), the calculation unit 25 acquires the internal serial number being counted from the counter unit 27 (step S12).
 算出部25は、検証対象のメッセージ、検証対象のメッセージのCANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する(ステップS13)。CPU14内の生成部21は、現在が第2の認証フレーム33の送信タイミングであるか否かを判定する(ステップS14)。尚、第2の認証フレーム33の送信タイミングは、第1の認証フレーム32の5回毎に1回のタイミングである。 The calculation unit 25 calculates an 8-byte MAC value based on the verification target message, the CANID of the verification target message, the internal serial number, and the common key (step S13). The generation unit 21 in the CPU 14 determines whether the present time is the transmission timing of the second authentication frame 33 (step S14). The transmission timing of the second authentication frame 33 is once every five times of the first authentication frame 32.
 生成部21は、現在が第2の認証フレーム33の送信タイミングでない場合(ステップS14否定)、第1の認証フレーム32を生成する(ステップS15)。尚、生成部21は、第1の認証フレーム32を識別するCANIDと、ステップS13で算出した8バイト長のMAC値とを格納して生成する。 If the current time is not the transmission timing of the second authentication frame 33 (No at Step S14), the generation unit 21 generates the first authentication frame 32 (Step S15). The generation unit 21 stores and generates the CANID for identifying the first authentication frame 32 and the 8-byte MAC value calculated in step S13.
 CPU14内のフレーム通信部23は、第1の認証フレーム32を生成した後、データフレーム31及び認証フレームを送信する(ステップS16)。カウンタ部27は、カウント中の内部シリアル番号を+1インクリメントし(ステップS17)、図7に示す処理動作を終了する。尚、認証フレームは、第1の認証フレーム32又は第2の認証フレーム33の何れか一つのフレームである。 After generating the first authentication frame 32, the frame communication unit 23 in the CPU 14 transmits the data frame 31 and the authentication frame (step S16). The counter unit 27 increments the internal serial number being counted by +1 (step S17), and ends the processing operation shown in FIG. The authentication frame is any one of the first authentication frame 32 and the second authentication frame 33.
 算出部25は、第2の認証フレーム33の送信タイミングの場合(ステップS14肯定)、8バイト長の算出MAC値から上位6バイト分をトランケートして6バイト長の算出MAC値を取得する(ステップS18)。更に、生成部21は、第2の認証フレーム33を生成する(ステップS19)。生成部21は、6バイト長の算出MAC値と、2バイト長の内部シリアル番号と、第2の認証フレーム33を識別するCANIDとを格納して第2の認証フレーム33を生成する。そして、フレーム通信部23は、データフレーム31及び認証フレーム33を送信すべく、ステップS16に移行する。 In the case of the transmission timing of the second authentication frame 33 (Yes at step S14), the calculation unit 25 truncates the upper 6 bytes from the calculated MAC value of the 8-byte length to obtain the calculated MAC value of the 6-byte length (step S18). Furthermore, the generation unit 21 generates a second authentication frame 33 (step S19). The generation unit 21 generates a second authentication frame 33 by storing a calculated MAC value of 6 bytes long, an internal serial number of 2 bytes long, and a CAN ID for identifying the second authentication frame 33. Then, in order to transmit the data frame 31 and the authentication frame 33, the frame communication unit 23 proceeds to step S16.
 送信側ECU2Aは、データフレーム31を送信する際に第1の認証フレーム32を送信し、5回に1回の送信タイミングで第1の認証フレーム32の代わりに、シリアル番号を含む第2の認証フレーム33を送信する。その結果、定期的にシリアル番号を含む第2の認証フレーム33を送信することで、シリアル番号の通知に関わるデータ通信量を削減できる。 The transmitting side ECU 2A transmits the first authentication frame 32 when transmitting the data frame 31, and the second authentication including the serial number instead of the first authentication frame 32 at one transmission timing every five times. Send frame 33 As a result, by periodically transmitting the second authentication frame 33 including the serial number, the amount of data communication related to the notification of the serial number can be reduced.
 第2の認証フレーム33は、6バイト長のMAC値と、2バイト長のシリアル番号と、第2の認証フレーム33を識別するCANIDとを含む。その結果、送信側ECU2Aは、MAC値及びシリアル番号を受信側ECU2Bに通知できる。 The second authentication frame 33 includes a MAC value of 6 bytes in length, a serial number of 2 bytes in length, and a CAN ID for identifying the second authentication frame 33. As a result, the transmitting ECU 2A can notify the receiving ECU 2B of the MAC value and the serial number.
 図8は、第1の受信処理に関わる受信側ECU2Bの処理動作の一例を示すフローチャートである。受信側ECU2B内のCPU14内のフレーム通信部23は、CAN3からデータフレーム31及び認証フレームを受信したか否かを判定する(ステップS21)。CPU14内の解析部24は、データフレーム31及び認証フレームを受信した場合(ステップS21肯定)、受信データフレーム31からCANID及びメッセージを取得する(ステップS22)。算出部25は、カウント中の内部シリアル番号をカウンタ部27から取得する(ステップS23)。 FIG. 8 is a flowchart showing an example of the processing operation of the reception side ECU 2B related to the first reception processing. The frame communication unit 23 in the CPU 14 in the reception side ECU 2B determines whether the data frame 31 and the authentication frame are received from the CAN 3 (step S21). When the analysis unit 24 in the CPU 14 receives the data frame 31 and the authentication frame (Yes at Step S21), the analysis unit 24 acquires the CAN ID and the message from the reception data frame 31 (Step S22). The calculating unit 25 acquires the internal serial number being counted from the counter unit 27 (step S23).
 算出部25は、認証対象のメッセージ、認証対象のメッセージのCANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する(ステップS24)。CPU14内の検証部26は、受信した認証フレームが第1の認証フレーム32であるか否かを判定する(ステップS25)。検証部26は、受信した認証フレームが第1の認証フレーム32の場合(ステップS25肯定)、第1の認証フレーム32から8バイト長のMAC値、すなわち受信MAC値を抽出する(ステップS26)。 The calculating unit 25 calculates an 8-byte MAC value based on the message to be authenticated, the CANID of the message to be authenticated, the internal serial number, and the common key (step S24). The verification unit 26 in the CPU 14 determines whether the received authentication frame is the first authentication frame 32 (step S25). If the received authentication frame is the first authentication frame 32 (Yes at step S25), the verification unit 26 extracts an 8-byte MAC value, that is, a received MAC value, from the first authentication frame 32 (step S26).
 検証部26は、ステップS24にて算出された8バイト長の算出MAC値とステップS26にて抽出された受信MAC値とを比較照合し(ステップS27)、検証結果OKであるか否かを判定する(ステップS28)。尚、検証部26は、算出MAC値と受信MAC値とが一致した場合に検証結果OKと判断する。 The verification unit 26 compares the calculated MAC value of 8-byte length calculated in step S24 with the received MAC value extracted in step S26 (step S27), and determines whether or not the verification result is OK. (Step S28). The verification unit 26 determines that the verification result is OK when the calculated MAC value and the received MAC value match.
 カウンタ部27は、検証結果OKの場合(ステップS28肯定)、カウント中の内部シリアル番号を+1インクリメントし(ステップS29)、受信メッセージが真正と判断し(ステップS30)、図8に示す処理動作を終了する。フレーム通信部23は、データフレーム31及び認証フレームを受信しなかった場合(ステップS21否定)、図8に示す処理動作を終了する。CPU14は、検証結果OKでない場合(ステップS28否定)、すなわち検証結果NGの場合、受信メッセージが真正でないと判断し、受信メッセージを破棄し(ステップS31)、図8に示す処理動作を終了する。 If the verification result is OK (Step S28: Yes), the internal serial number in the count is incremented by 1 (Step S29), the received message is judged to be authentic (Step S30), and the processing operation shown in FIG. finish. When the frame communication unit 23 does not receive the data frame 31 and the authentication frame (No at step S21), the processing operation illustrated in FIG. 8 ends. If the verification result is not OK (No at Step S28), that is, if the verification result is NG, the CPU 14 determines that the received message is not authentic, discards the received message (Step S31), and ends the processing operation shown in FIG.
 算出部25は、受信した認証フレームが第1の認証フレーム32でない場合(ステップS25否定)、すなわち受信した認証フレームが第2の認証フレーム33と判断する。算出部25は、8バイト長の算出MAC値から上位6バイト分をトランケートして6バイト長の算出MAC値を算出する(ステップS32)。検証部26は、第2の認証フレーム33から6バイト長の受信MAC値を抽出する(ステップS33)。検証部26は、ステップS32にて算出した6バイト長の算出MAC値と、ステップS33にて抽出した6バイト長の受信MAC値とで比較照合し(ステップS34)、検証結果OKであるか否かを判定する(ステップS35)。 If the received authentication frame is not the first authentication frame 32 (No at Step S25), the calculation unit 25 determines that the received authentication frame is the second authentication frame 33. The calculation unit 25 truncates the upper 6 bytes from the calculated MAC value of the 8-byte length to calculate the calculated MAC value of the 6-byte length (step S32). The verification unit 26 extracts a reception MAC value having a length of 6 bytes from the second authentication frame 33 (step S33). The verification unit 26 compares the calculated MAC value of 6 byte length calculated in step S32 with the reception MAC value of 6 byte length extracted in step S33 (step S34), and the verification result is OK or not It is determined (step S35).
 CPU14は、検証結果OKの場合(ステップS35肯定)、カウント中の内部シリアル番号を+1インクリメントすべく、ステップS29に移行する。 If the verification result is OK (Yes at Step S35), the CPU 14 proceeds to Step S29 in order to increment the internal serial number being counted by +1.
 算出部25は、検証結果OKでない場合(ステップS35否定)、受信データフレーム31内のCANID、メッセージ、第2の認証フレーム33内の受信シリアル番号及び共通鍵に基づき、6バイト長の算出MAC値を算出する(ステップS36)。検証部26は、ステップS33にて抽出した6バイト長の受信MAC値とステップS36にて算出した6バイト長の算出MAC値とを比較照合し(ステップS37)、検証結果OKであるか否かを判定する(ステップS38)。 In the case where the verification result is not OK (No at Step S35), the calculation unit 25 calculates a MAC value of 6 bytes in length based on the CAN ID in the reception data frame 31, the message, the reception serial number in the second authentication frame 33, and the common key. Is calculated (step S36). The verification unit 26 compares the received MAC value of 6 byte length extracted in step S33 with the calculated MAC value of 6 byte length calculated in step S36 (step S37), and determines whether the verification result is OK or not. Is determined (step S38).
 CPU14内の更新部28は、検証結果OKの場合(ステップS38肯定)、第2の認証フレーム33内の受信シリアル番号が許容範囲内であるか否かを判定する(ステップS39)。尚、更新部28は、第2の認証フレーム33内の受信シリアル番号とカウンタ部27にカウント中の内部シリアル番号とを比較する。そして、検証部26は、第2の認証フレーム33内の受信シリアル番号が内部シリアル番号よりも大で、かつ受信シリアル番号と内部シリアル番号との誤差が所定数以内の場合、受信メッセージを真正と判断する。 If the verification result is OK (Yes at Step S38), the updating unit 28 in the CPU 14 determines whether the reception serial number in the second authentication frame 33 is within the allowable range (Step S39). The updating unit 28 compares the received serial number in the second authentication frame 33 with the internal serial number being counted by the counter unit 27. If the received serial number in the second authentication frame 33 is larger than the internal serial number and the difference between the received serial number and the internal serial number is within a predetermined number, the verification unit 26 determines that the received message is genuine. to decide.
 更新部28は、受信シリアル番号が許容範囲内である場合(ステップS39肯定)、カウンタ部27にカウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更する(ステップS40)。そして、検証部26は、受信メッセージが真正と判断すべく、ステップS30に移行する。 When the reception serial number is within the allowable range (Yes at step S39), the update unit 28 changes the internal serial number being counted by the counter unit 27 to the reception serial number in the second authentication frame 33 (step S40). . Then, the verification unit 26 proceeds to step S30 to determine that the received message is authentic.
 検証部26は、検証結果OKでない場合(ステップS38否定)、受信メッセージを破棄し(ステップS41)、図8に示す処理動作を終了する。検証部26は、受信シリアル番号が許容範囲内でない場合(ステップS39否定)、受信メッセージを破棄すべく、ステップS41に移行する。 If the verification result is not OK (No at Step S38), the verification unit 26 discards the received message (Step S41), and ends the processing operation illustrated in FIG. If the received serial number is not within the allowable range (No at Step S39), the verification unit 26 proceeds to Step S41 to discard the received message.
 受信側ECU2Bは、受信した認証フレームが第1の認証フレーム32の場合、データフレーム31内のメッセージ、CANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する。更に、受信側ECU2Bは、8バイト長の算出MAC値と、第1の認証フレーム32内の8バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが一致した場合に受信メッセージが真正と判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 When the received authentication frame is the first authentication frame 32, the receiving ECU 2B calculates an 8-byte MAC value based on the message in the data frame 31, the CAN ID, the internal serial number, and the common key. Furthermore, the receiving ECU 2B compares and compares the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value matches the received MAC value. Judge that the received message is genuine. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 受信側ECU2Bは、8バイト長の算出MAC値と、第1の認証フレーム32内の8バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが不一致の場合に受信メッセージが真正でないと判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 The reception side ECU 2 B compares and collates the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value and the received MAC value do not match, the received message It is determined that is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 受信側ECU2Bは、受信した認証フレームが第2の認証フレーム33の場合、受信したデータフレーム内のメッセージ、CANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する。受信側ECU2Bは、8バイト長のMAC値から上位6バイト分をトランケートして6バイト長の算出MAC値を取得する。受信側ECU2Bは、6バイト長の算出MAC値と、第2の認証フレーム33内の6バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが一致した場合に受信シリアル番号が許容範囲であるか否かを判定する。受信側ECU2Bは、受信シリアル番号が許容範囲の場合、受信メッセージが真正と判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 When the received authentication frame is the second authentication frame 33, the receiving ECU 2B calculates an 8-byte MAC value based on the message in the received data frame, the CAN ID, the internal serial number, and the common key. The reception-side ECU 2B truncates the upper 6 bytes from the 8-byte MAC value to obtain a calculated MAC value of 6 bytes. The reception side ECU 2 B compares and collates the calculated MAC value of 6 byte length with the received MAC value of 6 byte length in the second authentication frame 33, and when the calculated MAC value and the received MAC value match, reception serial It is determined whether the number is within the allowable range. When the reception serial number is in the allowable range, the reception ECU 2B determines that the reception message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 更に、受信側ECU2Bは、受信シリアル番号が許容範囲の場合にカウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更する。その結果、例えば、メッセージが欠落して送信側ECU2Aと受信側ECU2Bとの間でシリアル番号に不整合が生じた場合でも、カウント中の内部シリアル番号を整合して送信側ECU2Aと受信側ECU2Bとの間のシリアル番号の同期を確立できる。 Furthermore, when the received serial number is within the allowable range, the receiving ECU 2B changes the internal serial number being counted to the received serial number in the second authentication frame 33. As a result, for example, even if a message is missing and a serial number mismatch occurs between the transmitting side ECU 2A and the receiving side ECU 2B, the internal serial number being counted is aligned and the transmitting side ECU 2A and the receiving side ECU 2B You can establish synchronization between serial numbers.
 受信側ECU2Bは、6バイト長の算出MAC値と6バイト長の受信MAC値とが不一致の場合に受信メッセージが真正でないと判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 When the calculated MAC value of 6-byte length and the received MAC value of 6-byte length do not match, the receiving ECU 2B determines that the received message is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 図9は、送信側ECU2Aと受信側ECU2Bとの間のデータ通信に関わる処理動作の一例を示すシーケンス図である。図9に示す送信側ECU2Aは、検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“1”でMAC値を算出する(ステップS51)。送信側ECU2Aは、データフレーム31を受信側ECU2Bに通知する(ステップS52)。更に、送信側ECU2Aは、MAC値及び内部シリアル番号“1”を格納した第2の認証フレーム33を受信側ECU2Bに通知する(ステップS53)。そして、送信側ECU2Aは、カウント中の内部シリアル番号“1”を+1インクリメントして内部シリアル番号“2”とする(ステップS54)。 FIG. 9 is a sequence diagram showing an example of processing operation related to data communication between the transmission side ECU 2A and the reception side ECU 2B. The transmission side ECU 2A shown in FIG. 9 calculates a MAC value from the message to be verified, the CANID to be verified, the common key, and the internal serial number "1" (step S51). The transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S52). Furthermore, the transmitting side ECU 2A notifies the receiving side ECU 2B of the second authentication frame 33 storing the MAC value and the internal serial number "1" (step S53). Then, the transmitting side ECU 2A increments the internal serial number “1” being counted by +1 to make the internal serial number “2” (step S54).
 受信側ECU2Bは、データフレーム31内の検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“1”に基づきMAC値を算出する。更に、受信側ECU2Bは、算出MAC値と第2の認証フレーム33内の受信MAC値とを比較照合し、検証結果OKとする(ステップS55)。受信側ECU2Bは、カウント中の内部シリアル番号“1”を+1インクリメントして内部シリアル番号“2”とする(ステップS56)。 The reception side ECU 2B calculates the MAC value based on the message to be verified in the data frame 31, the CAN ID to be verified, the common key, and the internal serial number "1". Further, the receiving ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, and sets the verification result as OK (step S55). The receiving ECU 2B increments the internal serial number “1” being counted by +1 to obtain an internal serial number “2” (step S56).
 更に、送信側ECU2Aは、検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“2”に基づき、MAC値を算出する(ステップS57)。送信側ECU2Aは、データフレーム31を受信側ECU2Bに通知する(ステップS58)。更に、送信側ECU2Aは、MAC値を格納した第1の認証フレーム32を受信側ECU2Bに通知する(ステップS59)。そして、送信側ECU2Aは、カウント中の内部シリアル番号“2”を+1インクリメントして内部シリアル番号“3”とする(ステップS60)。 Furthermore, the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key, and the internal serial number "2" (step S57). The transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S58). Furthermore, the transmission side ECU 2A notifies the reception side ECU 2B of the first authentication frame 32 storing the MAC value (step S59). Then, the transmitting side ECU 2A increments the internal serial number "2" being counted by +1 to make the internal serial number "3" (step S60).
 受信側ECU2Bは、データフレーム31内の検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“2”に基づきMAC値を算出する。更に、受信側ECU2Bは、算出MAC値と第1の認証フレーム32内の受信MAC値とを比較照合し、検証結果OKとする(ステップS61)。受信側ECU2Bは、カウント中のシリアル番号“1”を+1インクリメントし、シリアル番号“2”とする(ステップS62)。 The reception side ECU 2B calculates the MAC value based on the message to be verified in the data frame 31, the CAN ID to be verified, the common key, and the internal serial number "2". Furthermore, the receiving ECU 2B compares the calculated MAC value with the received MAC value in the first authentication frame 32, and sets the verification result as OK (step S61). The reception side ECU 2B increments the serial number “1” being counted by +1 to make the serial number “2” (step S62).
 その後、送信側ECU2Aは、カウント中のシリアル番号が“5”の場合、検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“5”に基づき、MAC値を算出する(ステップS63)。送信側ECU2Aは、データフレーム31を受信側ECU2Bに通知する(ステップS64)。更に、送信側ECU2Aは、MAC値を格納した第1の認証フレーム32を受信側ECU2Bに通知する(ステップS65)。そして、送信側ECU2Aは、カウント中の内部シリアル番号“5”を+1インクリメントし、内部シリアル番号“6”とする(ステップS66)。 Thereafter, when the serial number being counted is “5”, the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key and the internal serial number “5” (step S63). . The transmitting side ECU 2A notifies the receiving side ECU 2B of the data frame 31 (step S64). Furthermore, the transmission side ECU 2A notifies the reception side ECU 2B of the first authentication frame 32 storing the MAC value (step S65). Then, the transmitting side ECU 2A increments the internal serial number "5" being counted by +1 to make the internal serial number "6" (step S66).
 しかしながら、受信側ECU2Bは、例えば、何らかの障害で送信側ECU2Aからのデータフレーム31及び第1の認証フレーム32が受信できないメッセージ欠落が生じたとする。 However, it is assumed that, for example, the receiving side ECU 2B causes a message loss that the data frame 31 and the first authentication frame 32 can not be received from the transmitting side ECU 2A due to some failure.
 そして、送信側ECU2Aは、検証対象のメッセージ、検証対象のCANID、共通鍵及び内部シリアル番号“6”に基づき、MAC値を算出する(ステップS67)。送信側ECU2Aは、データフレームを受信ECU2Bに通知する(ステップS68)。更に、送信側ECU2Aは、MAC値及び内部シリアル番号“6”を格納した第2の認証フレーム33を受信側ECU2Bに通知する(ステップS69)。そして、送信側ECU2Aは、カウント中の内部シリアル番号“6”を+1インクリメントし、内部シリアル番号“7”とする(ステップS70)。 Then, the transmitting side ECU 2A calculates the MAC value based on the message to be verified, the CANID to be verified, the common key, and the internal serial number "6" (step S67). The transmission side ECU 2A notifies the reception ECU 2B of the data frame (step S68). Furthermore, the transmitting side ECU 2A notifies the receiving side ECU 2B of the second authentication frame 33 storing the MAC value and the internal serial number "6" (step S69). Then, the transmitting side ECU 2A increments the internal serial number "6" being counted by +1 to make the internal serial number "7" (step S70).
 この際、受信側ECU2Bは、データフレーム31内のメッセージ、CANID、共通鍵及び内部シリアル番号“5”に基づき、MAC値を算出する。その結果、受信側ECU2Bでは、ステップS64のデータフレーム31及びステップS65の第1の認証フレーム32を受信できなかったので、カウント中の内部シリアル番号は“6”のままである。従って、受信側ECU2Bは、算出MAC値と第2の認証フレーム33内の受信MAC値とで比較照合した場合、検証結果NGとなる(ステップS71)。 At this time, the reception side ECU 2B calculates the MAC value based on the message in the data frame 31, the CAN ID, the common key, and the internal serial number "5". As a result, since the reception side ECU 2B could not receive the data frame 31 of step S64 and the first authentication frame 32 of step S65, the internal serial number being counted remains "6". Therefore, when the reception side ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, the verification result becomes NG (step S71).
 しかしながら、受信側ECU2Bは、データフレーム31内のCANID、メッセージ、共通鍵及び第2の認証フレーム33内のシリアル番号“6”に基づき、算出MAC値を算出する。そして、受信側ECU2Bは、算出MAC値と第2の認証フレーム33内の受信MAC値とで比較照合し、検証結果OKとなる(ステップS72)。受信側ECU2Bは、カウント中の内部シリアル番号“5”を第2の認証フレーム33内のシリアル番号“6”に変更する。その結果、受信側ECU2Bは、送信側ECU2Aとの間でシリアル番号の同期を確立できる。そして、受信側ECU2Bは、カウント中の内部シリアル番号“6”を+1インクリメントし、内部シリアル番号“7”とする(ステップS73)。 However, the receiving ECU 2 B calculates the calculated MAC value based on the CAN ID in the data frame 31, the message, the common key, and the serial number “6” in the second authentication frame 33. Then, the reception side ECU 2B compares the calculated MAC value with the received MAC value in the second authentication frame 33, and the verification result is OK (step S72). The receiving ECU 2 B changes the internal serial number “5” being counted to the serial number “6” in the second authentication frame 33. As a result, the reception side ECU 2B can establish synchronization of serial numbers with the transmission side ECU 2A. Then, the reception side ECU 2B increments the internal serial number "6" being counted by +1 to make the internal serial number "7" (step S73).
 送信側ECU2Aは、データフレーム31を送信する際に第1の認証フレーム32を送信し、5回に1回の所定タイミングで第1の認証フレーム32の代わりに、シリアル番号を含む第2の認証フレーム33を送信する。その結果、定期的にシリアル番号を含む第2の認証フレーム33を送信することで、送信側ECU2Aと受信側ECU2Bとの間のシリアル番号の通知に関わるデータ通信量を削減できる。 The transmitting side ECU 2A transmits the first authentication frame 32 when transmitting the data frame 31, and the second authentication including the serial number instead of the first authentication frame 32 at a predetermined timing once in five times. Send frame 33 As a result, by periodically transmitting the second authentication frame 33 including the serial number, it is possible to reduce the amount of data communication related to the notification of the serial number between the transmitting ECU 2A and the receiving ECU 2B.
 送信側ECU2Aは、6バイト長のMAC値と、2バイト長のシリアル番号と、第2の認証フレーム33を識別するCANIDとを含む第2の認証フレーム33を所定タイミングで受信側ECU2Bに通知する。その結果、送信側ECU2Aは、所定タイミングで第2の認証フレーム33を通知するため、データ通信量を削減しながらMAC値及びシリアル番号を通知できる。更に、受信側ECU2Bは、受信フレーム内のCANIDを参照して第2の認証フレーム33を識別できる。 The transmitting side ECU 2A notifies the receiving side ECU 2B at a predetermined timing of the second authentication frame 33 including the MAC value of 6 byte length, the serial number of 2 byte length, and the CAN ID for identifying the second authentication frame 33. . As a result, since the transmission side ECU 2A notifies the second authentication frame 33 at a predetermined timing, it can notify the MAC value and the serial number while reducing the amount of data communication. Furthermore, the reception side ECU 2B can identify the second authentication frame 33 by referring to the CAN ID in the reception frame.
 受信側ECU2Bは、受信した認証フレームが第1の認証フレーム32の場合、受信したデータフレーム31内の検証対象メッセージ、CANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する。更に、受信側ECU2Bは、8バイト長の算出MAC値と、第1の認証フレーム32内の8バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが一致した場合に受信メッセージが真正であると判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 If the received authentication frame is the first authentication frame 32, the receiving ECU 2B calculates an 8-byte MAC value based on the verification target message in the received data frame 31, CAN ID, internal serial number, and common key. . Furthermore, the receiving ECU 2B compares and compares the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value matches the received MAC value. Judge that the received message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 受信側ECU2Bは、8バイト長の算出MAC値と、第1の認証フレーム32内の8バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが不一致の場合に受信メッセージが真正でないと判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 The reception side ECU 2 B compares and collates the calculated MAC value of 8-byte length with the received MAC value of 8-byte length in the first authentication frame 32, and when the calculated MAC value and the received MAC value do not match, the received message It is determined that is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 受信側ECU2Bは、受信した認証フレームが第2の認証フレーム33の場合、受信したデータフレーム31内の検証対象メッセージ、CANID、内部シリアル番号及び共通鍵に基づき、8バイト長のMAC値を算出する。受信側ECU2Bは、8バイト長のMAC値から上位6バイト分をトランケートして6バイト長の算出MAC値を取得する。受信側ECU2Bは、6バイト長の算出MAC値と、第2の認証フレーム33内の6バイト長の受信MAC値とを比較照合し、算出MAC値と受信MAC値とが一致した場合に受信シリアル番号が許容範囲であるか否かを判定する。受信側ECU2Bは、受信シリアル番号が許容範囲の場合、受信メッセージが真正であると判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 When the received authentication frame is the second authentication frame 33, the receiving ECU 2B calculates an 8-byte MAC value based on the verification target message in the received data frame 31, CAN ID, internal serial number, and common key. . The reception-side ECU 2B truncates the upper 6 bytes from the 8-byte MAC value to obtain a calculated MAC value of 6 bytes. The reception side ECU 2 B compares and collates the calculated MAC value of 6 byte length with the received MAC value of 6 byte length in the second authentication frame 33, and when the calculated MAC value and the received MAC value match, reception serial It is determined whether the number is within the allowable range. When the reception serial number is within the allowable range, the reception side ECU 2B determines that the reception message is authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 更に、受信側ECU2Bは、受信シリアル番号が許容範囲の場合、カウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更する。その結果、例えば、メッセージが欠落して送信側ECU2Aと受信側ECU2Bとの間でシリアル番号に不整合が生じた場合でも、カウント中の内部シリアル番号を整合して送信側ECU2Aと受信側ECU2Bとの間のシリアル番号の同期を確立できる。 Furthermore, when the received serial number is within the allowable range, the receiving ECU 2B changes the internal serial number being counted to the received serial number in the second authentication frame 33. As a result, for example, even if a message is missing and a serial number mismatch occurs between the transmitting side ECU 2A and the receiving side ECU 2B, the internal serial number being counted is aligned and the transmitting side ECU 2A and the receiving side ECU 2B You can establish synchronization between serial numbers.
 受信側ECU2Bは、6バイト長の算出MAC値と6バイト長の受信MAC値とが不一致の場合に受信メッセージが真正でないと判断する。その結果、受信側ECU2Bは、受信メッセージの真正を判定できる。 When the calculated MAC value of 6-byte length and the received MAC value of 6-byte length do not match, the receiving ECU 2B determines that the received message is not authentic. As a result, the receiving ECU 2B can determine the authenticity of the received message.
 尚、実施例1の受信側ECU2Bは、第2の認証フレーム33内の受信MAC値と、第2の認証フレーム33内の受信シリアル番号を使用した受信MAC値とを比較照合し、検証結果OKの場合は内部シリアル番号を変更せずに受信メッセージが真正と判断した。しかしながら、これに限定されるものではなく、その実施の形態につき、実施例2として以下に説明する。尚、実施例1の車載システム1と同一の構成には同一符号を付すことで、その重複する構成及び動作の説明については省略する。 Note that the receiving side ECU 2B according to the first embodiment compares the received MAC value in the second authentication frame 33 with the received MAC value using the received serial number in the second authentication frame 33, and confirms the verification result OK. In the case of, the received message was judged as genuine without changing the internal serial number. However, the present invention is not limited to this, and an embodiment thereof will be described below as Example 2. The same components as those of the in-vehicle system 1 of the first embodiment are denoted by the same reference numerals, and the description of the same components and operations will be omitted.
 受信側ECU2Bは、第2の認証フレーム33を受信した場合に、第2の認証フレーム33内の6バイト長の受信MAC値と、第2の認証フレーム33内の受信シリアル番号を使用して算出した6バイト長の算出MAC値とを比較照合する。更に、受信側ECU2Bは、受信MAC値と算出MAC値とが一致した場合にカウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更する。 When receiving the second authentication frame 33, the receiving side ECU 2B calculates using the 6-byte length reception MAC value in the second authentication frame 33 and the reception serial number in the second authentication frame 33. The calculated MAC value of the 6-byte length is compared and collated. Furthermore, when the received MAC value matches the calculated MAC value, the receiving ECU 2 B changes the internal serial number being counted to the received serial number in the second authentication frame 33.
 次に実施例2の車載システム1の動作について説明する。図10は、第2の受信処理に関わる受信側ECU2Bの処理動作の一例を示すフローチャートである。更新部28は、検証結果がOKであるか否かを判定する(ステップS35A)。更新部28は、検証結果OKである場合(ステップS35A肯定)、カウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更する(ステップS40A)。検証部26は、内部シリアル番号を第2の検証フレーム33内の受信シリアル番号に変更した後、受信メッセージを真正と判断すべく、ステップS30に移行する。更新部28は、検証結果がOKでない場合(ステップS35A否定)、6バイト長のMAC値を算出すべく、ステップS36に移行する。 Next, the operation of the in-vehicle system 1 of the second embodiment will be described. FIG. 10 is a flowchart showing an example of the processing operation of the reception side ECU 2B related to the second reception processing. The updating unit 28 determines whether the verification result is OK (step S35A). If the verification result is OK (Yes at Step S35A), the updating unit 28 changes the internal serial number being counted to the reception serial number in the second authentication frame 33 (Step S40A). After changing the internal serial number to the reception serial number in the second verification frame 33, the verification unit 26 proceeds to step S30 in order to determine that the received message is authentic. If the verification result is not OK (No at Step S35), the updating unit 28 proceeds to Step S36 in order to calculate a MAC value having a length of 6 bytes.
 受信側ECU2Bは、カウント中の内部シリアル番号を第2の認証フレーム33内の受信シリアル番号に変更した。その結果、受信側ECU2Bは、第2の認証フレーム33を受信した場合、送信側ECU2Aとの間でシリアル番号を同期できる。 The receiving ECU 2 B changes the internal serial number being counted to the receiving serial number in the second authentication frame 33. As a result, when receiving the second authentication frame 33, the receiving ECU 2B can synchronize the serial number with the transmitting ECU 2A.
 尚、受信側ECU2Bは、受信フレーム内のCANIDに基づき、受信フレームが第1の認証フレーム32又は第2の認証フレーム33であるかを判定した。そのため、第1の認証フレーム32及び第2の認証フレーム33には異なるCANIDを含めた。しかしながら、CANIDがない場合、受信フレーム内にシリアル番号があるか否かを判定し、シリアル番号がある場合に受信フレームが第2の認証フレームと判定するようにしても良い。 The receiving ECU 2B determines whether the received frame is the first authentication frame 32 or the second authentication frame 33 based on the CANID in the received frame. Therefore, different CANIDs are included in the first authentication frame 32 and the second authentication frame 33. However, if there is no CAN ID, it may be determined whether or not there is a serial number in the received frame, and if there is a serial number, it may be determined that the received frame is the second authentication frame.
 また、図示した各部の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各部の分散・統合の具体的形態は図示のものに限られず、その全部又は一部を、各種の負荷や使用状況等に応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。 Further, each component of each unit shown in the drawings does not necessarily have to be physically configured as shown in the drawings. That is, the specific form of the dispersion and integration of each part is not limited to the illustrated one, and all or a part thereof is functionally or physically dispersed or integrated in any unit according to various loads, usage conditions, etc. Can be configured.
 更に、各装置で行われる各種処理機能は、CPU(又はMPU(Micro Processing Unit)、MCU(Micro Controller Unit)等のマイクロ・コンピュータ)上で、その全部又は任意の一部を実行するようにしても良い。また、各種処理機能は、CPU(又はMPU、MCU等のマイクロ・コンピュータ)で解析実行するプログラム上、又はワイヤードロジックによるハードウェア上で、その全部又は任意の一部を実行するようにしても良いことは言うまでもない。 Furthermore, various processing functions performed by each device are performed by executing all or any part thereof on a CPU (or a microcomputer such as a micro processing unit (MPU) or a micro controller unit (MCU)). Also good. In addition, various processing functions may execute all or any part of them on a program analyzed and executed by a CPU (or a microcomputer such as an MPU or an MCU) or on hardware by wired logic. Needless to say.
 1 車載システム
 1A 車両
 2A 送信側ECU
 2B 受信側ECU
 21 生成部
 22 鍵管理部
 23 フレーム通信部
 24 解析部
 25 算出部
 26 検証部
 27 カウンタ部
 28 更新部
1 in-vehicle system 1A vehicle 2A transmitter ECU
2B Receiver ECU
21 generation unit 22 key management unit 23 frame communication unit 24 analysis unit 25 calculation unit 26 verification unit 27 counter unit 28 update unit

Claims (6)

  1.  車両内の送信側車載装置と受信側車載装置との間で同一の内部カウント値を保持し、前記受信側車載装置が前記内部カウント値に基づき、前記送信側車載装置から受信したデータの送達順序を規定する車載システムであって、
     前記送信側車載装置は、
     送信対象のデータの真正を識別する認証値を含む第1の信号及び、前記認証値に加えてカウント値を含む第2の信号を選択的に送信する通信部を有し、
     前記受信側車載装置は、
     受信した信号が前記カウント値を含むか否かを判定する解析部と、
     受信した信号が前記カウント値を含む場合に、当該カウント値に基づき、自装置が保持する前記内部カウント値を更新する更新部と
     を有することを特徴とする車載システム。
    The same internal count value is held between the transmitting on-vehicle apparatus and the receiving-side on-vehicle apparatus in the vehicle, and the receiving on-vehicle apparatus delivers the order of delivery of data received from the transmitting on-vehicle apparatus based on the internal count value. An in-vehicle system that defines
    The transmitting on-vehicle apparatus
    A first signal including an authentication value for identifying the authenticity of data to be transmitted, and a communication unit that selectively transmits a second signal including a count value in addition to the authentication value;
    The receiving side in-vehicle device is
    An analysis unit that determines whether the received signal includes the count value;
    And an updating unit configured to update the internal count value held by the device based on the received count value when the received signal includes the count value.
  2.  前記送信側車載装置は、
     前記送信対象のデータと、所定の共通鍵と、自装置が保持中の内部カウント値とに基づき、前記認証値を算出する算出部と、
     前記第1の信号又は前記第2の信号に前記認証値を付加する生成部と
    を有し、
     前記受信側車載装置は、
     前記送信側車載装置から受信したデータと、前記所定の共通鍵と、自装置が保持中の内部カウント値とに基づき、第1の認証値を算出する算出部と、
     前記送信側車載用装置から受信した信号から抽出した前記認証値と、前記第1の認証値とを照合し、この第1の照合結果に基づき、前記受信したデータの真正を検証する検証部とを有する
     ことを特徴とする請求項1に記載の車載システム。
    The transmitting on-vehicle apparatus
    A calculation unit that calculates the authentication value based on the data to be transmitted, a predetermined common key, and an internal count value held by the apparatus itself;
    A generation unit that adds the authentication value to the first signal or the second signal;
    The receiving side in-vehicle device is
    A calculation unit that calculates a first authentication value based on the data received from the transmission-side in-vehicle apparatus, the predetermined common key, and the internal count value held by the own apparatus;
    A verification unit that collates the authentication value extracted from the signal received from the transmission side in-vehicle device with the first authentication value, and verifies the authenticity of the received data based on the first collation result; The on-vehicle system according to claim 1, comprising:
  3.  前記更新部は、
     前記第1の照合結果に基づき、前記データが真正であると判定された場合に、自装置が保持中の内部カウント値を受信した第2の信号内のカウント値で更新することを特徴とする請求項2に記載の車載システム。
    The updating unit is
    The internal count value held by the own device is updated with the count value in the received second signal when it is determined that the data is authentic based on the first collation result. The in-vehicle system according to claim 2.
  4.  前記受信側車載装置内の算出部は、
     前記第1の照合結果に基づき、前記受信したデータが真正でないと判定された場合に、前記第2の信号内のカウント値と、前記送信側車載装置から受信したデータと、前記所定の共通鍵とに基づき、第2の認証値を算出し、
     前記検証部は、
     前記送信側車載装置から受信した第2の信号から抽出した認証値と、前記第2の認証値とを照合し、この第2の照合結果に基づき、前記受信したデータの真正を検証する
     ことを特徴とする請求項2又は3に記載の車載システム。
    The calculation unit in the reception side in-vehicle apparatus is
    If it is determined that the received data is not authentic based on the first comparison result, the count value in the second signal, the data received from the transmitting on-vehicle apparatus, and the predetermined common key Calculate a second authentication value based on
    The verification unit
    Verifying the authentication value extracted from the second signal received from the transmission-side in-vehicle apparatus with the second authentication value, and verifying the authenticity of the received data based on the second comparison result. The vehicle-mounted system of Claim 2 or 3 characterized by the above-mentioned.
  5.  前記更新部は、
     前記第2の照合結果に基づき、前記受信したデータが真正であると判定された場合に、自装置が保持中の内部カウント値を前記第2の信号内のカウント値で更新することを特徴とする請求項4に記載の車載システム。
    The updating unit is
    The internal count value held by the own device is updated with the count value in the second signal when it is determined that the received data is authentic based on the second comparison result. The in-vehicle system according to claim 4.
  6.  車両内の送信側車載装置と受信側車載装置との間で同一の内部カウント値を保持し、前記受信側車載装置が前記内部カウント値に基づき、前記送信側車載装置から受信したデータの送達順序を規定する車載システムにおけるカウント値更新方法であって、
     前記送信側車載装置は、
     送信対象のデータの真正を識別する認証値を含む第1の信号及び、前記認証値に加えてカウント値を含む第2の信号を選択的に送信し、
     前記受信側車載装置は、
     受信した信号が前記カウント値を含むか否かを判定し、
     受信した信号が前記カウント値を含む場合に、当該カウント値に基づき、自装置が保持する前記内部カウント値を更新することを特徴とするカウント更新方法。
    The same internal count value is held between the transmitting on-vehicle apparatus and the receiving-side on-vehicle apparatus in the vehicle, and the receiving on-vehicle apparatus delivers the order of delivery of data received from the transmitting on-vehicle apparatus based on the internal count value. Method for updating the count value in an on-vehicle system that defines
    The transmitting on-vehicle apparatus
    Selectively transmitting a first signal including an authentication value identifying authenticity of data to be transmitted, and a second signal including a count value in addition to the authentication value;
    The receiving side in-vehicle device is
    Determining whether the received signal includes the count value;
    And updating the internal count value held by the apparatus based on the received count value when the received signal includes the count value.
PCT/JP2017/023823 2017-06-28 2017-06-28 In-vehicle system and count updating method WO2019003362A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/023823 WO2019003362A1 (en) 2017-06-28 2017-06-28 In-vehicle system and count updating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/023823 WO2019003362A1 (en) 2017-06-28 2017-06-28 In-vehicle system and count updating method

Publications (1)

Publication Number Publication Date
WO2019003362A1 true WO2019003362A1 (en) 2019-01-03

Family

ID=64742974

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/023823 WO2019003362A1 (en) 2017-06-28 2017-06-28 In-vehicle system and count updating method

Country Status (1)

Country Link
WO (1) WO2019003362A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017038143A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication system, transmission node, and reception node
JP2017038365A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication system, management node, normal node, counter synchronization method, program, and recording medium
JP2017038144A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017038143A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication system, transmission node, and reception node
JP2017038365A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication system, management node, normal node, counter synchronization method, program, and recording medium
JP2017038144A (en) * 2015-08-07 2017-02-16 株式会社デンソー Communication device

Similar Documents

Publication Publication Date Title
US10104094B2 (en) On-vehicle communication system
EP3038318B1 (en) Communication control apparatus, communication control method and communication control program
US9331854B2 (en) Message authentication method in communication system and communication system
KR101356476B1 (en) Data certification and acquisition method for vehicle
CN108353015B (en) Relay device
US9191379B2 (en) Method and apparatus for authenticating multicast messages
CN108023730B (en) Communication system and communication method
US9450937B2 (en) Vehicle network authentication system, and vehicle network authentication method
CN106899404A (en) Vehicle-mounted CAN FD bus communication systems and method based on wildcard
EP3220576B1 (en) Information processing device and message authentication method
US20140301550A1 (en) Method for recognizing a manipulation of a sensor and/or sensor data of the sensor
CN106257863A (en) For the method preventing from treating to be manipulated by via the effective data packets of bus system transmission
US20080072043A1 (en) Device management system and method of controlling the same
CN108024243B (en) A kind of eSIM is caught in Network Communication method and its system
CN101626373A (en) Method, device and system for message processing of ultra wide band system
JP2015001764A (en) Authentication method, communication system, apparatus and server
CN110472970B (en) Block chain-based block pre-generation method and system
CN111740825A (en) CAN bus multi-network node authentication method and system
JP2018121220A (en) In-vehicle network system
US20180219873A1 (en) Communication system, count value synchronization method, and count value synchronization program product
WO2021245599A1 (en) System and method for authenticating a device on a network
CN107835099B (en) Information synchronization method and device
WO2019003362A1 (en) In-vehicle system and count updating method
US20210195418A1 (en) A technique for authenticating data transmitted over a cellular network
Carsten et al. A system to recognize intruders in controller area network (can)

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: 17916149

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17916149

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP