已关闭
nearlink_dk_3863_xts_minimal: testGetDevUdid 用例失败,security_unified 驱动被裁剪导致 SHA256 不可用 #732
jiawei-soar创建于  9月14日关闭于  9月15日
jiawei-soar
jiawei-soar
9月14日 创建

问题描述

nearlink_dk_3863_xts_minimal 产品的 testGetDevUdid XTS 用例失败,GetDevUdid() 返回 -1,错误信息为 Error: hash start unregister!。

原因分析

config_patch.py 中 ram_component_set 裁剪了 security_unified 驱动,但 defines 中仍保留 MBEDTLS_HARDEN_OPEN,导致:

  1. mbedtls SHA256 走硬件加速路径调用 mbedtls_alt_hash_start()
  2. 但 mbedtls_alt_hash_init()(注册 Hash 函数)所在的 security_unified 驱动被裁剪,未编译
  3. g_hash_func.start 保持 NULL,mbedtls_alt_hash_start() 返回 -1
  4. GetDevUdid → CalcDevUdid → GetSha256Value → mbedtls_sha256 调用链失败

影响范围

仅影响 nearlink_dk_3863_xts_minimal 产品。nearlink_dk_3863 和 nearlink_dk_3863_xts 使用 SDK 默认配置(包含 security_unified),不受影响。

修复方案

在 config_patch.py 中恢复 security_unified 驱动,将 '-:security_unified' 改为 'security_unified'。

资源开销

  • ROM 增量:+39.3 KB(.text 段)/ +41 KB(固件包)
  • 静态 RAM 增量:+3.6 KB(.data + .bss)
  • 动态 RAM 增量:+2.2 KB(堆内存)
  • 总 RAM 增量:+5.8 KB
likedislike
openharmony_ci
openharmony_ci成员
9月14日 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@Dufree](https://gitcode.com/Dufree) [@bob_qu](https://gitcode.com/bob_qu) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
9月14日 添加了label:waiting_for_assign
jiawei-soarjiawei-soar
9月14日 关联了pull request:fix(nearlink_dk_3863_xts_minimal): restore security_unified driver to fix testGetDevUdid failure
jiawei-soarjiawei-soar
9月14日 关联了pull request:fix(nearlink_dk_3863_xts_minimal): restore security_unified driver to fix testGetDevUdid failure
jiawei-soarjiawei-soar
9月14日 关联了pull request:fix(nearlink_dk_3863_xts_minimal): restore security_unified driver to fix testGetDevUdid failure
openharmony_ciopenharmony_ci成员
9月15日 关闭了 issue
openharmony_ciopenharmony_ci成员
9月15日 issue状态由 待办的 改变为 已完成