diff --git a/Directory.Build.props b/Directory.Build.props
index 668112f..1f86bdd 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -22,7 +22,7 @@
-->
11.3.9
8.2.2
- 1.0.7
+ 1.0.9
Morris
GC
zh-Hans
diff --git a/GC-SAVEDOG/Program.cs b/GC-SAVEDOG/Program.cs
index a3efa47..7420682 100644
--- a/GC-SAVEDOG/Program.cs
+++ b/GC-SAVEDOG/Program.cs
@@ -23,7 +23,7 @@ namespace GC.Savedog;
///
internal static class Program
{
- private const string DefaultKeyId = "gc-2026-11";
+ private const string DefaultKeyId = "gc-2026-12";
private const string DefaultKeyPath = ".signing/gc-signing.pem";
private static int Main(string[] args)
diff --git a/GC/src/Security/SignatureKeyring.cs b/GC/src/Security/SignatureKeyring.cs
index 6e68726..8be219d 100644
--- a/GC/src/Security/SignatureKeyring.cs
+++ b/GC/src/Security/SignatureKeyring.cs
@@ -20,12 +20,21 @@ public static class SignatureKeyring
private static readonly List KeysInternal = new()
{
- // 生产密钥(2026-11 生成)。指纹 b41b1dd6259ea9ed
+ // 生产密钥(2026-12 换发)。指纹 ee6083be47a87907
+ // 上一代 gc-2026-11 的私钥没有留存,无法再签出可通过校验的清单,
+ // 因此新增这一把;旧公钥保留一个版本周期,方便过渡期排查。
+ new KeyEntry(
+ "gc-2026-12",
+ "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4R+R2Pvinsu/xdaUu5mATPyYoEpL6" +
+ "cyugSVKAVMz6yY15SjkgEvdosfWuQJBbrPOOgGulE6Jht6v7FZx1dQguQ==",
+ "GC 主发布密钥"),
+
+ // 已停用(私钥遗失):保留仅为兼容历史诊断输出,不能用于验签新清单。
new KeyEntry(
"gc-2026-11",
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEny5YKVBZUzOyRcSiuutlGmBb4+xm" +
"PrNDGshilBlpmFyWu5Atq+FGP2tn+8Or8V7OH+/7lhCmXu8jZuC5/5CWSw==",
- "GC 主发布密钥")
+ "已停用:私钥遗失")
};
static SignatureKeyring() => LoadFromEnvironment();
diff --git a/GC/src/test/dotnet/GC.Tests/Program.cs b/GC/src/test/dotnet/GC.Tests/Program.cs
index e49d0d5..43d9a4c 100644
--- a/GC/src/test/dotnet/GC.Tests/Program.cs
+++ b/GC/src/test/dotnet/GC.Tests/Program.cs
@@ -310,8 +310,10 @@ internal static class Program
/// 序列化清单并用私钥签名(测试里模拟一次正式发布)。
private static void WriteSigned(string path, RepoVersion version, ECDsa key)
{
+ // keyId 必须与 .signing/ 里的私钥对应的公钥条目一致,否则客户端按 keyId
+ // 查不到受信任公钥,会判成 Invalid 而不是 Verified。
var text = JsonSerializer.Serialize(version, Json.Options) + "\n";
- File.WriteAllText(path, ManifestSignature.SignDocument(text, key, "gc-2026-11"));
+ File.WriteAllText(path, ManifestSignature.SignDocument(text, key, "gc-2026-12"));
}
private static void CopyTree(string src, string dst)
diff --git a/README.md b/README.md
index ce6f570..aee3d08 100644
--- a/README.md
+++ b/README.md
@@ -135,12 +135,23 @@ Windows 用 `.\build.ps1`,参数相同(`build / check / models / stamp / run
### 签名密钥
- 私钥:`.signing/gc-signing.pem`(**已在 `.gitignore`,永不入库**;请自行备份)
-- 公钥:硬编码在 `GC/src/Security/SignatureKeyring.cs`,指纹 `b41b1dd6259ea9ed`
-- 生成新密钥:`dotnet run --project GC-SAVEDOG -- keygen`
-- 轮换:把新公钥追加进 `SignatureKeyring.Keys`(保留旧公钥一个版本周期),再重新签名清单
+- 公钥:硬编码在 `GC/src/Security/SignatureKeyring.cs`
+ - 当前生效:`gc-2026-12`,指纹 `ee6083be47a87907`
+ - 已停用:`gc-2026-11`,指纹 `b41b1dd6259ea9ed`(私钥遗失,仅保留占位)
+- 生成新密钥:`dotnet run --project GC-SAVEDOG -- keygen --key-id gc-YYYY-MM`
+- 轮换:把新公钥追加进 `SignatureKeyring.Keys`(保留旧公钥一个版本周期),
+ 同时把 `GC_SIGNING_KEY_ID`(默认值在 `buildsh/lib/build_funcs.sh`)改成新 keyId,
+ 再重新签名清单
- 部署前核对两边公钥一致:
`dotnet run --project GC-SAVEDOG -- verify --manifest version.json`
+`build.sh` 在刷新清单后自动调用 `sign_manifest` 签名并同步 `model/version.json`;
+`.signing/gc-signing.pem` 不存在时只告警,清单不带签名(客户端会拒绝更新)。
+
+> 换钥匙的代价:老客户端只认识编译进去的那份公钥,所以**用新密钥签出的清单
+> 在旧版本上会判成「签名无效」**。密钥一旦丢失,只能靠发一个新版本把新公钥带出去,
+> 中间这段时间老客户端无法自动更新 —— 私钥务必备份两处以上。
+
### zip 解压加固
更新包和模型源 zip 一律当成不可信输入:拒绝 `../`、绝对路径、盘符、UNC、符号链接;
diff --git a/buildsh/lib/build_funcs.sh b/buildsh/lib/build_funcs.sh
index de9b65f..c28f241 100644
--- a/buildsh/lib/build_funcs.sh
+++ b/buildsh/lib/build_funcs.sh
@@ -24,7 +24,7 @@ stamp_launcher_only() {
# 没有私钥时只警告:清单不带 signature,客户端会按「未签名」处理。
sign_manifest() {
KEY="$ROOT_DIR/.signing/gc-signing.pem"
- KEYID="${GC_SIGNING_KEY_ID:-gc-2026-11}"
+ KEYID="${GC_SIGNING_KEY_ID:-gc-2026-12}"
if [ ! -f "$KEY" ]; then
echo "!! 未找到签名私钥 ${KEY},本次 version.json 未签名(客户端会拒绝更新)"
echo " 生成密钥:dotnet run --project GC-SAVEDOG -- keygen"
diff --git a/model/contour-map/contour-map.json b/model/contour-map/contour-map.json
index 19f41ed..096db79 100644
--- a/model/contour-map/contour-map.json
+++ b/model/contour-map/contour-map.json
@@ -26,5 +26,5 @@
"frame": "#0A1524"
},
"build": "773ab2161d",
- "updatedAt": "2026-11-18T04:35:15Z"
+ "updatedAt": "2026-11-18T10:16:41Z"
}
diff --git a/model/earth-geography/earth-geography.json b/model/earth-geography/earth-geography.json
index 4b2f52d..d447538 100644
--- a/model/earth-geography/earth-geography.json
+++ b/model/earth-geography/earth-geography.json
@@ -26,5 +26,5 @@
"frame": "#0A1524"
},
"build": "cc68b8863b",
- "updatedAt": "2026-11-18T04:35:15Z"
+ "updatedAt": "2026-11-18T10:16:41Z"
}
diff --git a/model/earth-revolution/earth-revolution.json b/model/earth-revolution/earth-revolution.json
index 9524da0..50f3164 100644
--- a/model/earth-revolution/earth-revolution.json
+++ b/model/earth-revolution/earth-revolution.json
@@ -32,5 +32,5 @@
"frame": "#0A1524"
},
"build": "53b7a0fbc3",
- "updatedAt": "2026-11-18T04:35:15Z"
+ "updatedAt": "2026-11-18T10:16:41Z"
}
diff --git a/model/earth-rotation/earth-rotation.json b/model/earth-rotation/earth-rotation.json
index 6df0b46..0efb414 100644
--- a/model/earth-rotation/earth-rotation.json
+++ b/model/earth-rotation/earth-rotation.json
@@ -32,5 +32,5 @@
"frame": "#0A1524"
},
"build": "ecd52665f9",
- "updatedAt": "2026-11-18T04:35:15Z"
+ "updatedAt": "2026-11-18T10:16:41Z"
}
diff --git a/model/scale-calculator/scale-calculator.json b/model/scale-calculator/scale-calculator.json
index 82c4275..c56f9c3 100644
--- a/model/scale-calculator/scale-calculator.json
+++ b/model/scale-calculator/scale-calculator.json
@@ -33,5 +33,5 @@
"frame": "#F4F6FB"
},
"build": "105653737d",
- "updatedAt": "2026-11-18T04:35:15Z"
+ "updatedAt": "2026-11-18T10:16:41Z"
}
diff --git a/model/version.json b/model/version.json
index 9c223a2..6143f2b 100644
--- a/model/version.json
+++ b/model/version.json
@@ -1,48 +1,48 @@
{
"schema": 1,
- "generated": "2026-11-18T05:48:18Z",
+ "generated": "2026-11-18T10:16:41Z",
"repository": "https://git.xhmcl.com/Morris/GC",
"branch": "main",
"modelDir": "model",
"launcher": {
- "version": "1.0.8",
+ "version": "1.0.9",
"revision": "",
"packages": {
"win-x64": {
- "path": "dist/win-amd64/GC-1.0.8-win-amd64.zip",
+ "path": "dist/win-amd64/GC-1.0.9-win-amd64.zip",
"dir": "dist/win-amd64",
- "name": "GC-1.0.8-win-amd64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-win-amd64.zip",
- "sha256": "eb61c4aa619cb2245c5b79b733bf22a81ed63e304b794c3f0fb5a553e0e7f752",
- "size": 114371163
+ "name": "GC-1.0.9-win-amd64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-win-amd64.zip",
+ "sha256": "0807f1005e2d8bd54316529670cf1c3c89a2df07bd39297145f21c9a0aae5f04",
+ "size": 114372206
},
"win-arm64": {
- "path": "dist/win-arm64/GC-1.0.8-win-arm64.zip",
+ "path": "dist/win-arm64/GC-1.0.9-win-arm64.zip",
"dir": "dist/win-arm64",
- "name": "GC-1.0.8-win-arm64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-win-arm64.zip",
- "sha256": "557a64b5028947435959329d2b23bcb24051cb62f7300e1d7c0e07599e467355",
- "size": 110424955
+ "name": "GC-1.0.9-win-arm64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-win-arm64.zip",
+ "sha256": "ffdc37f8ea5041d69be88ffbcbf9ba5d80f7fb97c6b3debc5a918ff89f9e7f60",
+ "size": 110425463
},
"osx-arm64": {
- "path": "dist/mac-arm64/GC-1.0.8-mac-arm64.zip",
+ "path": "dist/mac-arm64/GC-1.0.9-mac-arm64.zip",
"dir": "dist/mac-arm64",
- "name": "GC-1.0.8-mac-arm64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-mac-arm64.zip",
- "sha256": "c01ae349fbd897a4bb21119360b8afb952900e4791738efc33b74c974bac1c14",
- "size": 60065452
+ "name": "GC-1.0.9-mac-arm64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-mac-arm64.zip",
+ "sha256": "e62bbc8c9925d8158f850440600b5d16af7539c85651a5ebcc5f9a85d4c9bb01",
+ "size": 60066040
},
"osx-x64": {
- "path": "dist/mac-x64/GC-1.0.8-mac-x64.zip",
+ "path": "dist/mac-x64/GC-1.0.9-mac-x64.zip",
"dir": "dist/mac-x64",
- "name": "GC-1.0.8-mac-x64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-mac-x64.zip"
+ "name": "GC-1.0.9-mac-x64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-mac-x64.zip"
},
"linux-x64": {
- "path": "dist/linux-amd64/GC-1.0.8-linux-amd64.zip",
+ "path": "dist/linux-amd64/GC-1.0.9-linux-amd64.zip",
"dir": "dist/linux-amd64",
- "name": "GC-1.0.8-linux-amd64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-linux-amd64.zip"
+ "name": "GC-1.0.9-linux-amd64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-linux-amd64.zip"
}
}
},
@@ -51,7 +51,7 @@
"id": "contour-map",
"version": "1.1",
"build": "773ab2161d",
- "manifestSha256": "1542e3132541e34f9a371ec11d56beb4479b7824433d97083e78c4349af48cff",
+ "manifestSha256": "f86a3f83d5953cafc333585da3009d8846448f6a8a9df13b39cde57b36037733",
"filesSha256": "a6bdf9b4273aabee50c3c94ceab4d0abee15f0df1af90c58bdbb796e0d2d5699",
"files": 5,
"dir": "model/contour-map"
@@ -60,7 +60,7 @@
"id": "earth-geography",
"version": "1.9",
"build": "cc68b8863b",
- "manifestSha256": "62e5c3b2ec28c89ade9131f44854ff45b24873193036ce2e13b18d9b68a320cd",
+ "manifestSha256": "448f050fded46d7bfc8f0c3856e741c4a4f82523c8e012dd846ddcd400ff394a",
"filesSha256": "c018ba481831e23d3183a38ac47251f19754c7464baa5d85b47cea7a49fcfa95",
"files": 11,
"dir": "model/earth-geography"
@@ -69,7 +69,7 @@
"id": "earth-revolution",
"version": "1.7",
"build": "53b7a0fbc3",
- "manifestSha256": "12a628168785740f67d7bafcce8467875f741b31a1b852643f28ed879972210f",
+ "manifestSha256": "c69fc53f50213c6ab7658e1a761a20d2c55a7a344beb3c75a30393c26fa40167",
"filesSha256": "4cd45b0324a77574a0da3a939c2a6faebc785c5a24cb50136d62a78a6ea2e9b1",
"files": 7,
"dir": "model/earth-revolution"
@@ -78,7 +78,7 @@
"id": "earth-rotation",
"version": "1.7",
"build": "ecd52665f9",
- "manifestSha256": "3a492fe3220a3093569164735420d21470e971ca1c73f1ada73c5d91cdd651da",
+ "manifestSha256": "cbf12a47747a331c9980260f39169b1813bb4b52a8916995fda05755267bddca",
"filesSha256": "594b005a6a9f36cd0b5d4e4a7a0b1ab42d53c8032832545b71c3915493d56c8e",
"files": 7,
"dir": "model/earth-rotation"
@@ -87,10 +87,17 @@
"id": "scale-calculator",
"version": "1.6",
"build": "105653737d",
- "manifestSha256": "c1d65815cfea866e4461b877d53f7af4a920dcb559e2b2453a6bcaa3e1650c66",
+ "manifestSha256": "fc6f7deb1efb076cc0bbee732e7de8f007ed74bc837dba2268be1e0adc1839d3",
"filesSha256": "732dd26406e0f1e836970499d7ea644def332ce909d7f8aa0a403bbe7337e604",
"files": 6,
"dir": "model/scale-calculator"
}
- ]
+ ],
+ "signature": {
+ "alg": "ECDSA-P256-SHA256",
+ "keyId": "gc-2026-12",
+ "value": "A2jaSxRK1B43k8uOWmC/8diYG6JYUncGgjXW8B1ntO5Ag5rsG7Pb2gMz5ad6AcwjZ9zs8qtsSxJv8vLsUNXtWw==",
+ "contentSha256": "3bf738a164537e5d575e75c314f0ac01af1cb5d4d7cb882489d8dedeb73f51e9",
+ "signedAt": "2026-11-18T10:18:01Z"
+ }
}
diff --git a/version.json b/version.json
index 9c223a2..6143f2b 100644
--- a/version.json
+++ b/version.json
@@ -1,48 +1,48 @@
{
"schema": 1,
- "generated": "2026-11-18T05:48:18Z",
+ "generated": "2026-11-18T10:16:41Z",
"repository": "https://git.xhmcl.com/Morris/GC",
"branch": "main",
"modelDir": "model",
"launcher": {
- "version": "1.0.8",
+ "version": "1.0.9",
"revision": "",
"packages": {
"win-x64": {
- "path": "dist/win-amd64/GC-1.0.8-win-amd64.zip",
+ "path": "dist/win-amd64/GC-1.0.9-win-amd64.zip",
"dir": "dist/win-amd64",
- "name": "GC-1.0.8-win-amd64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-win-amd64.zip",
- "sha256": "eb61c4aa619cb2245c5b79b733bf22a81ed63e304b794c3f0fb5a553e0e7f752",
- "size": 114371163
+ "name": "GC-1.0.9-win-amd64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-win-amd64.zip",
+ "sha256": "0807f1005e2d8bd54316529670cf1c3c89a2df07bd39297145f21c9a0aae5f04",
+ "size": 114372206
},
"win-arm64": {
- "path": "dist/win-arm64/GC-1.0.8-win-arm64.zip",
+ "path": "dist/win-arm64/GC-1.0.9-win-arm64.zip",
"dir": "dist/win-arm64",
- "name": "GC-1.0.8-win-arm64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-win-arm64.zip",
- "sha256": "557a64b5028947435959329d2b23bcb24051cb62f7300e1d7c0e07599e467355",
- "size": 110424955
+ "name": "GC-1.0.9-win-arm64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-win-arm64.zip",
+ "sha256": "ffdc37f8ea5041d69be88ffbcbf9ba5d80f7fb97c6b3debc5a918ff89f9e7f60",
+ "size": 110425463
},
"osx-arm64": {
- "path": "dist/mac-arm64/GC-1.0.8-mac-arm64.zip",
+ "path": "dist/mac-arm64/GC-1.0.9-mac-arm64.zip",
"dir": "dist/mac-arm64",
- "name": "GC-1.0.8-mac-arm64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-mac-arm64.zip",
- "sha256": "c01ae349fbd897a4bb21119360b8afb952900e4791738efc33b74c974bac1c14",
- "size": 60065452
+ "name": "GC-1.0.9-mac-arm64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-mac-arm64.zip",
+ "sha256": "e62bbc8c9925d8158f850440600b5d16af7539c85651a5ebcc5f9a85d4c9bb01",
+ "size": 60066040
},
"osx-x64": {
- "path": "dist/mac-x64/GC-1.0.8-mac-x64.zip",
+ "path": "dist/mac-x64/GC-1.0.9-mac-x64.zip",
"dir": "dist/mac-x64",
- "name": "GC-1.0.8-mac-x64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-mac-x64.zip"
+ "name": "GC-1.0.9-mac-x64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-mac-x64.zip"
},
"linux-x64": {
- "path": "dist/linux-amd64/GC-1.0.8-linux-amd64.zip",
+ "path": "dist/linux-amd64/GC-1.0.9-linux-amd64.zip",
"dir": "dist/linux-amd64",
- "name": "GC-1.0.8-linux-amd64.zip",
- "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.8/GC-1.0.8-linux-amd64.zip"
+ "name": "GC-1.0.9-linux-amd64.zip",
+ "url": "https://git.xhmcl.com/Morris/GC/releases/download/1.0.9/GC-1.0.9-linux-amd64.zip"
}
}
},
@@ -51,7 +51,7 @@
"id": "contour-map",
"version": "1.1",
"build": "773ab2161d",
- "manifestSha256": "1542e3132541e34f9a371ec11d56beb4479b7824433d97083e78c4349af48cff",
+ "manifestSha256": "f86a3f83d5953cafc333585da3009d8846448f6a8a9df13b39cde57b36037733",
"filesSha256": "a6bdf9b4273aabee50c3c94ceab4d0abee15f0df1af90c58bdbb796e0d2d5699",
"files": 5,
"dir": "model/contour-map"
@@ -60,7 +60,7 @@
"id": "earth-geography",
"version": "1.9",
"build": "cc68b8863b",
- "manifestSha256": "62e5c3b2ec28c89ade9131f44854ff45b24873193036ce2e13b18d9b68a320cd",
+ "manifestSha256": "448f050fded46d7bfc8f0c3856e741c4a4f82523c8e012dd846ddcd400ff394a",
"filesSha256": "c018ba481831e23d3183a38ac47251f19754c7464baa5d85b47cea7a49fcfa95",
"files": 11,
"dir": "model/earth-geography"
@@ -69,7 +69,7 @@
"id": "earth-revolution",
"version": "1.7",
"build": "53b7a0fbc3",
- "manifestSha256": "12a628168785740f67d7bafcce8467875f741b31a1b852643f28ed879972210f",
+ "manifestSha256": "c69fc53f50213c6ab7658e1a761a20d2c55a7a344beb3c75a30393c26fa40167",
"filesSha256": "4cd45b0324a77574a0da3a939c2a6faebc785c5a24cb50136d62a78a6ea2e9b1",
"files": 7,
"dir": "model/earth-revolution"
@@ -78,7 +78,7 @@
"id": "earth-rotation",
"version": "1.7",
"build": "ecd52665f9",
- "manifestSha256": "3a492fe3220a3093569164735420d21470e971ca1c73f1ada73c5d91cdd651da",
+ "manifestSha256": "cbf12a47747a331c9980260f39169b1813bb4b52a8916995fda05755267bddca",
"filesSha256": "594b005a6a9f36cd0b5d4e4a7a0b1ab42d53c8032832545b71c3915493d56c8e",
"files": 7,
"dir": "model/earth-rotation"
@@ -87,10 +87,17 @@
"id": "scale-calculator",
"version": "1.6",
"build": "105653737d",
- "manifestSha256": "c1d65815cfea866e4461b877d53f7af4a920dcb559e2b2453a6bcaa3e1650c66",
+ "manifestSha256": "fc6f7deb1efb076cc0bbee732e7de8f007ed74bc837dba2268be1e0adc1839d3",
"filesSha256": "732dd26406e0f1e836970499d7ea644def332ce909d7f8aa0a403bbe7337e604",
"files": 6,
"dir": "model/scale-calculator"
}
- ]
+ ],
+ "signature": {
+ "alg": "ECDSA-P256-SHA256",
+ "keyId": "gc-2026-12",
+ "value": "A2jaSxRK1B43k8uOWmC/8diYG6JYUncGgjXW8B1ntO5Ag5rsG7Pb2gMz5ad6AcwjZ9zs8qtsSxJv8vLsUNXtWw==",
+ "contentSha256": "3bf738a164537e5d575e75c314f0ac01af1cb5d4d7cb882489d8dedeb73f51e9",
+ "signedAt": "2026-11-18T10:18:01Z"
+ }
}