Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants