-
Notifications
You must be signed in to change notification settings - Fork 868
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 UNSAFE_TODO for wallet #26253
base: master
Are you sure you want to change the base?
Fix UNSAFE_TODO for wallet #26253
Conversation
[puLL-Merge] - brave/brave-core@26253 DescriptionThis PR makes several changes to improve code quality, security, and performance in the Brave Wallet component. The main changes include:
Possible Issues
Security Hotspots
ChangesChanges
These changes aim to improve code quality, remove unsafe practices, and enhance the overall security and performance of the Brave Wallet component. |
@@ -13,12 +13,14 @@ | |||
|
|||
#include "base/containers/span.h" | |||
#include "base/gtest_prod_util.h" | |||
#include "brave/components/brave_wallet/common/hash_utils.h" |
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.
what is this header for?
if (byte <= 0xf) { | ||
std::string one_char_byte; | ||
base::AppendHexEncodedByte(byte, one_char_byte, false); | ||
result += one_char_byte[1]; |
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.
base::StrAppend?
#include "base/compiler_specific.h" | ||
#include "base/containers/adapters.h" | ||
#include "base/containers/span.h" | ||
#include "base/debug/crash_logging.h" |
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.
leftover?
@@ -32,16 +32,6 @@ class JSSolanaProvider final : public gin::Wrappable<JSSolanaProvider>, | |||
|
|||
static gin::WrapperInfo kWrapperInfo; | |||
|
|||
class V8ConverterStrategy : public content::V8ValueConverter::Strategy { |
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.
Why do we remove it entirely?
Have you tried solana.publicKey
and solana.signTransaction
after removal?
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.
changed v8array -> base::Value conversion from Value(base58 string) to Value(blob) which is exactly what default implementation does https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/v8_value_converter_impl.cc;l=503-529
so we don't need custom conversion strategy
Tried solana.publicKey
and it works as before
f762ee0
to
aac5df3
Compare
aac5df3
to
1aa65a4
Compare
1aa65a4
to
b2b95b6
Compare
Resolves
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
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: