You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ssbKeys.generate() throws an error in my electron environment.
Error: argument sd must be a buffer
at Error (native)
at Object.generate (/Users/zat/.ghq/github.com/uiureo/sonoba/node_modules/ssb-keys/sodium.js:13:30)
at Object.exports.generate (/Users/zat/.ghq/github.com/uiureo/sonoba/node_modules/ssb-keys/index.js:78:37)
at Object.<anonymous> (/Users/zat/.ghq/github.com/uiureo/sonoba/main.js:8:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at loadApplicationPackage (/Users/zat/.ghq/github.com/uiureo/sonoba/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/default_app.asar/main.js:257:12)
The problem is that sodium.randombytes(buffer) returns true in the electron environment.
This is weird because it returns null in node environment and works correctly.
I think that seed = seed || sodium.randombytes(seed = new Buffer(32)) is not necessary and removing this line resolves the issue.
But I don't understand well how it behaves in other environments.
The text was updated successfully, but these errors were encountered:
Thanks, fixed in ssb-keys@6.1.2
By the way, we are shifting development of ssb-* modules to use https://github.com/clehner/git-ssb
we'll still take pull requests via github, of course, but git-ssb is preferred.
electron: v1.2.8
ssbKeys.generate()
throws an error in my electron environment.The problem is that
sodium.randombytes(buffer)
returnstrue
in the electron environment.This is weird because it returns
null
in node environment and works correctly.ssb-keys/sodium.js
Line 9 in c6ca6ea
I think that
seed = seed || sodium.randombytes(seed = new Buffer(32))
is not necessary and removing this line resolves the issue.But I don't understand well how it behaves in other environments.
The text was updated successfully, but these errors were encountered: