硬汉嵌入式论坛

 找回密码
 立即注册
查看: 237|回复: 1
收起左侧

[算法] CMSIS-mbedTLS加密升级至V3.6.5(2025-12-02)

[复制链接]

1万

主题

7万

回帖

12万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
120428
QQ
发表于 2025-12-2 11:17:55 | 显示全部楼层 |阅读模式
https://github.com/ARM-software/CMSIS-mbedTLS

该项目的主要目标是将 mbedTLS与 CMSIS进行集成。通过这种集成,开发者可以在基于 ARM Cortex-M 微处理器的嵌入式平台上更高效地实现安全通信和数据加密功能。

主要特点和用途:

1、提供了适用于 ARM Cortex-M 微控制器的 mbedTLS 集成实现。
2、利用 CMSIS 的驱动和 RTOS 生态,提高了移植性和硬件加速支持能力。
3、方便开发者在嵌入式 IoT 设备、传感器、网关等场景中快速集成 TLS/SSL 安全协议。
4、支持常见的加密算法和协议,适合资源受限的嵌入式环境。
5、典型用户包括嵌入式系统开发者、IoT 设备制造商、安全通信应用开发者等。如果你需要在 ARM Cortex-M 平台上实现标准的加密与安全通信功能,这个项目会非常有用。


该项目实现了密码学原语、X.509证书操作以及SSL/TLS和DTLS协议。通过PSA加密API支持密码运算,该项目提供了PSA密码学API规范的参考实现。同时支持PSA密码处理器驱动接口规范,该规范定义了密码处理器驱动的接口标准。其精简的代码结构使其特别适合嵌入式系统,目前已被TF-A、TF-M和OP-TEE等多个项目采用。



更新记录:
[C] 纯文本查看 复制代码
= Mbed TLS 3.6.5 branch released 2025-10-15

API changes
   * When building the library as a PSA client (MBEDTLS_PSA_CRYPTO_CLIENT
     enabled and MBEDTLS_PSA_CRYPTO_C disabled), you need to provide the
     function psa_can_do_cipher() in addition to psa_can_do_hash(). This
     changed was made in Mbed TLS 3.6.0 but was not announced then.

Features
   * The new function mbedtls_cipher_finish_padded() is similar to
     mbedtls_cipher_finish(), but makes it easier to process invalid-padding
     conditions in constant time.

Security
   * Fix a timing side channel in CBC-PKCS7 decryption that could
     allow an attacker who can submit chosen ciphertexts to recover
     some plaintexts through a timing-based padding oracle attack.
     Credits to Beat Heeb from Oberon microsystems AG. CVE-2025-59438
   * Fix a local timing side-channel in modular inversion and GCD that was
     exploitable in RSA key generation and other RSA operations (see the full
     advisory for details), allowing a local attacker to fully recover the
     private key. This can be exploited on some Arm-v9 CPUs by an unprivileged
     attacker running code on the same core (SSBleed), or when Trustzone-M is
     used, by the non-secure side abusing timer interrupts (M-Step), and
     probably in other similar settings as well. Found and reported
     independently by: SSBleed: Chang Liu (Tsinghua University) and Trevor E.
     Carlson (National University of Singapore); M-Step: Cristiano Rodrigues
     (University of Minho), Marton Bognar (DistriNet, KU Leuven), Sandro Pinto
     (University of Minho), Jo Van Bulck (DistriNet, KU Leuven). CVE-2025-54764

Bugfix
    * Fix potential CMake parallel build failure when building both the static
      and shared libraries.
   * Fix a build error or incorrect TLS session
     lifetime on platforms where mbedtls_time_t
     is not time_t. Fixes #10236.

Changes
   * The function mbedtls_mpi_gcd() now always gives a non-negative output.
     Previously the output was negative when B = 0 and A < 0, which was not
     documented, and inconsistent as all other inputs resulted in a non-negative
     output.


参考案例:

SP视频教程第19期:单片机BootLoader的AES加密实战,含上位机和下位机代码全开源(2022-06-26)
https://forum.anfulai.cn/forum.php?mod=viewthread&tid=113361
回复

使用道具 举报

1万

主题

7万

回帖

12万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
120428
QQ
 楼主| 发表于 2025-12-2 11:19:35 | 显示全部楼层

API 变更
当将库构建为 PSA 客户端时(启用 MBEDTLS_PSA_CRYPTO_CLIENT 且禁用 MBEDTLS_PSA_CRYPTO_C),除了提供 psa_can_do_hash() 函数外,还需要提供 psa_can_do_cipher() 函数。此变更在 Mbed TLS 3.6.0 中引入,但当时未作说明。

新功能
新增函数 mbedtls_cipher_finish_padded(),其功能与 mbedtls_cipher_finish() 类似,但能更便捷地在恒定时间内处理无效填充情况。

安全修复
修复了 CBC-PKCS7 解密中的一个时序侧信道漏洞。攻击者可能通过提交特定密文,利用基于时序的填充预言攻击来恢复部分明文。致谢 Oberon microsystems AG 的 Beat Heeb。CVE-2025-59438

修复了模逆运算和最大公约数计算中的本地时序侧信道漏洞。该漏洞可在 RSA 密钥生成及其他 RSA 操作中被利用(详见完整公告),允许本地攻击者完全恢复私钥。在某些 Arm-v9 CPU 上,无特权的攻击者可在同一核心上运行代码进行利用(SSBleed);或在使用 Trustzone-M 时,非安全端通过滥用定时器中断进行利用(M-Step),其他类似场景也可能受影响。独立发现并报告者:SSBleed:刘畅(清华大学)与 Trevor E. Carlson(新加坡国立大学);M-Step:Cristiano Rodrigues(米尼奥大学)、Marton Bognar(DistriNet,鲁汶大学)、Sandro Pinto(米尼奥大学)、Jo Van Bulck(DistriNet,鲁汶大学)。CVE-2025-54764

错误修复
修复了同时构建静态库和共享库时可能出现的 CMake 并行编译失败问题。
修复了在 mbedtls_time_t 非 time_t 的平台上的编译错误或 TLS 会话生存期计算错误问题。修复 #10236。

变更
函数 mbedtls_mpi_gcd() 现在始终输出非负数结果。此前当 B = 0 且 A < 0 时输出为负数,该行为未在文档中说明,且与所有其他输入均产生非负数结果的情况不一致。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2026-1-10 07:55 , Processed in 0.038432 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表