-
Notifications
You must be signed in to change notification settings - Fork 871
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
fix: pw protect seed during backup after on-board #14541
Conversation
A Storybook has been deployed to preview UI for the latest push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@josheleonard Can you please upload a screen recording? |
components/brave_wallet_ui/page/screens/backup-wallet/intro/backup-wallet-intro.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did a quick static analysis and it looks good. I'll grab the build from CI and make sure it's working as expected and can give a recording for @onyb as well while I'm at it
@onyb this is a recording of how it should be working, but I seem to get quite a bit of crashing on this build now. Can anyone else reproduce these crashes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a security perspective, could be good to refactor that maxAttempts number to be set once by the function rather than by the caller, but that's non blocking and this looks good to me.
Let's double check that the crashing isn't related to this change and then I think it's good to go
Taking a look at the crashing issue now. |
I tried recreating this by resetting the wallet and onboarding a second time while recording. No crash here on M1 mac. Screen.Recording.2022-08-09.at.11.04.03.AM.mov |
Refactored here: 68792720acfaf1091b23a0687b4afc5095e18ce7 |
A Storybook has been deployed to preview UI for the latest push |
👍🏻 I'll double check this either this afternoon or tomorrow to try and build locally to see if it was just a problem with how I was using it. After doublechecking this it seems like it's still failing for me even with a fresh install.
Sounds good thanks for updating that |
@kdenhartog, were you able to confirm that this branch is causing crashes, or is it related to something on master? |
6879272
to
fa88d2a
Compare
A Storybook has been deployed to preview UI for the latest push |
setPassword(value) | ||
} | ||
|
||
const onContinue = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add useCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change
Hey it seems that we're going to move away from a UI based approach for this based on this discussion: https://bravesoftware.slack.com/archives/C023VS4HJ6Q/p1660751349341859 @yrliou are you the one who's going to help coordinate this? |
@kdenhartog I can help prepare a backend commit that makes |
Created b2f2893 for backend API protection that's ready to be cherry-picked once this PR branch is rebased on master. |
fa88d2a
to
eb99d97
Compare
A Storybook has been deployed to preview UI for the latest push |
|
||
// unlock with wrong password | ||
ASSERT_FALSE(Unlock(&service, "brave123")); | ||
ASSERT_FALSE(Unlock(&service, kPasswordBrave123)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see it locks after 1 failed attempt here since that's simpler for state management at this layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not because of 1 failed attempt, it's just still locked because this line try to unlock with wrong password.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the API layer changes made by @yrliou
Looks like we'd just need to do the refactor to use this and then this would be good to go
@@ -2137,11 +2143,9 @@ void KeyringService::IsStrongPassword(const std::string& password, | |||
std::move(callback).Run(true); | |||
} | |||
|
|||
void KeyringService::ValidatePassword(const std::string& password, | |||
ValidatePasswordCallback callback) { | |||
bool KeyringService::ValidatePasswordInternal(const std::string& password) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend++
A Storybook has been deployed to preview UI for the latest push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Pavneet-Sing would you mind to review Android fixes? I didn't post a video as we hide onboarding with password prompts for a sec reasons, but it does similar as desktop plus uses biometric if it's set. |
A Storybook has been deployed to preview UI for the latest push |
...romium/chrome/browser/crypto_wallet/fragments/onboarding_fragments/BackupWalletFragment.java
Show resolved
Hide resolved
...romium/chrome/browser/crypto_wallet/fragments/onboarding_fragments/BackupWalletFragment.java
Outdated
Show resolved
Hide resolved
717f920
to
0e0283e
Compare
0e0283e
to
3a3c3fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
A Storybook has been deployed to preview UI for the latest push |
test-javascript failure on linux, windows-x86, windows, it's known brave/brave-browser#24787 and irrelevant to this PR. |
For macOS https://ci.brave.com/job/pr-brave-browser-fix-pw-protect-seed-during-backup-macos/8/ was successful with only the same javascript test error above, after that it's only android changes due to review which won't affect macOS build at all. |
Merging, see above comments for CI notes. |
Resolves brave/brave-browser#24534
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Screen.Recording.2022-08-09.at.11.08.10.AM.mov