Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validateMessage option to signMessage #148

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Sep 1, 2023

signMessage is supposed to be rejecting malformed input but relies on implicit behavior in dependencies to do so. This makes it brittle and it can be seen failing here: https://github.com/MetaMask/eth-simple-keyring/actions/runs/6053985322/job/16430596839

This adds validation that the string has a length and is a hexadecimal string with optional 0x-prefix. It makes it optional via the new validateMessage option (default: true)

Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@legobeat legobeat merged commit c71c969 into MetaMask:main Sep 12, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants