-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove encryption for Brave Rewards vBAT wallet #17571
Comments
@tmancey I’ve put up a skeleton of a test plan here for review/feedback, please, when you get a moment? Questions:
Thanks! |
@stephendonner An unencrypted
An encrypted value for
Your test cases look good to me. We may also want to ensure that for the upgrade cases, wallet actions do not result in any errors. Wallet actions might include fetching promotions (grants), tipping, etc. |
Looks good to me and thanks @zenparsing, much appreciated |
Verified
|
Brave | 1.31.77 Chromium: 94.0.4606.71 (Official Build) beta (64-bit) |
---|---|
Revision | 1d32b169326531e600d836bd395efc1b53d0f6ef-refs/branch-heads/4606@{#1256} |
OS | Linux |
Steps:
Case One:
Check upgrade paths to confirm encrypted wallet(s) in the Preferences
file are decrypted
- fresh install
1.27.111
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in/home/stephendonner/.config/BraveSoftware/Brave-Browser-Beta/Default
(confirm wallets areencrypted
) - upgrade to
1.31.68
- accepted UGP grant (
2x 2.00 BAT
) - tipped and auto-contributed
- open
Preferences
in/home/stephendonner/.config/BraveSoftware/Brave-Browser-Beta/Default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
1.27.111
was encrypted
:
"wallets": {
"brave": "djExz...74E1s=",
"uphold": "djExj...9YOch/"
}
1.31.68
upgrade was decrypted
"wallets": {
"brave": "{\"payment_id\":\"75522a22-4d5e-48a8-84c2-d3ba88e74515\",\"recovery_seed\":\"xlrsEs/6kUGpLrrA1n01ah3z4P4U5uIg/0U0CRTUgcg=\"}",
"uphold": "djExj...2/jTvk="
}
},
Case Two:
Check upgrade paths to confirm corrupted wallets in the Preferences
file are not decrypted
- fresh install
1.29.81
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- corrupt the wallet by adding junk characters to the
wallet
inPreferences
- upgrade to
1.31.68
- open
Preferences
in/home/stephendonner/.config/BraveSoftware/Brave-Browser-Beta/Default
- confirm
brave.rewards.wallet.brave
isencrypted
Actual:
"wallets": {
"brave": "----JUNK_CHARACTERS---djEx803xj7MGDWVjYETG...8tMdc0=",
"uphold": "djExj2Ju...74EEg4="
}
},
Confirmed I got the following in logs:
[20885:20885:1008/123130.615311:INFO:wallet.cc(260)] Parsing of brave wallet failed
Case Three:
Check fresh install that vBAT wallet is persisted unencrypted
- fresh install
1.31.68
- launch Brave using Rewards staging
- click on the BAT icon in the URL bar
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Dev/default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
"wallets": {
"brave": "{\"payment_id\":\"6d3bcdf8-8...4e8-6d535d40ece9\",\"recovery_seed\":\"MmXxjD...oaM=\"}",
"uphold": "djExj2J...oRGlA="
}
},
Case Four:
Check restoring a wallet is persisted unencrypted
- fresh install
1.31.68
- launch Brave using Rewards staging
- enable Rewards
- click on
Manage your wallet
- click on the
Restore
tab - enter a recovery key (from QA wallet Ad grant spreadsheet ) and click
Restore
- close Brave
- open
Preferences
in/home/stephendonner/.config/BraveSoftware/Brave-Browser-Beta/Default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
"wallets": {
"brave": "{\"payment_id\":\"d477c3b2-...b9619b6e0\",\"recovery_seed\":\"62ENi...2vf38=\"}",
"uphold": "djExj2Ju...ZJUzc="
}
},
Verified PASSED
using
Brave | 1.31.68 Chromium: 94.0.4606.61 (Official Build) dev (x86_64) |
---|---|
Revision | 418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204} |
OS | macOS Version 11.6 (Build 20G165) |
Steps:
Case One:
Check upgrade paths to confirm encrypted wallet(s) in the Preferences
file are decrypted
- fresh install
1.27.111
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Dev/default
(confirm wallets areencrypted
) - confirm the wallet is
decrypted
- upgrade to
1.31.68
- accepted UGP grant (
2x 2.00 BAT
) - tipped and auto-contributed
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Dev/default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
1.27.111
was encrypted
:
"wallets": {
"brave": "djEwW1...9QOyo=",
"uphold": "djEwi8...IrIA=="
}
1.31.68
upgrade was decrypted
"wallets": {
"brave": "{\"payment_id\":\"a72952c9-c5d6-4177-a0ff-d8041a42cfcd\",\"recovery_seed\":\"FU3qO/25Hke0nF5BTWHvjObJrTrIhtKLU9vpbaq+qQQ=\"}",
example | example |
---|---|
Case Two:
Check upgrade paths to confirm corrupted wallets in the Preferences
file are not decrypted
- fresh install
1.29.81
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- corrupt the wallet by adding junk characters to the
wallet
inPreferences
- upgrade to
1.31.68
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Beta/default
- confirm
brave.rewards.wallet.brave
isencrypted
Actual:
"wallets": {
"brave": "^H@@H@HH@[email protected]=",
Confirmed I got the following in logs:
[12977:259:0930/101840.179888:INFO:wallet.cc(260)] Parsing of brave wallet failed
[12977:259:0930/101840.180770:INFO:wallet_create.cc(32)] Wallet does not exist and could not be created
[12977:259:0930/101840.181386:INFO:promotion.cc(315)] Wallet couldn't be created
example | example |
---|---|
Case Three:
Check fresh install that vBAT wallet is persisted unencrypted
- fresh install
1.31.68
- launch Brave using Rewards staging
- click on the BAT icon in the URL bar
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Dev/default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
"wallets": {
"brave": "{\"payment_id\":\"71995091-ce62-49c0-819f-45fd5d52091d\",\"recovery_seed\":\"VAJ16s4PN6LRR7wgHPY+Yt2J3z4EY6pnL8hvYVI5s1s=\"}",
Case Four:
Check restoring a wallet is persisted unencrypted
- fresh install
1.31.68
- launch Brave using Rewards staging
- enable Rewards
- click on
Manage your wallet
- click on the
Restore
tab - enter a recovery key (from QA wallet Ad grant spreadsheet ) and click
Restore
- close Brave
- open
Preferences
in/Users/stephendonner/Library/Application\ Support/BraveSoftware/Brave-Browser-Beta/default
- confirm
brave.rewards.wallet.brave
isunencrypted
Actual:
"wallets": {
"brave": "{\"payment_id\":\"108809fb-497e-4ed6-a0cd-abfc6224497d\",\"recovery_seed\":\"gqHvjgCit0fsn+VYOlluWRpdbcQeBh97YBv1C7sPZHc=\"}",
Verification passed on
Brave | 1.31.71 Chromium: 94.0.4606.71 (Official Build) beta (64-bit)
-- | --
Revision | 1d32b169326531e600d836bd395efc1b53d0f6ef-refs/branch-heads/4606@{#1256}
OS | Windows 10 Version 21H1 (Build 19043.1266)
Clean profile
Case 1: Check vBAT wallet is persisted unencrypted in a clean profile
- fresh install
1.31.68
- launch Brave using Rewards staging
- click on the BAT icon in the URL bar
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in..\AppData\Local\BraveSoftware\Brave-Browser-Beta\User Data\Default
- confirm
brave.rewards.wallet.brave
isunencrypted
"wallets":{"brave":"{\"payment_id\":\"29b5a156-788f-4aaf-bddb-e2df3b731843\",\"recovery_seed\":\"1SOlQRZ9SarsHUWNfSQLK0ehLBcp6YLiOzKFvb+/4y8=\"}"
Case 2: Check restoring a wallet is persisted unencrypted
- fresh install
1.31.68
- launch Brave using Rewards staging
- enable Rewards
- click on
Manage your wallet
- click on the
Restore
tab - enter a recovery key (from QA wallet Ad grant spreadsheet ) and click
Restore
- close Brave
- open
Preferences
in..\AppData\Local\BraveSoftware\Brave-Browser-Beta\User Data\Default
- confirm
brave.rewards.wallet.brave
isunencrypted
wallets":{"brave":"{\"payment_id\":\"6b754df1-caa0-4255-988e-88dd4b078c98\",\"recovery_seed\":\"tljsIOjVHv/M/oZWIPVpwIL8jlCDWWdRwkOc/IhkEQ0=\"}"
Upgrade profile
Case 1: Check upgrade paths to confirm encrypted wallet(s) in the Preferences
file are decrypted in 1.31.x
- fresh install
1.30.87
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- open
Preferences
in...AppData\Local\BraveSoftware\Brave-Browser\User Data\Default
(confirm wallets areencrypted
) - upgrade to
1.31.71
- open
Preferences
in...\AppData\Local\BraveSoftware\Brave-Browser-Beta\User Data\Default
- confirm
brave.rewards.wallet.brave
isdecrypted
1.30.87
- wallet is encrypted
wallets": {
"brave":"djEwtF.......+1SizFAyCGli.....bQ0T",
"uphold":"djEw.......+mau9KDyF3....dU01="}
After upgrade to 1.31.71
- wallet is decrypted
wallets":{"brave":"{\"payment_id\":\"cabcec37-ea27-469f-a2f7-0460f96da701\",\"recovery_seed\":\"+2hoxswKUKcjeHDDJtIb6ifzv54llm28FRNizqLzOx8=\"}"
Case 2: Check upgrade paths to confirm corrupted wallets in the Preferences
file are not decrypted
- fresh install
1.30.87
- launch Brave using Rewards staging
- enable Rewards
- accept UGP grant
- close Brave
- corrupt the wallet by adding junk characters to the
wallet
inPreferences
- upgrade to
1.31.71
- open
Preferences
in...AppData\Local\BraveSoftware\Brave-Browser-Beta\User Data\Default
- confirm
brave.rewards.wallet.brave
isencrypted
1.30.87
wallet was encrypted added junk characters to the wallet
wallets":{"brave":"@@@@@@@#$%HSi2dIm4gLER9Va7hSUHG0FQgcbNkqzQ/ANLwZyzEQTQXYWyz3+aT3JLpASk9gU4HrUoKElc3nmZoW/5ty4g5nViLSezk5xUK1EQ9exk2kRsa5ZxlPbgGQag/6+oYhc3vrlOBz1lVRliNOY/0ASImN5mZIcgMyA7fFRUTOh1/PKLUUb6KAdfXWRWbp"
After upgrade to 1.31.71
wallet remained encrypted
"wallets":{"brave":"@@@@@@@#$%HSi2dIm4gLER9Va7hSUHG0FQgcbNkqzQ/ANLwZyzEQTQXYWyz3+aT3JLpASk9gU4HrUoKElc3nmZoW/5ty4g5nViLSezk5xUK1EQ9exk2kRsa5ZxlPbgGQag/6+oYhc3vrlOBz1lVRliNOY/0ASImN5mZIcgMyA7fFRUTOh1/PKLUUb6KAdfXWRWbp"
Verification passed on Oppo Reno 5 with Android 11 running 1.31.86 x64 build
|
Description (added Sept 30):
Removes encryption of the Rewards wallet. See here for specifics: #17571 (comment).
Test plan (from Sept 28):
See Stephen's comment below: https://gist.github.com/stephendonner/4b1cb47c4956a5d7b6fbf5b584d0f563
The text was updated successfully, but these errors were encountered: