Topic

FAQ
Login Register
Failed in verifying 'Attestation Information' command received from the device: err 604.
May 09, 2024 11:46

/

A

/A

Hello,

  我们在使用tlsr9218进行matter over thread开发,验证使用第三方证书来生成证书链(带origin vid)时,遇到CD的VID验证错误,下面是我的操作:

1. 生成DAC和CD

# 生成PAA:
$ ./chip-cert gen-att-cert --type a \
   --subject-cn "TEST PAA" \
  --subject-vid 0x131b \
 省略......


# 生成PAI:
$ ./chip-cert gen-att-cert --type i \
  --subject-cn "TEST PAI" \
  --subject-vid 0x131b \
  省略......

# 生成CD:
$ ./chip-cert gen-cd --format-version 1 \
  --vendor-id 0x128a \
  --product-id 0x1001 \
  --dac-origin-vendor-id 0x131b \
  --dac-origin-product-id 0x1234 \
  --device-type-id 0x010a \
  --certificate-id CSA00000SWC00000-01 \
  --security-level 0 --security-info 0 --version-number 1 \
  --certification-type 1 \
  --key credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem \
  --cert credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem \
  --out test_origin_paa/Test_CD.der

# 生成DAC
python3 scripts/tools/telink/mfg_tool.py \
  --vendor-id 0x131b --product-id 0x1234 \
  --serial-num AABBCCDDEEFF11223344556677889900 \
  --vendor-name "Test" \
  --product-name "Test Smart Plug" \
  --mfg-date 2024-05-07 \
  --hw-ver 1 \
  --hw-ver-str "v1.0.0" \
  --enable-rotating-device-id \
  --pai \
  --key test_origin_paa/Test_PAI_Key.pem \
  --cert test_origin_paa/Test_PAI_Cert.pem \
  -cd test_origin_paa/Test_CD.der \
  --spake2-path build/out/host/spake2p \
  --chip-tool-path build/out/host/chip-tool \
  --chip-cert-path build/out/host/chip-cert \
  --offset 0x107000 --size 0x1000 \
  --out factory_data_for_2mb_flash


2. 将origin_paa中的CD转换成.h后,写入应用程序的CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION宏

3. 在应用程序的prj.conf中打开下列宏:

CONFIG_CHIP_FACTORY_DATA=y

CONFIG_CHIP_FACTORY_DATA_BUILD=n

CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=y


4. 写入应用程序固件和证书固件

5. 使用chip-tool进行配网测试:

sudo ./chip-tool pairing ble-thread 1 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fd6bf201bbf700ca051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f010212340410445f2b5ca6f2a93a55ce570a70efeecb0c0402a0f7f8 53381012 3475 --paa-trust-store-path ./telink-certs


报错如下(chip-tool端):


设备端打印出来的VID,PID是第三方的,不是我们自己的:


TL_Soyo May 09, 2024 15:43
0
/A

你好,

  尝试跟着这的步骤测试下,https://developers.telink-semi.cn/user/zm_tina/

6 replies
TL_Soyo May 09, 2024 15:43
0
/A

你好,

  尝试跟着这的步骤测试下,https://developers.telink-semi.cn/user/zm_tina/

denghongyan [Author] May 09, 2024 16:00
0
/A


你好,感谢回答,https://developers.telink-semi.cn/user/zm_tina/的测试步骤我看了的,我这边生成DAC命令中不带--dac-origin-vendor-id参数的话,我是能够正常配网,证书链是没有问题的。


我的需求是使用第三方提供PAA、PAI的方式,来生成自己的DAC,因此生成DAC的命令不一样,带了--dac-origin-vendor-id参数,之后就有如上报错,感觉是PID,VID映射有问题,我不知道是否需要配置什么宏定义来实现这个映射,也没有找到相关文档指导,十分苦恼。

Jinmiao.Yu May 10, 2024 13:56
0
/A

你好,

看了你的步骤以后我觉得可能是以下的部分导致最后验证出错:

1. 在生成cd的时候origin-vid是0x131b,但是生成的cd对应的vid是0x128a,在后续生成DAC的时候不应该使用0x131b,而应该使用你准备生成的0x128a,(pid也是同样)

2. 在生成DAC的时候选择pem和der文件,不应该选择测试用的,应该选择你上面自己生成的


你可以修改这些部分后再尝试。

denghongyan [Author] May 15, 2024 13:24
0
/A

Hello,


请问telink 的matter解决方案支持下面这种证书方式吗: