fix(03-04): HMAC data-check-string excludes only hash — signature field participates (real clients rejected as tampered; erratum M6)

This commit is contained in:
araharah-executor
2026-10-23 01:34:19 +08:00
parent c062ebaee1
commit 22fda6d12a
3 changed files with 53 additions and 6 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ const TEST_TOKEN = "12345:TESTTOKEN"; // same signer token as initdata.test.mjs
function dataCheckString(fields) {
return fields
.filter(([key]) => key !== "hash" && key !== "signature")
.filter(([key]) => key !== "hash")
.slice()
.sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))
.map(([key, value]) => `${key}=${value}`)