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

Preserve Whitespace in Brave Wallet Signing Message Text #22699

Closed
devstein opened this issue May 4, 2022 · 1 comment · Fixed by brave/brave-core#13531
Closed

Preserve Whitespace in Brave Wallet Signing Message Text #22699

devstein opened this issue May 4, 2022 · 1 comment · Fixed by brave/brave-core#13531

Comments

@devstein
Copy link

devstein commented May 4, 2022

Description

Hi 👋 , first of all I've switched to Brave a few months ago from Chrome and absolutely love it.

I'm working on a wallet-based OAuth 2.0 compatible identity provider, called Picket, and as part of the authentication flow the user signs a custom message with an appended random nonce. User's want the custom messaging to be readable and friendly (signing a message is scary!) and typically include whitespace in the message. Unfortunately Brave Wallet, unlike Metamask and Rainbow, does not preserve whitespace.

Steps to Reproduce

In a Brave Browser,

  1. Login to your wallet
  2. Connect your wallet to ETH JS library, like ether.js
  3. Sign a message with whitespace
const message = `
Hi,

this has whitespace.

please sign it!
`

await signer.signMessage(nonce);

Actual result:

Whitespace is not preserved:

Screen Shot 2022-05-04 at 4 15 48 PM

Expected result:

Whitespace is not preserved, like in Metamask:

Screen Shot 2022-05-04 at 4 15 21 PM

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

1.38.109 Chromium: 101.0.4951.41 (Official Build) (x86_64)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? N/A
  • Does the issue resolve itself when disabling Brave Rewards? N/A
  • Is the issue reproducible on the latest version of Chrome? N/A

Miscellaneous Information:

@srirambv
Copy link
Contributor

Brave 1.41.82 Chromium: 103.0.5060.66 (Official Build) beta (64-bit)
Revision 20b1569438a85e631d15e83eb355e3e326e5da6f-refs/branch-heads/5060@{#1066}
OS ☑️ Linux ☑️ Windows 11 Version 21H2
(Build 22000.708)
☑️ macOS Version 12.0.1
(Build 21C52)
  • Verified steps from issue description
  • Verified whitespace is preserved on sign messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment