|
|
@ -22,7 +22,12 @@ define([
|
|
|
|
// 16 bytes for a deterministic channel key
|
|
|
|
// 16 bytes for a deterministic channel key
|
|
|
|
var channelSeed = dispense(16);
|
|
|
|
var channelSeed = dispense(16);
|
|
|
|
// 32 bytes for a curve key
|
|
|
|
// 32 bytes for a curve key
|
|
|
|
opt.curveSeed = dispense(32);
|
|
|
|
var curveSeed = dispense(32);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var curvePair = Nacl.box.keyPair.fromSecretKey(new Uint8Array(curveSeed));
|
|
|
|
|
|
|
|
opt.curvePrivate = Nacl.util.encodeBase64(curvePair.secretKey);
|
|
|
|
|
|
|
|
opt.curvePublic = Nacl.util.encodeBase64(curvePair.publicKey);
|
|
|
|
|
|
|
|
|
|
|
|
// 32 more for a signing key
|
|
|
|
// 32 more for a signing key
|
|
|
|
var edSeed = opt.edSeed = dispense(32);
|
|
|
|
var edSeed = opt.edSeed = dispense(32);
|
|
|
|
|
|
|
|
|
|
|
@ -109,6 +114,9 @@ define([
|
|
|
|
res.edPrivate = opt.edPrivate;
|
|
|
|
res.edPrivate = opt.edPrivate;
|
|
|
|
res.edPublic = opt.edPublic;
|
|
|
|
res.edPublic = opt.edPublic;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.curvePrivate = opt.curvePrivate;
|
|
|
|
|
|
|
|
res.curvePublic = opt.curvePublic;
|
|
|
|
|
|
|
|
|
|
|
|
// they tried to just log in but there's no such user
|
|
|
|
// they tried to just log in but there's no such user
|
|
|
|
if (!isRegister && isProxyEmpty(rt.proxy)) {
|
|
|
|
if (!isRegister && isProxyEmpty(rt.proxy)) {
|
|
|
|
rt.network.disconnect(); // clean up after yourself
|
|
|
|
rt.network.disconnect(); // clean up after yourself
|
|
|
|