Merge pull request #810 from GoodDollar/SEA-concurrent-possible-fix

SEA concurrent possible fix
This commit is contained in:
Mark Nadal 2019-09-06 01:29:10 -07:00 committed by GitHub
commit 8a44eb7f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1538 additions and 905 deletions

View File

@ -19,7 +19,6 @@ Gun.on('opt', function(root){
os.loadavg = os.loadavg || noop;
os.cpus = os.cpus || noop;
setTimeout(function(){
root.opt.file += (process.argv[2]||'');
root.stats = Gun.obj.ify((fs.existsSync(__dirname+'/../stats.'+root.opt.file) && fs.readFileSync(__dirname+'/../stats.'+root.opt.file).toString())) || {};
root.stats.up = root.stats.up || {};
root.stats.up.start = root.stats.up.start || +(new Date);
@ -56,4 +55,4 @@ Gun.on('opt', function(root){
stats.gap = {};
}, 1000 * 15);
Object.keys = Object.keys || function(o){ return Gun.obj.map(o, function(v,k,t){t(k)}) }
});
});

2436
sea.js

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
var epriv = pair.epriv;
var ecdhSubtle = shim.ossl || shim.subtle;
var pubKeyData = keysToEcdhJwk(pub);
var props = Object.assign(S.ecdh, { public: await ecdhSubtle.importKey(...pubKeyData, true, []) });
var props = Object.assign({ public: await ecdhSubtle.importKey(...pubKeyData, true, []) },S.ecdh);
var privKeyData = keysToEcdhJwk(epub, epriv);
var derived = await ecdhSubtle.importKey(...privKeyData, false, ['deriveKey']).then(async (privKey) => {
// privateKey scope doesn't leak out from here!
@ -47,4 +47,4 @@
}
module.exports = SEA.secret;