Skip to content

fix(invoice)!: hash stored signed XML - #52

Merged
mqqz merged 2 commits into
mainfrom
fix/signed-xml-hash
Oct 19, 2026
Merged

mqqz merged 2 commits into
mainfrom
fix/signed-xml-hash

Conversation

@mqqz

@mqqz mqqz commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Change type

  • Bug fix
  • Tests
  • Documentation

Description

Imported signed invoices can produce the wrong document hash because hash_base64() reserializes their parsed model. Hash the stored XML directly so signed.hash_base64() equals Xml.hash(signed.xml()) across bindings. CLI generate-hash also hashes its input XML directly.

Behavioral breaking change: imported documents can produce different digests. Finalized invoices still hash their emitted XML, and invoice_hash() still returns the embedded digest. No model-hash compatibility method is added. Digest equality alone does not verify signature authenticity.

Validation

  • Passed Rust workspace tests with live ZATCA calls disabled; the new regression fails with the old implementation and passes with the fix.
  • Passed Python (63 tests), C/C++, JavaScript/WASM and TypeScript checks, and Kotlin/Java (11 tests).
  • Passed Clippy, formatting, binding-generation checks, and strict documentation build.
  • Added .NET regression coverage; local execution unavailable because the SDK is absent.

Checklist

  • Reviewed the diff and added regression coverage
  • Updated API documentation and migration notes
  • Documented the behavioral break; versioning remains a separate release task

BREAKING CHANGE: signed hash_base64() hashes stored XML; CLI
generate-hash hashes input XML directly. Imported documents can
produce different digests. The embedded invoice_hash() accessor
remains unchanged. No model-hash compatibility method is added.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T13:37:48.565278Z 9826617 PR opened
ℹ️ 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
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mqqz
mqqz merged commit fe22e2a into main Oct 19, 2026
33 checks passed
@mqqz
mqqz deleted the fix/signed-xml-hash branch October 19, 2026 15:02
@mqqz mqqz mentioned this pull request Oct 19, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant