mirror of
https://github.com/amark/gun.git
synced 2025-11-24 14:35:55 +00:00
fix: salt should not be random #1052
see #1052 this causes hash tables to fail, because a different hash will be generated for content every time. in case incomming salt is null, it will be set to always be the empty string
This commit is contained in:
parent
4ded14186f
commit
9363ffddeb
2
sea.js
2
sea.js
@ -278,7 +278,7 @@
|
|||||||
if(cb){ try{ cb(rsha) }catch(e){console.log(e)} }
|
if(cb){ try{ cb(rsha) }catch(e){console.log(e)} }
|
||||||
return rsha;
|
return rsha;
|
||||||
}
|
}
|
||||||
salt = salt || shim.random(9);
|
salt = salt || '';
|
||||||
var key = await (shim.ossl || shim.subtle).importKey('raw', new shim.TextEncoder().encode(data), {name: opt.name || 'PBKDF2'}, false, ['deriveBits']);
|
var key = await (shim.ossl || shim.subtle).importKey('raw', new shim.TextEncoder().encode(data), {name: opt.name || 'PBKDF2'}, false, ['deriveBits']);
|
||||||
var work = await (shim.ossl || shim.subtle).deriveBits({
|
var work = await (shim.ossl || shim.subtle).deriveBits({
|
||||||
name: opt.name || 'PBKDF2',
|
name: opt.name || 'PBKDF2',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user