Vendor telegram webapp sdk and bump to 0.10.4#87
Vendor telegram webapp sdk and bump to 0.10.4#87RAprogramm wants to merge 1 commit intonew_versionfrom
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| let secret_key = Hash::hash(format!("WebAppData{}", bot_token).as_bytes()); | ||
| let expected_hash = HMAC::mac(check_string.as_bytes(), secret_key); | ||
| let expected_hex = encode(expected_hash); |
There was a problem hiding this comment.
[P1] Derive Telegram secret key with HMAC not SHA256
The new verify_init_data_hash helper derives secret_key using Hash::hash(format!("WebAppData{}", bot_token).as_bytes()) before calling HMAC::mac on the data check string. According to Telegram’s WebApp verification rules, the secret key must be HMAC_SHA256(b"WebAppData", bot_token), not a plain SHA256 of the concatenated string. Because the intermediate key is wrong, the routine will return false for every valid init_data payload, making the helper unusable for legitimate verification flows.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ce7718599c832ba1fb793a384df2e6