Skip to content

fix: preserve signed content-digest key in JSON messages#614

Open
droter wants to merge 1 commit intopermaweb:edgefrom
credentum:fix/preserve-signed-content-digest
Open

fix: preserve signed content-digest key in JSON messages#614
droter wants to merge 1 commit intopermaweb:edgefrom
credentum:fix/preserve-signed-content-digest

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>
@droter droter force-pushed the fix/preserve-signed-content-digest branch from b0eaf0f to 448bdbc Compare February 5, 2026 00:17
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