Skip to content

fix: Add defensive error check to mpt_get_send_context_hash#7659

Open
ManimaranRepos wants to merge 2 commits into
XRPLF:developfrom
ManimaranRepos:fix/issue-7651-defensive-error-check
Open

fix: Add defensive error check to mpt_get_send_context_hash#7659
ManimaranRepos wants to merge 2 commits into
XRPLF:developfrom
ManimaranRepos:fix/issue-7651-defensive-error-check

Conversation

@ManimaranRepos

Copy link
Copy Markdown

Summary

Adds defensive error checking to the getSendContextHash() function to properly handle failures from the underlying mpt_get_send_context_hash() C library function.

Changes

  • Add error check to getSendContextHash() in ConfidentialTransfer.cpp
  • Throw runtime error if context hash computation fails
  • Add period to tecBAD_PROOF error message for consistency

Fixes #7651

@github-actions

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign them. ⚠️

If only the most recent commit is unsigned, you can run:

  1. Amend the commit: git commit --amend --no-edit -n -S
  2. Overwrite the commit: git push --force-with-lease

If multiple commits are unsigned, you can run:

  1. Go into interactive rebase mode: git rebase --interactive HEAD~<NUM_OF_COMMITS>, where NUM_OF_COMMITS is the number of most recent commits that will be available to edit.
  2. Change "pick" to "edit" for the commits you need to sign, and then save and exit.
  3. For each commit, run: git commit --amend --no-edit -n -S
  4. Continue the rebase: git rebase --continue
  5. Overwrite the commit(s): git push --force-with-lease

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.
See use 1Password to sign your commits.

- Add error checking to getSendContextHash() function
- Return error if mpt_get_send_context_hash() fails
- Add period to tecBAD_PROOF error message for consistency

Fixes XRPLF#7651

Signed-off-by: Manimaran <smanimarancse@gmail.com>
@ManimaranRepos ManimaranRepos force-pushed the fix/issue-7651-defensive-error-check branch from f68b2dd to afff396 Compare June 29, 2026 14:49
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.

add defensive error check to mpt_get_send_context_hash

1 participant