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

Update bip to use js version of pbkdf2 in even more specific use cases #1778

Merged
merged 1 commit into from
Aug 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions patches/bip39+2.6.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/bip39/index.js b/node_modules/bip39/index.js
index efed68c..5630380 100644
index efed68c..d487227 100644
--- a/node_modules/bip39/index.js
+++ b/node_modules/bip39/index.js
@@ -4,6 +4,8 @@ var _pbkdf2 = require('pbkdf2')
Expand All @@ -22,7 +22,7 @@ index efed68c..5630380 100644
-
- return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512')
+ // For chrome environments use the javascript version of pbkdf2
+ if (!!global.__REMOTEDEV__ || (global.location && global.location.pathname.includes('/debugger-ui')))
+ if (__DEV__ && (!!global.__REMOTEDEV__ || (global.location && global.location.pathname.includes('/debugger-ui'))))
+ return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512')
+ const seed = Aes.pbkdf2Sync(mnemonicBuffer.toString('utf8'), saltBuffer.toString('utf8'), 2048, 512);
+ const seedBuffer = global.Buffer.from(seed, "hex")
Expand Down