Skip to content

Conversation

@droter
Copy link

@droter droter commented Jan 19, 2026

When decoding HTTP messages, content-digest was unconditionally removed from the message map before commitment verification. This caused HMAC commitment verification to fail for JSON messages that included content-digest as part of their signed fields.

This fix applies the same pattern used for ao-body-key: check if content-digest is a signed key before removing it. If it was part of the commitment, it is preserved for verification.

Reproducer:

  • Send a JSON message with a data field and explicit content-digest
  • The hbsig library computes content-digest for the data field
  • HyperBEAM strips content-digest before HMAC verification
  • Verification fails with invalid_commitment

This is similar to the fix in PR #610 for content-type preservation.

closes issue #615

When decoding HTTP messages, `content-digest` was unconditionally
removed from the message map before commitment verification. This
caused HMAC commitment verification to fail for JSON messages that
included `content-digest` as part of their signed fields.

This fix applies the same pattern used for `ao-body-key`: check if
`content-digest` is a signed key before removing it. If it was part
of the commitment, it is preserved for verification.

Reproducer:
- Send a JSON message with a `data` field and explicit `content-digest`
- The hbsig library computes content-digest for the data field
- HyperBEAM strips content-digest before HMAC verification
- Verification fails with `invalid_commitment`

This is similar to the fix in PR permaweb#610 for `content-type` preservation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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