Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Signing canonicalization corrections + live-verified project_file findings (LAN http url, S3 presigned rejection, clean_print_error, md5 semantics)

未关闭
#72 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
aws

调研方向

从 cloud-x509-auth.md 和 docs/CRACK.md 中关于 live-testing 的说明开始。将关于 canonicalization、project_file、clean_print_error、URL、md5 和 state machine 的发现与现有文档进行比较。完成的标准是:使用相关的 recipe 和注意事项记录更正内容及已验证的行为。

由索引模型根据 Issue 内容生成。

描述

Corrections + new findings from live 2026-firmware P2S testing (signed commands, project_file)

Verified against a Bambu Lab P2S on 2026 firmware, cloud mode (X.509 app-cert route). Posting corrections to cloud-x509-auth.md plus several undocumented behaviors we confirmed live. Full write-up + tooling: https://github.com/Snail3D/bamboo-sense/blob/main/docs/CRACK.md

1. The signing canonicalization in cloud-x509-auth.md is wrong (sorted keys)

The doc's sorted-keys recipe does not verify. What actually works (confirmed by byte-level variant testing against the printer's error codes, and consistent with the decompiled signer in Randomblock1/bambu_connect_disasm):

  • Sign JSON.stringify(envelope_without_header) in original insertion order — "print" (or "security"/"system") object first, "user_id" trailing, outside the command object
  • sequence_id must be a number, not a string (string sequence_ids change the error signature)
  • header is then spliced in before the final } of the signed bytes: signed_bytes[:-1] + ',"header":{...}' + '}'
  • payload_len = UTF-8 byte length of the signed string
  • sig = base64(RSA-SHA256 PKCS1v15 over the signed bytes)
  • cert_id = 32-hex-char leaf serial + issuer CN, e.g. 5A5A…CN=GLOF3813734089.bambulab.com (issuer CN, not the leaf CN)

Useful error-code map (from the security result path):

reason / shape meaning
no header at all rejected before parsing
0x05024009-family malformed envelope
0x0502400A-family header present, signature doesn't verify (wrong canonical form, wrong cert_id, or cert not installed)

2. print.project_file — fully working recipe + the URL gotcha nobody documents

{"print":{"sequence_id":<int>,"command":"project_file","param":"Metadata/plate_1.gcode",
"url":"<URL>","md5":"<md5 of the ENTIRE .3mf file>","project_id":"0","profile_id":"0",
"task_id":"0","subtask_id":"0","use_ams":true,"ams_mapping":[<tray idx>],
"bed_leveling":true,"flow_cali":false,"vibration_cali":true,"layer_inspect":true,
"timelapse":false},"user_id":"<uid>"}
  • md5 is the md5 of the whole 3mf file, NOT the Metadata/plate_1.gcode.md5 stored inside it. Wrong md5 ⇒ task aborts in PREPARE with print_error 83902527 (0x0500403F), before any heating.
  • url works as plaintext; url_enc (RSA to printer_cert) is accepted but not required on this firmware.
  • use_ams:false makes the printer pull from the external spool holder; if that's empty it fails with HMS_0300-0200 (filament ran out). ams_mapping = tray index list, one entry per filament.
The big one: url can be a plain LAN http:// URL on a cloud-mode printer

We started a real print on a cloud-mode (not LAN-only) P2S by handing project_file a bare http://192.168.x.x:8477/model.gcode.3mf served by a laptop. Printer did HEAD + GET and pulled 18.7 MB over LAN. Cloud-mode printer, zero Bambu cloud involvement, no SD card, no LAN-only mode.

The trap: presigned S3 URLs are rejected in PREPARE

Upload via v1/iot-service/api/user/upload (PUT 200) and hand the returned https://s3.us-west-2.amazonaws.com/or-cloud-upload-prod/...?AWSAccessKeyId=...&Signature=... URL to project_file: command is ACKed SUCCESS, printer shows PREPARE, then fails ~75 s later with print_error 83902527, no heating, HMS_0100-0100. Reproduced 3×. The firmware evidently only fetches from allow-listed hosts. If you see "ACK SUCCESS → PREPARE → FAILED 0x0500403F": it's the URL, not your signature/md5/AMS.

3. Undocumented print.clean_print_error command

{"print":{"command":"clean_print_error","sequence_id":N}} (signed normally) is accepted and clears the HMS alarm list (verified: HMS 0x10001 entry vanished). gcode_state remains FAILED as a sticky last-task-outcome field (same way FINISH persists). Notably, a LAN-url project_file still starts while gcode_state reads FAILED — the "ERROR STATE" refusals we saw were tied to the S3-url attempts, not to the latch. system.restart/system.reboot over MQTT are silently ignored.

4. State machine notes

  • Signed stop during RUNNING aborts instantly (verified at 238 °C nozzle).
  • stop from FINISH returns SUCCESS but is a no-op; resume from FAILED returns FAIL.
  • New project_file while FAILED: depends on URL validity — LAN urls launched fine, S3 urls got {"result":"FAIL","reason":"ERROR STATE"}.

Happy to turn any of this into PRs against the relevant docs if you want — the full recipe, scripts and the dongle implementation (ESP32-S3 signing vault that installs its own cert via app_cert_install and signs commands on-chip) are MIT-licensed at Snail3D/bamboo-sense.

主要语言
没有语言数据
星标
684
派生
96
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Doridian/OpenBambuAPI 的其他 Issue

查看 Doridian/OpenBambuAPI 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。