背景
0x29服務的目的是為客戶端提供一種證明其身份的方法,在ECU端,有些服務或者數據因信息安全、排放或功能安全原因而受到嚴格限制。 只有身份驗證通過之后,才能夠允許其訪問數據和/或診斷服務。
例如,用于將數據下載/上傳到ECU以及從ECU讀取特定存儲位置的診斷服務是需要進行身份驗證。
下載到ECU中的不正確程序或數據可能會損壞電子設備或其他車輛部件,或危及車輛符合排放、功能安全或信息安全標準。
此服務支持兩個安全類型:
–1基于使用非對稱密碼學的PKI證書交換過程。作為證書格式,應使用符合ISO7816-8的CVC和符合ISO/IEC 9594-8、RFC 5280和RFC 5755或IEEE 1609.2的X.509。
–2基于沒有PKI證書的質詢-響應過程,使用帶有軟件身份驗證令牌的非對稱密碼學或對稱密碼學。
本篇文章著重介紹類型1中的單向認證Unidirectional authentication
0x29 01
verifyCertificateUnidirectional (單向認證證書)
此SubFunction啟動單向身份驗證過程,僅對ECU對應的客戶端進行身份驗證。
0x29 01(單向驗證證書)子服務工作流程
- Client sends its certificate client
- Server verifies the certificate client
- Server creates a challenge server
- Server sends the challenge server
- Client calculates proof of ownership client by building an appropriate authentication token whose content to be signed include at least (parts of) the challenge server
- Client sends the proof of ownership client
- Server verifies the proof of ownership client with the public key from the received certificate client
- The server grants access to diagnostic objects according to access rights
- The server responds that the authentication was successful
69 01
11
(認證返回值參數 ,CertificateVerified, OwnershipVerificationNecessary)
00 10 (ECU挑戰值長度 16個byte)
41 45 35 36 39 30 31 31 45 41 31 39 30 35 33 42
00 00
0x29 03
“proofOfOwnership(所有權證明)”,
this SubFunction parameter is used to transmit the proof of ownership data to the client.
此SubFunction參數用于將所有權證明數據(即對0x29 01服務所返回的隨機數進行Hash并簽名)傳輸到客戶端。
下面是一個關于0x29 03服務的請求及響應報文示例
29 03
00 60 (所有權證明客戶的長度,lengthOfProofOfOwnershipClient,對挑戰值進行簽名后的簽名的長度)
4D 45 55 43 49 51 44 42 71 30 67 35 78 76 46 6D 70 69 78 64 30 6D 37 43 77 76 6E 77 41 56 46 62 51 78 6A 6D 59 34 4F 65 54 49 30 76 2B 74 63 79 61 41 49 67 64 51 51 33 45 35 45 74 59 53 43 39 73 6C 42 34 32 65 4E 73 69 58 38 59 62 6C 50 47 4B 78 63 6F 58 42 4B 50 63 45 42 48 55 65 41 3D
(對挑戰值進行簽名后的報文)
00 00
69 03 12 00 00