随着智能网联汽车的快速发展,车辆信息安全问题也日渐凸显,传统的 UDS 27 服务已无法满足网联汽车安全要求,因此便提出了 UDS 29 服务,用于对诊断设备和车辆的身份进行校验。
在 ISO 14229-1:2020 中提出了两种认证方式:
- Authentication with PKI Certificate Exchange(APCE):采用非对称加密
- Authentication with Challenge-Response (ACR) :可采用对称或非对称加密
由于 ACR 的认证方式主要由主机厂进行细节约束,所以在此不做过多介绍,以下重点介绍 APCE 认证方式。
在 ISO 14229-1:2020 中指出了 PKI 认证流程如下图所示:
我们对其进行拆解分析,主要涉及单向认证和双向认证两种方式。
如果需要采用安全加密的方式进行数据交互,则需采用密钥交换算法(如DH算法)来协商会话密钥
单向认证
单向认证示例(主要对 Tester 的身份进行认证):
注意:以下示例仅列出关键参数,具体请求参数与响应格式详见附录A和附录B
tester: 29 08 // 查询服务端支持的认证类型
server: 69 08 ARP // ARP(Authentication Return Parameter)含义: 02表示基于PKI,03表示基于非对称加密的ACR,04表示基于对称加密的ACR
tester: 29 01 00 Tester-Certificate // 单向认证请求(携带tester的证书数据给server),其中00表示非安全会话通信,即无需协商会话密钥
server: 69 01 11 Ecu-Challenge // ECU发送challenge给tester,11表示Client证书校验成功,接下来将进行所有权证明校验
tester: 29 03 Tester-proofOfOwnership // tester使用自身证书的私钥和接收的challenge计算所有权证明
server: 69 03 12 // 12 表示所有权证明校验成功,认证完成
一图胜千言,直接上图。
- 协商认证方式
- 单向认证请求
- 证书所有权校验
双向认证
双向认证示例:
注意:以下示例仅列出关键参数,具体请求参数与响应格式详见附录A和附录B
tester: 29 08 // 查询服务端支持的认证类型
server: 69 08 ARP // ARP含义: 02表示基于PKI,03表示基于非对称加密的ACR,04表示基于对称加密的ACR
tester: 29 02 00 Tester-Certificate + Tester-Challenge // 双向认证请求
server: 69 02 11 Ecu-Challenge + Ecu-Certificate + Ecu-proofOfOwnership // 11表示Client证书验证成功,接下来将进行所有权证明校验
tester: 29 03 Tester-proofOfOwnership
server: 69 03 12 // 12 表示所有权证明校验成功,认证完成
双向认证的过程基本和单向认证一致,只是在双向认证的过程中需要 ECU 端将自身的Challenge、证书和所有权证明一并发给 Tester 端。
取消认证
示例:
29 00
69 00 ARP // ARP 表示取消认证的结果,ARP 定义见下表
附录 A:29 服务子功能请求参数格式说明
Sub function Request | Name | Parameter Description |
29 00 | deAuthenticate 用于取消认证 | Request to leave the authenticated state 无其他请求参数 |
29 01 | verifyCertificateUnidirectional 用于 APCE 的单向认证 | Initiate Authentication by verifying the Certificate 请求参数包含: ① 通信配置-对通过认证以后的安全诊断通信进行说明,与安全诊断通信直接相关,该参数的格式及后续会话密钥(session key)的生、proof value的计算均由OEM定义 ② Client 证书长度 ③ Client 证书内容 ④ Client Challenge 长度 ⑤ Client Challenge 内容(仅在Challenge长度不等于0时有效) |
29 02 | verifyCertificateBidirectional 用于 APCE 的双向认证 | Initiate Authentication by verifying the Certificate and generating a Proof of Ownership from the server 请求参数同上 |
29 03 | proofOfOwnership 用于 APCE 校验证书所有权 | Verify the Proof of Ownership from the client. 请求参数包含: ① Client 所有权证明长度 ② Client 所有权证明内容 ③ Client 临时公钥长度 ④ Client 临时公钥内容(仅在临时公钥长度不等于0时有效) |
29 04 | transmitCertificate 用于 APCE 传输证书数据 | Verify Certificate and extract information from Certificate to handle it according to its contents. 请求参数包含: ① 证书ID - certificateEvaluationId,用于识别证书的评估类型,由OEM自定义 ② 证书长度 ③ 证书内容 |
29 05 | requestChallengeForAuthentication 用于 ACR 获取 Challenge | Initiate the Authentication process by requesting server to output a challenge. 请求参数包含: ① 通信配置 ② 算法标识符 |
29 06 | verifyProofOfOwnershipUnidirectional 用于 ACR 单向认证所有权校验 | Request server to verify the POWN for unidirectional authentication. 请求参数包含: ① 算法标识符 - 指示验证所有权证明的算法,也决定了算法需要用到的参数及加密诊断通信的密钥生成方法,该值是左对齐的 并以0为单位向右填充,最多16个字节。 ② Client 所有权证明的长度 ③ Client 所有权证明内容 ④ Client Challenge 长度 ⑤ Client Challenge 内容(仅在 Challenge 长度不等于0时有效) ⑥ 附加参数长度 ⑦ 附加参数内容(仅在附加参数长度不能于0时有效) |
29 07 | verifyProofOfOwnershipBidirectional 用于 ACR 双向认证所有权校验 | Request server to verify the client side POWN and provide server-side POWN for bidirectional authentication. 请求参数同上 |
29 08 | authenticationConfiguration 用于协商认证方式 | Indicates the provided authentication configuration of the server. 无其他请求参数 |
附录 B:29 服务子功能肯定响应参数格式说明
Sub function Request | Name | Parameter Description |
69 00 | deAuthenticate | 响应参数包含: ① ARP:见下表 |
69 01 | verifyCertificateUnidirectional | 响应参数包含: ① ARP:见下表 ② Server Challenge 长度 ③ Server Challenge 内容 ④ Server 临时公钥长度 ⑤ Server 临时公钥内容(仅在临时公钥长度不等于0时有效) |
69 02 | verifyCertificateBidirectional | 响应参数包含: ① ARP:见下表 ② Server Challenge 长度 ③ Server Challenge 内容 ④ Server 证书长度 ⑤ Server 证书内容 ⑥ Server 所有权证明长度 ⑦ Server 所有权证明内容 ⑧ Server 临时公钥长度 ⑨ Server 临时公钥内容(仅在临时公钥长度不等于0时有效) |
69 03 | proofOfOwnership | 响应参数包含: ① ARP:见下表 ② 会话密钥长度 ③ 会话密钥内容(仅在会话密钥长度不等于0时有效) |
69 04 | transmitCertificate | 响应参数包含: ① ARP:见下表 |
69 05 | requestChallengeForAuthentication | 响应参数包含: ① ARP:见下表 ② 算法标识符 ③ Server Challenge 长度 ④ Server Challenge 内容 ⑤ 附加参数长度 ⑥ 附加参数内容(仅在附加参数长度不等于0时有效) |
69 06 | verifyProofOfOwnershipUnidirectional | 响应参数包含: ① ARP:见下表 ② 算法标识符 ③ 会话密钥长度 ④ 会话密钥内容(仅在会话密钥长度不等于0时有效) |
69 07 | verifyProofOfOwnershipBidirectional | 响应参数包含: ① ARP:见下表 ② 算法标识符 ③ Server 所有权证明长度 ④ Server 所有权证明内容 ⑤ 会话密钥长度 ⑥ 会话密钥内容(仅在会话密钥长度不等于0时有效) |
69 08 | authenticationConfiguration | 响应参数包含: ① ARP:见下表 |
ARP(authenticationReturnParameter)定义
Byte value | Description |
0x00 | RequestAccepted Request was successful. |
0x01 | GeneralReject Request was not successful. |
0x02 | AuthenticationConfiguration APCE |
0x03 | AuthenticationConfiguration ACR with asymmetric cryptography |
0x04 | AuthenticationConfiguration ACR with symmetric cryptography |
0x05~0x0F | ISO/SAE Reserved |
0x10 | DeAuthentication successful DeAuthentication was successful, server is protected again. |
0x11 | CertificateVerified, OwnershipVerificationNecessary Certificate could be verified in first step, second step is pending. |
0x12 | OwnershipVerified, AuthenticationComplete Proof of Ownership could be verified, Authentication is complete. |
0x13 | CertificateVerified Certificate could be verified. |
0x14~0x9F | ISO/SAE Reserved |
0xA0~0xCF | VehicleManufacturerSpecific |
0xD0~0xFE | SystemSupplierSpecific |
0xFF | ISO/SAE Reserved |
本文暂时没有评论,来添加一个吧(●'◡'●)