Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agents/docs/2026-12-01-add-mbedtls-m-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@

- `*_self_test` 函数由头文件声明并导出,但 `compat.mbedtls` 未以 `MBEDTLS_SELF_TEST_C` 构建,链接它们会失败;`tests/linked.cpp` 说明了这一点,文档要求在 `#if defined(MBEDTLS_SELF_TEST_C)` 下调用。
- 版本尾号:首个 mwrap 身份直接用上游版本 `3.6.8`,后续包装修订才加 `.1`。

## 3.6.8.1(2026-12-01,wrapper 修订)

- 起因:首个消费者(xgit)按 README 写 `import mcpplibs.mwrap.mbedtls.sha256;`,得到 "module not found":各算法组在 mwrap-3.6.8 里是根模块的**分区**(`mcpplibs.mwrap.mbedtls:sha256`),只能经根模块导入,与 README 和 mwrap 规范(根模块 + 子模块 `mcpplibs.mwrap.<lib>.<group>`,docs/zh/mwrap.md)都不一致。
- 修复:mcpplibs/mbedtls-m#1——`tools/generate.py` 生成 `export module mcpplibs.mwrap.mbedtls.<group>;`,根模块 `export import` 六个子模块(根的导入方不变);`tests/submodule_test.cpp` 只导入 `.sha256`。CI 6/6 通过,squash 合入,tag/release `mwrap-3.6.8.1`。
- 来源:release 资产 `mbedtls-m-3.6.8.1.tar.gz`(GitHub `archive/refs/tags/mwrap-3.6.8.1.tar.gz` 原样上传;下载两次 sha256 一致,资产回读一致):`bcd9eb19871be089bf1add6672941425eab92a0310ec236a63115ca0b3a15e94`。
- 索引:三平台加 `["3.6.8.1"]`(GLOBAL 字符串 url,CN 镜像仍为维护者步骤);`tests/mwrap/mbedtls-hashes` 升到 3.6.8.1,新增 `tests/submodule.cpp` 只导入 `.sha256`,钉住子模块契约。`mcpp xpkg parse` 通过。
16 changes: 15 additions & 1 deletion pkgs/mwrap/mbedtls.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-- Immutable upstream-aligned mwrap source release (mbedtls-m mwrap-3.6.8).
-- Immutable upstream-aligned mwrap source release (mbedtls-m mwrap-3.6.8;
-- mwrap-3.6.8.1 is a wrapper revision: each hash group its own sub-module, as
-- the mwrap spec names them, the root re-exporting the six).
-- GLOBAL only: the CN mirror under mcpp-res is a maintainer's step; the
-- plain string form is what the lint allows until then (docs/cn-mirror.md).
--
Expand All @@ -25,18 +27,30 @@ package = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8/mbedtls-m-3.6.8.tar.gz",
sha256 = "91a2ecb55857499426bc764a3b7c1a1f2f94d3f8051e962cb4ff1db99f2c1584",
},
["3.6.8.1"] = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8.1/mbedtls-m-3.6.8.1.tar.gz",
sha256 = "bcd9eb19871be089bf1add6672941425eab92a0310ec236a63115ca0b3a15e94",
},
},
macosx = {
["3.6.8"] = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8/mbedtls-m-3.6.8.tar.gz",
sha256 = "91a2ecb55857499426bc764a3b7c1a1f2f94d3f8051e962cb4ff1db99f2c1584",
},
["3.6.8.1"] = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8.1/mbedtls-m-3.6.8.1.tar.gz",
sha256 = "bcd9eb19871be089bf1add6672941425eab92a0310ec236a63115ca0b3a15e94",
},
},
windows = {
["3.6.8"] = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8/mbedtls-m-3.6.8.tar.gz",
sha256 = "91a2ecb55857499426bc764a3b7c1a1f2f94d3f8051e962cb4ff1db99f2c1584",
},
["3.6.8.1"] = {
url = "https://github.com/mcpplibs/mbedtls-m/releases/download/mwrap-3.6.8.1/mbedtls-m-3.6.8.1.tar.gz",
sha256 = "bcd9eb19871be089bf1add6672941425eab92a0310ec236a63115ca0b3a15e94",
},
},
},
}
4 changes: 2 additions & 2 deletions tests/mwrap/mbedtls-hashes/mcpp.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mbedtls-hashes"
version = "3.6.8"
version = "3.6.8.1"
description = "Consume the immutable Mbed TLS wrapper: the published digests of abc for every hash, streaming equal to one call, and HMAC-SHA-256 from RFC 4231"

[dependencies]
mcpplibs.mwrap.mbedtls = "3.6.8"
mcpplibs.mwrap.mbedtls = "3.6.8.1"
13 changes: 13 additions & 0 deletions tests/mwrap/mbedtls-hashes/tests/submodule.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 3.6.8.1: each hash group is a sub-module of its own, as the README and the
// mwrap spec name them; until then they were partitions of the root, and this
// import did not compile. SHA-256 alone, by FIPS 180-2's vector for "abc".
import std;
import mcpplibs.mwrap.mbedtls.sha256;

int main() {
unsigned char out[32] = {};
if (mbedtls_sha256(reinterpret_cast<const unsigned char*>("abc"), 3, out, 0) != 0) return 1;
std::string hex;
for (auto b : out) hex += std::format("{:02x}", b);
return hex == "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" ? 0 : 2;
}
Loading